Changeset - 3070f9bc6ebe
default
0
2
0
Grafted from: 03aff38b214a
cli: refactor db_create to avoid app initialization in multiple places
Make sure kallithea.config.application.make_app only is invoked at a high level
... and avoid references to kallithea.CONFIG.global_conf right before
kallithea.CONFIG is set to a plain dict again.
Click commands that have both needs_config_file=True and
config_file_initialize_app=True will now be called twice - first time before
setting kallithea.CONFIG but with the config dict as parameter.
That seems kind of intuitive and will simplify the code and allow cleanup of
config handling.
Mute pytype warning:
File "kallithea/bin/kallithea_cli_db.py", line 73, in db_create: No attribute 'global_conf' on Dict[nothing, nothing] [attribute-error]
File "kallithea/bin/kallithea_cli_db.py", line 73, in db_create: No attribute 'local_conf' on Dict[nothing, nothing] [attribute-error]
Make sure kallithea.config.application.make_app only is invoked at a high level
... and avoid references to kallithea.CONFIG.global_conf right before
kallithea.CONFIG is set to a plain dict again.
Click commands that have both needs_config_file=True and
config_file_initialize_app=True will now be called twice - first time before
setting kallithea.CONFIG but with the config dict as parameter.
That seems kind of intuitive and will simplify the code and allow cleanup of
config handling.
Mute pytype warning:
File "kallithea/bin/kallithea_cli_db.py", line 73, in db_create: No attribute 'global_conf' on Dict[nothing, nothing] [attribute-error]
File "kallithea/bin/kallithea_cli_db.py", line 73, in db_create: No attribute 'local_conf' on Dict[nothing, nothing] [attribute-error]
2 files changed with 40 insertions and 39 deletions:
0 comments (0 inline, 0 general)
0 comments (0 inline, 0 general)