Changeset - 87672c1916f8
[Not reviewed]
default
0 5 0
Mads Kiilerich - 6 years ago 2019-07-22 04:38:22
mads@kiilerich.com
config: stop using the app_conf sub key - TurboGears2 2.4 will drop it

All [app:main] settings *except* cache_dir are also available at the top level. cache_dir can be found as tg.cache_dir .
5 files changed with 8 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/config/app_cfg.py
Show inline comments
 
@@ -156,8 +156,8 @@ def setup_configuration(app):
 
            sys.exit(1)
 

	
 
    # store some globals into kallithea
 
    kallithea.CELERY_ON = str2bool(config['app_conf'].get('use_celery'))
 
    kallithea.CELERY_EAGER = str2bool(config['app_conf'].get('celery.always.eager'))
 
    kallithea.CELERY_ON = str2bool(config.get('use_celery'))
 
    kallithea.CELERY_EAGER = str2bool(config.get('celery.always.eager'))
 
    kallithea.CONFIG = config
 

	
 
    load_rcextensions(root_path=config['here'])
kallithea/controllers/search.py
Show inline comments
 
@@ -84,7 +84,7 @@ class SearchController(BaseRepoControlle
 
        if c.cur_query:
 
            p = safe_int(request.GET.get('page'), 1)
 
            highlight_items = set()
 
            index_dir = config['app_conf']['index_dir']
 
            index_dir = config['index_dir']
 
            try:
 
                if not exists_in(index_dir, index_name):
 
                    raise EmptyIndexError
kallithea/lib/celerylib/__init__.py
Show inline comments
 
@@ -104,7 +104,7 @@ def __get_lockkey(func, *fargs, **fkwarg
 
def locked_task(func):
 
    def __wrapper(func, *fargs, **fkwargs):
 
        lockkey = __get_lockkey(func, *fargs, **fkwargs)
 
        lockkey_path = config['app_conf']['cache_dir']
 
        lockkey_path = config['tg.cache_dir']  # The configured cache_dir is only available under this name ...
 

	
 
        log.info('running task with lockkey %s', lockkey)
 
        try:
kallithea/lib/celerylib/tasks.py
Show inline comments
 
@@ -75,7 +75,7 @@ def get_commits_stats(repo_name, ts_min_
 
    DBS = celerylib.get_session()
 
    lockkey = celerylib.__get_lockkey('get_commits_stats', repo_name, ts_min_y,
 
                            ts_max_y)
 
    lockkey_path = config['app_conf']['cache_dir']
 
    lockkey_path = config['tg.cache_dir']  # The configured cache_dir is only available under this name ...
 

	
 
    log.info('running task with lockkey %s', lockkey)
 

	
 
@@ -99,7 +99,7 @@ def get_commits_stats(repo_name, ts_min_
 
            return True
 

	
 
        skip_date_limit = True
 
        parse_limit = int(config['app_conf'].get('commit_parse_limit'))
 
        parse_limit = int(config.get('commit_parse_limit'))
 
        last_rev = None
 
        last_cs = None
 
        timegetter = itemgetter('time')
kallithea/tests/functional/test_search.py
Show inline comments
 
@@ -16,10 +16,8 @@ class TestSearchController(TestControlle
 
        self.log_user()
 

	
 
        config_mock = {
 
            'app_conf': {
 
                # can be any existing dir that does not contain an actual index
 
                'index_dir': str(tmpdir),
 
            }
 
            # can be any existing dir that does not contain an actual index
 
            'index_dir': str(tmpdir),
 
        }
 
        with mock.patch('kallithea.controllers.search.config', config_mock):
 
            response = self.app.get(url(controller='search', action='index'),
0 comments (0 inline, 0 general)