def isRepository(path): try: repo = Repo(path) except: return False try: preserve_daemon_export = config.getboolean('general', 'preserve_daemon_export') except: preserve_daemon_export = True if preserve_daemon_export: return repo.daemon_export return True
""" :copyright: (c) 2011 by Tobias Heinzen :license: BSD, see LICENSE for more details """ from flask import current_app from pyggi.lib.config import config import logging class DummyCache(object): def get(*args, **kwargs): pass def set(*args, **kwargs): pass if not (config.has_option('cache', 'enabled') and config.getboolean('cache', 'enabled')): cache = DummyCache() else: if current_app.debug: from werkzeug.contrib.cache import SimpleCache cache = SimpleCache() else: try: from werkzeug.contrib.cache import MemcachedCache cache = MemcachedCache([x.strip() for x in config.get('cache', 'uris').split(",") if not len(x.strip()) == 0]) except: cache = DummyCache() logging.critical("could not connect to memcache daemon - disabling caching") def get_clone_urls(): from flask import request
from flask import current_app from pyggi.lib.config import config import logging class DummyCache(object): def get(*args, **kwargs): pass def set(*args, **kwargs): pass if not (config.has_option('cache', 'enabled') and config.getboolean('cache', 'enabled')): cache = DummyCache() else: if current_app.debug: from werkzeug.contrib.cache import SimpleCache cache = SimpleCache() else: try: from werkzeug.contrib.cache import MemcachedCache cache = MemcachedCache([ x.strip() for x in config.get('cache', 'uris').split(",") if not len(x.strip()) == 0 ]) except: cache = DummyCache() logging.critical(