Changeset - d332fca29474
[Not reviewed]
default
3 3 3
Mads Kiilerich - 5 years ago 2020-10-10 21:05:12
mads@kiilerich.com
Grafted from: 8615cedf87bd
config: move various py templates to kallithea/templates/py/

For some reason, we had some python templates in kallithea/config .
kallithea.config is mainly the TG entry point, and thus a high level controller
thing - not a place to store templates.

Instead, use the templates directory and introduce a new py subdirectory.

With git hook templates in a templates directory, there is no need for tmpl in
the name.
6 files changed with 3 insertions and 9 deletions:
0 comments (0 inline, 0 general)
.coveragerc
Show inline comments
 
@@ -8,9 +8,6 @@ omit =
 
    kallithea/lib/dbmigrate/*
 
    # the tests themselves should not be part of the coverage report
 
    kallithea/tests/*
 
    # the scm hooks are not run in the kallithea process
 
    kallithea/config/post_receive_tmpl.py
 
    kallithea/config/pre_receive_tmpl.py
 

	
 
# same omit lines should be present in sections 'run' and 'report'
 
[report]
 
@@ -23,9 +20,6 @@ omit =
 
    kallithea/lib/dbmigrate/*
 
    # the tests themselves should not be part of the coverage report
 
    kallithea/tests/*
 
    # the scm hooks are not run in the kallithea process
 
    kallithea/config/post_receive_tmpl.py
 
    kallithea/config/pre_receive_tmpl.py
 

	
 
[paths]
 
source =
kallithea/bin/kallithea_cli_extensions.py
Show inline comments
 
@@ -39,7 +39,7 @@ def extensions_create():
 
    """
 
    here = kallithea.CONFIG['here']
 
    content = pkg_resources.resource_string(
 
        'kallithea', os.path.join('config', 'extensions', 'extensions.py')
 
        'kallithea', os.path.join('templates', 'py', 'extensions.py')
 
    )
 
    ext_file = os.path.join(here, 'extensions.py')
 
    if os.path.exists(ext_file):
kallithea/model/scm.py
Show inline comments
 
@@ -705,11 +705,11 @@ class ScmModel(object):
 

	
 
        tmpl_post = b"#!%s\n" % safe_bytes(self._get_git_hook_interpreter())
 
        tmpl_post += pkg_resources.resource_string(
 
            'kallithea', os.path.join('config', 'post_receive_tmpl.py')
 
            'kallithea', os.path.join('templates', 'py', 'git_post_receive_hook.py')
 
        )
 
        tmpl_pre = b"#!%s\n" % safe_bytes(self._get_git_hook_interpreter())
 
        tmpl_pre += pkg_resources.resource_string(
 
            'kallithea', os.path.join('config', 'pre_receive_tmpl.py')
 
            'kallithea', os.path.join('templates', 'py', 'git_pre_receive_hook.py')
 
        )
 

	
 
        for h_type, tmpl in [('pre', tmpl_pre), ('post', tmpl_post)]:
kallithea/templates/py/extensions.py
Show inline comments
 
file renamed from kallithea/config/extensions/extensions.py to kallithea/templates/py/extensions.py
kallithea/templates/py/git_post_receive_hook.py
Show inline comments
 
file renamed from kallithea/config/post_receive_tmpl.py to kallithea/templates/py/git_post_receive_hook.py
kallithea/templates/py/git_pre_receive_hook.py
Show inline comments
 
file renamed from kallithea/config/pre_receive_tmpl.py to kallithea/templates/py/git_pre_receive_hook.py
0 comments (0 inline, 0 general)