Yeah, that was just a simplistic example.  I built an automated test system
that allows test building, in the browser, which includes writing expected
results and allowing for post-results processing.  Some python people at
work asked if the expected results area could also allow for python post
results processing inside the template but I wasn't sure how easy that was
going to be.

On Wed, Sep 15, 2010 at 5:24 PM, Sean McAfee <eef...@gmail.com> wrote:

> On Tue, Sep 14, 2010 at 7:09 AM, Josh803316 <josh803...@gmail.com> wrote:
>
>> My question:
>>
>> Is there any way to process python inside the PERL block or any plugin
>> that allows for a [% PYTHON %] block.
>>
>> Do people use Inline::Python for this or is there another way?
>>
>>
> An implementation of the Template Toolkit entirely in Python exists:
>
> http://tt2.org/python/index.html
>
>
>
>> [% PERL %]
>>
>> my $result = $stash->get('result');
>>
>> use Inline Python => <<'END_OF_PYTHON_CODE';
>>    def compute_result($result):
>>       # Do something here
>>
>>    END_OF_PYTHON_CODE
>>
>> [% END %]
>>
>>
>> I'm trying to allow support for the following logic in both python and
>> perl
>>
>>
> To me, it seems vastly less complicated just to reimplement compute_result
> in Perl.
>
>
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to