On Tuesday 16 June 2009, Corey Kovacs wrote:
> Basically, I need this..
>
> temp=0
> print "<TABLE>"
> print "<TR><TD>row</TD><TD>rack.rackid</TD><TD>row</TD></TR>"
> for(row=1; row<43; row++)
>    for host in hostlist:
>      if host.elevation == row:
>          uspan = host.height-1
>          print "<TR><TD>row</TD><TD
> rowspan=uspan>host.hostname</TD><TD>row</TD></TR>"
>          while temp > 0 :
>            row++
>            print "<TR><TD>row</TD><TD>row</TD></TR>"
>            uspan--
>    else
>          print "<TR><TD>row</TD><TD></TD><TD>row</TD></TR>"
>
> print "<TR><TD>row</TD><TD>PDU</TD><TD>row</TD></TR>"
> print "<TR><TD>row</TD><TD>PDU</TD><TD>row</TD></TR>"
>
>
> The above (really ugly) pseudo-code mashup tries to explain it
>
>
>
> Does anyone here know of a way I can do this using genshi?

You may want to look into python code blocks, which are fairly similar to php 
stuff (you don't have a print statement AFAIK, but you can set variables for 
later use or make it a function to call)

The docs are here
http://genshi.edgewall.org/wiki/Documentation/0.5.x/templates.html#id1

HTH
Uwe


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to