Esempio n. 1
0
    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
Esempio n. 2
0
File: utils.py Progetto: mensi/pyggi
"""
    :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
Esempio n. 3
0
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(