Re: [PATCH 3 of 6 v3] scripts/generate-ini: also allow setting mako variables
El mié., 10 abr. 2019 a las 1:09, Mads Kiilerich () escribió: > On 4/8/19 10:14 PM, Thomas De Schampheleire wrote: > > # HG changeset patch > > # User Thomas De Schampheleire > > # Date 1554322593 -7200 > > # Wed Apr 03 22:16:33 2019 +0200 > > # Branch stable > > # Node ID 90f704f5372af599838b4a8171790eeb89c9749f > > # Parent fa06015a39a0d757790a334207b4066beefee64f > > scripts/generate-ini: also allow setting mako variables > > > > The current code only allowed to set custom textual values, not variables > > used for evaluation by mako. This will be needed in a subsequent commit. > > > But we don't need this at all, after introducing "%if > git_hook_interpreter:"? If not specified, the value will be false, and > the .ini will not contain that setting. > No, I don't think this is correct. In commit "cli: fill in git_hook_interpreter at 'config-create' time" we will fill in sys.executable from kallithea-cli config-create. Due to this change, 'scripts/generate-ini.py' would now generate development.ini with the sys.executable of a developer and fill it into git_hook_interpreter. To avoid that, we explicitly want to pass an empty 'git_hook_interpreter' from scripts/generate-ini.py, and to achieve that, we should be able to pass mako variables (this commit). If you can make it work without this patch, please try it and show me. I may be misunderstanding your suggestion. Thanks, Thomas > > > > diff --git a/scripts/generate-ini.py b/scripts/generate-ini.py > > --- a/scripts/generate-ini.py > > +++ b/scripts/generate-ini.py > > @@ -47,6 +47,8 @@ ini_files = [ > > 'level': 'DEBUG', > > }, > > }, > > +{ > > +}, > > ), > > ] > > > > @@ -63,9 +65,9 @@ def main(): > > open(makofile, 'w').write(mako_marked_up) > > > > # create ini files > > -for fn, settings in ini_files: > > +for fn, settings, mako_variables in ini_files: > > print 'updating:', fn > > -inifile.create(fn, None, settings) > > +inifile.create(fn, mako_variables, settings) > > > > > > if __name__ == '__main__': > > > ___ kallithea-general mailing list kallithea-general@sfconservancy.org https://lists.sfconservancy.org/mailman/listinfo/kallithea-general
Re: [PATCH 3 of 6 v3] scripts/generate-ini: also allow setting mako variables
On 4/8/19 10:14 PM, Thomas De Schampheleire wrote: # HG changeset patch # User Thomas De Schampheleire # Date 1554322593 -7200 # Wed Apr 03 22:16:33 2019 +0200 # Branch stable # Node ID 90f704f5372af599838b4a8171790eeb89c9749f # Parent fa06015a39a0d757790a334207b4066beefee64f scripts/generate-ini: also allow setting mako variables The current code only allowed to set custom textual values, not variables used for evaluation by mako. This will be needed in a subsequent commit. But we don't need this at all, after introducing "%if git_hook_interpreter:"? If not specified, the value will be false, and the .ini will not contain that setting. diff --git a/scripts/generate-ini.py b/scripts/generate-ini.py --- a/scripts/generate-ini.py +++ b/scripts/generate-ini.py @@ -47,6 +47,8 @@ ini_files = [ 'level': 'DEBUG', }, }, +{ +}, ), ] @@ -63,9 +65,9 @@ def main(): open(makofile, 'w').write(mako_marked_up) # create ini files -for fn, settings in ini_files: +for fn, settings, mako_variables in ini_files: print 'updating:', fn -inifile.create(fn, None, settings) +inifile.create(fn, mako_variables, settings) if __name__ == '__main__': ___ kallithea-general mailing list kallithea-general@sfconservancy.org https://lists.sfconservancy.org/mailman/listinfo/kallithea-general
[PATCH 3 of 6 v3] scripts/generate-ini: also allow setting mako variables
# HG changeset patch # User Thomas De Schampheleire # Date 1554322593 -7200 # Wed Apr 03 22:16:33 2019 +0200 # Branch stable # Node ID 90f704f5372af599838b4a8171790eeb89c9749f # Parent fa06015a39a0d757790a334207b4066beefee64f scripts/generate-ini: also allow setting mako variables The current code only allowed to set custom textual values, not variables used for evaluation by mako. This will be needed in a subsequent commit. diff --git a/scripts/generate-ini.py b/scripts/generate-ini.py --- a/scripts/generate-ini.py +++ b/scripts/generate-ini.py @@ -47,6 +47,8 @@ ini_files = [ 'level': 'DEBUG', }, }, +{ +}, ), ] @@ -63,9 +65,9 @@ def main(): open(makofile, 'w').write(mako_marked_up) # create ini files -for fn, settings in ini_files: +for fn, settings, mako_variables in ini_files: print 'updating:', fn -inifile.create(fn, None, settings) +inifile.create(fn, mako_variables, settings) if __name__ == '__main__': ___ kallithea-general mailing list kallithea-general@sfconservancy.org https://lists.sfconservancy.org/mailman/listinfo/kallithea-general