<div dir="ltr">Evgeniy, do we need to remove jinja before July 30th ?<br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Aleksey Kasatkin
<br><br></div></div></div>
<br><div class="gmail_quote">On Tue, Jul 28, 2015 at 6:40 PM, Aleksey Kasatkin <span dir="ltr"><<a href="mailto:akasatkin@mirantis.com" target="_blank">akasatkin@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>AFAIU, string.Template doesn't help.<br><br></div>This seems to be helpful:<br><br><pre><code><span>import</span><span> re

</span><span>def</span><span> interp</span><span>(</span><span>string</span><span>,</span><span> params</span><span>):</span><span>
  </span><span>for</span><span> item </span><span>in</span><span> re</span><span>.</span><span>findall</span><span>(</span><span>r</span><span>'#\{([^}]*)\}'</span><span>,</span><span> string</span><span>):</span><span>
    string </span><span>=</span><span> string</span><span>.</span><span>replace</span><span>(</span><span>'#{%s}'</span><span> </span><span>%</span><span> item</span><span>,</span><span> str</span><span>(</span><span>eval</span><span>(</span><span>item</span><span>,</span><span> </span><span>{},</span><span> params</span><span>)))</span><span>
  </span><span>return</span><span> string</span></code></pre><br></div>Evgeniy, do you know some better options for this?<span class="HOEnZb"><font color="#888888"><br><br><br></font></span></div><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div><div dir="ltr">Aleksey Kasatkin
<br><br></div></div></div>
<br></font></span><div class="gmail_quote"><div><div class="h5">On Tue, Jul 28, 2015 at 1:12 PM, Sergey Vasilenko <span dir="ltr"><<a href="mailto:svasilenko@mirantis.com" target="_blank">svasilenko@mirantis.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>If we need only substitution, probably it's better to use standard templating<br></div><div>in python [1], there is a way to redefine tokens, so you will be able to use</div><div><% %> syntax if you want to.</div><div><br></div><div>[1] <a href="https://docs.python.org/dev/library/string.html#template-strings" target="_blank">https://docs.python.org/2.6/library/string.html#template-strings</a></div><div>[2] <a href="http://pymotw.com/2/string/#advanced-templates" target="_blank">http://pymotw.com/2/string/#advanced-templates</a></div></div></blockquote><div><br></div></span><div>I think it's a better solution for this issue.</div><span><font color="#888888"><div><br></div><div>/sv </div></font></span></div></div></div>
<br></div></div><span class="">__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>