# HG changeset patch # User Mads Kiilerich # Date 2020-05-22 16:54:10 # Node ID 04908b44005c0c9c4e5859661be78835050e8879 # Parent 6eb1f66ac23f116392f1c3b9fdf7458ecc15aa3c ini: put kallithea-config version in the ini file it creates (Issue #373) Help keeping track of how the .ini was created. diff --git a/kallithea/bin/kallithea_cli_config.py b/kallithea/bin/kallithea_cli_config.py --- a/kallithea/bin/kallithea_cli_config.py +++ b/kallithea/bin/kallithea_cli_config.py @@ -62,6 +62,7 @@ def config_create(config_file, key_value """ mako_variable_values = { + 'version': kallithea.__version__, 'git_hook_interpreter': sys.executable, 'user_home_path': os.path.expanduser('~'), 'kallithea_cli_path': cli_base.kallithea_cli_path, diff --git a/kallithea/lib/inifile.py b/kallithea/lib/inifile.py --- a/kallithea/lib/inifile.py +++ b/kallithea/lib/inifile.py @@ -40,6 +40,7 @@ default_variables = { 'host': '127.0.0.1', 'port': '5000', 'uuid': lambda: 'VERY-SECRET', + 'version': '', } variable_options = { diff --git a/kallithea/lib/paster_commands/template.ini.mako b/kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako +++ b/kallithea/lib/paster_commands/template.ini.mako @@ -1,7 +1,7 @@ ## -*- coding: utf-8 -*- <%text>################################################################################### <%text>################################################################################### -<%text>## Kallithea config file generated with kallithea-config ## +<%text>## Kallithea config file generated with kallithea-config ${'%-24s' % version }## <%text>## ## <%text>## The %(here)s variable will be replaced with the parent directory of this file ## <%text>###################################################################################