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 < jerryji1976gmail.com">jerryji1976gmail.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, "Chris Curvey&quot; < 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.
>
&gt; (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:
&gt;
> > <py:for each=";i in range(my_range)">
> >  <py:with var="variable=i&quot;>&lt;/py:with&gt;
> > </py:for>
>
> > <py:if test=";my_range &lt;= 1">;
> >  <py:with var="variable=0&quot;>&lt;/py:with&gt;
> > </py:if>
>
&gt; > <py:for each=";v in range(variable)">
> >  <span>do something&lt;/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 genshigooglegroups.com
To unsubscribe from this group, send email to genshi-unsubscribegooglegroups.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 )