[csw-devel] SF.net SVN: gar:[17678] csw/mgar/gar/v2/lib/python/build_tier_list.py

Maciej (Matchek) Bliziński maciej at opencsw.org
Mon Apr 16 20:31:33 CEST 2012


No dia 14 de Abril de 2012 19:31,  <wbonnet at users.sourceforge.net> escreveu:
> +                       print "tier %(tier)d\t%(1)d\t%(2)d\t%(3)d\t%(4)d" % { 'tier' : tier + 1 , '1' : countPkg[0][tier], '2' : countPkg[1][tier],'3' : countPkg[2][tier] , '4' : countPkg[2][tier] - countPkg[1][tier] }

It's probably a better idea to build a data structure at this point.
You can then either serialize this data structure to JSON, or use a
templating language to render it (I suggest jinja2 if you're choosing
a template. I started disliking Cheetah.).

Maciej


More information about the devel mailing list