View Single Post
Old 03-25-2015, 11:06 AM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by chaley View Post
Actually, you can't use [[ and ]] in myki's template. The problem is the "| - |" stuff inside the quotes.
I knew that...

Quote:
<Technical>
The template parser runs in two passes. The first, mostly controlled by the python 'format' library, extracts and parses { ... } template information. The second, mostly controlled by my code, extracts TPM functions from inside the program string using the GPM parser. The problem that arises is that the first parser sees the ':| - |' after the #series and connects it with the nearest opening brace ({), which when using [[ and ]] is the one in front of #categorieperso. The result is a mess, causing the parser to throw up its hands.

If you leave the { and } around the series ({series:| - |}) then the parser gets it right, attaching the prefix and suffix to the right variable. Unfortunately, because this parser and evaluator run before the program parser, this sub-template is evaluated and replaced with the result. If that result contains a significant character such as a quote, comma, bracket, or bar then the resulting argument for the template function will be bogus.

I have considered removing the [[ and ]] hack because the rules for successful use approach incomprehensible.
</Technical>
Yeah, if you cannot get it to work consistently, I agree it shouldn't be there. Just say template() and eval() only work in GPM.
eschwartz is offline   Reply With Quote