# HG changeset patch # User Mads Kiilerich # Date 1563763102 -7200 # Node ID 87672c1916f8371c9f0a392d69168decfa24e0b2 # Parent b077cf7e7f90ed9ce4983da3d792772000c2d285 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 . diff -r b077cf7e7f90 -r 87672c1916f8 kallithea/config/app_cfg.py --- a/kallithea/config/app_cfg.py Mon Jul 22 04:18:37 2019 +0200 +++ b/kallithea/config/app_cfg.py Mon Jul 22 04:38:22 2019 +0200 @@ -156,8 +156,8 @@ 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']) diff -r b077cf7e7f90 -r 87672c1916f8 kallithea/controllers/search.py --- a/kallithea/controllers/search.py Mon Jul 22 04:18:37 2019 +0200 +++ b/kallithea/controllers/search.py Mon Jul 22 04:38:22 2019 +0200 @@ -84,7 +84,7 @@ 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 diff -r b077cf7e7f90 -r 87672c1916f8 kallithea/lib/celerylib/__init__.py --- a/kallithea/lib/celerylib/__init__.py Mon Jul 22 04:18:37 2019 +0200 +++ b/kallithea/lib/celerylib/__init__.py Mon Jul 22 04:38:22 2019 +0200 @@ -104,7 +104,7 @@ 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: diff -r b077cf7e7f90 -r 87672c1916f8 kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py Mon Jul 22 04:18:37 2019 +0200 +++ b/kallithea/lib/celerylib/tasks.py Mon Jul 22 04:38:22 2019 +0200 @@ -75,7 +75,7 @@ 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 @@ 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') diff -r b077cf7e7f90 -r 87672c1916f8 kallithea/tests/functional/test_search.py --- a/kallithea/tests/functional/test_search.py Mon Jul 22 04:18:37 2019 +0200 +++ b/kallithea/tests/functional/test_search.py Mon Jul 22 04:38:22 2019 +0200 @@ -16,10 +16,8 @@ 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'),