|
Email lists >
Genshi >
Re: Variable Assignment/Scope Question >
Re: Variable Assignment/Scope Question
Re: Variable Assignment/Scope Question
This post if a part of this thread
|
2008-01-01 18:01:45 |
|
|
Re: Variable Assignment/Scope Question
|
|
|
could you have whatever is invoking the Genshi engine do the calculation and pass it through? (that is, pass both "my_range" and "variable"?
On Jan 1, 2008 5:47 PM, jerryji <
jerryji197 6 gmail.com">jerryji1976 gmail.com> wrote:
Hi Chris,
That's also how I interpreted the documentation -- just couldn';t convince myself that such deceptively naive functionality does not exist in Genshi -- without even a workaround/cheat?
Thanks.
Jerry
On Jan 1, 4:27 pm, "Chri s Curvey" < ccur... gmail.com">ccur... gmail.com> wrote: > I'm not sure there is a solution in Genshi. If I go to
>
> http://genshi.edgewall.org/wiki/Documentation/0.4.x/xml-templates.htm...
>
> the last paragraph in section 1.4.1 seems to say that you can't do what you > want to do. > > (I'd love for someone to show me that my interpretation of that paragraph is > incorrect!)
>
> On Jan 1, 2008 12:12 PM, jerryji < jerryji1.. . gmail.com">jerryji1... gmail.com> wrote: > > > > > > > Hi, >
> > I have been struggling with no avail to archive assignment of a > > variable within a loop to be used later outside the loop, i.e., the > > following use of ${variable} fails with undefined error:
> > > <py:for each="i in range(my_range)"> > > <py:with var="variable=i"></py:with> > > </py:for> > > > <py:if test="my_range <= 1">
> > <py:with var="variable=0"></py:with> > > </py:if> > > > <py:for each="v in range(variable)"> > > <span>do something</span>
> > </py:for> > > > What is the trick there? Any hint would be greatly appreciated! > > > Sincerely, > > Jerry > > --
> I am often wrong, but I am never in doubt.
-- I am often wrong, but I am never in doubt.
- -~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Genshi" group. To post to this group, send email to genshi googlegroups.com To unsubscribe from this group, send email to genshi-unsubscribe googlegroups.com For more options, visit this group at http://groups.google.com/group/genshi?hl=en -~----------~----~----~----~------~----~------~--~---
|
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|