<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié., 10 abr. 2019 a las 1:09, Mads Kiilerich (<<a href="mailto:mads@kiilerich.com">mads@kiilerich.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 4/8/19 10:14 PM, Thomas De Schampheleire wrote:<br>
> # HG changeset patch<br>
> # User Thomas De Schampheleire <<a href="mailto:thomas.de_schampheleire@nokia.com" target="_blank">thomas.de_schampheleire@nokia.com</a>><br>
> # Date 1554322593 -7200<br>
> #      Wed Apr 03 22:16:33 2019 +0200<br>
> # Branch stable<br>
> # Node ID 90f704f5372af599838b4a8171790eeb89c9749f<br>
> # Parent  fa06015a39a0d757790a334207b4066beefee64f<br>
> scripts/generate-ini: also allow setting mako variables<br>
><br>
> The current code only allowed to set custom textual values, not variables<br>
> used for evaluation by mako. This will be needed in a subsequent commit.<br>
<br>
<br>
But we don't need this at all, after introducing "%if <br>
git_hook_interpreter:"? If not specified, the value will be false, and <br>
the .ini will not contain that setting.<br></blockquote><div><br></div><div>No, I don't think this is correct. <br></div><div>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.</div><div>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).</div><div><br></div><div>If you can make it work without this patch, please try it and show me. I may be misunderstanding your suggestion.</div><div><br></div><div>Thanks,</div><div>Thomas<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
> diff --git a/scripts/generate-ini.py b/scripts/generate-ini.py<br>
> --- a/scripts/generate-ini.py<br>
> +++ b/scripts/generate-ini.py<br>
> @@ -47,6 +47,8 @@ ini_files = [<br>
>                   'level': 'DEBUG',<br>
>               },<br>
>           },<br>
> +        {<br>
> +        },<br>
>       ),<br>
>   ]<br>
>   <br>
> @@ -63,9 +65,9 @@ def main():<br>
>           open(makofile, 'w').write(mako_marked_up)<br>
>   <br>
>       # create ini files<br>
> -    for fn, settings in ini_files:<br>
> +    for fn, settings, mako_variables in ini_files:<br>
>           print 'updating:', fn<br>
> -        inifile.create(fn, None, settings)<br>
> +        inifile.create(fn, mako_variables, settings)<br>
>   <br>
>   <br>
>   if __name__ == '__main__':<br>
<br>
<br>
</blockquote></div></div></div></div>