Amelioration de la mise en page. Tri des bornes par noms.

darcs-hash:20060428173147-68412-3dc507a9556dd6c805b30402b7dc4f1060fd118d.gz
This commit is contained in:
glondu 2006-04-28 19:31:47 +02:00
parent 1f16de1a68
commit 0c4976519f

View file

@ -23,18 +23,25 @@ def execute(macro, text):
code = f.text(u"Mise à jour le "+bornes.getAttribute("date")) code = f.text(u"Mise à jour le "+bornes.getAttribute("date"))
code += f.linebreak(0) code += f.linebreak(0)
code += f.table(1) code += f.table(True, {'tablealign': 'center'})
code += f.table_row(1) code += f.table_row(True, {'rowbgcolor': '#FFFFA0'})
for nom_col in [u"nom",u"hotspot",u"état",u"description",u"clients",u"mac wifi",u"canal",u"uptime",u"x GPS",u"y GPS"]: for nom_col in (u"Nom", u"Hotspot", u"État", u"Localisation", u"Clients",
code += f.table_cell(1) u"MAC", u"Canal", u"Uptime", u"°E", u"°N"):
code += f.strong(1) code += f.table_cell(True)
code += f.strong(True)
code += f.text(nom_col) code += f.text(nom_col)
code += f.strong(0) code += f.strong(False)
code += f.table_cell(0) code += f.table_cell(False)
code += f.table_row(0) code += f.table_row(False)
bornes.childNodes.sort(lambda x, y: cmp(x.getAttribute(u"nom"),
y.getAttribute(u"nom")))
dico = {u"hotspot": {u"1": f.smiley('(./)'), u"0": f.text(u"")},
u"up": {u"1": f.smiley(u"(!)"), u"0": f.smiley(u"{X}")}}
for b in bornes.childNodes: for b in bornes.childNodes:
code += f.table_row(1) code += f.table_row(1)
@ -42,12 +49,10 @@ def execute(macro, text):
code += f.text(b.getAttribute(u"nom")) code += f.text(b.getAttribute(u"nom"))
code += f.table_cell(0) code += f.table_cell(0)
dico={u"hotspot" : {u"1" : u"+" , u"0" : u""},
u"up" : {u"1" : u"marche" , u"0": u"éteint"}}
for nom_attribut in [u"hotspot",u"up"]: for nom_attribut in (u"hotspot", u"up"):
code += f.table_cell(1) code += f.table_cell(1)
code += f.text(dico[nom_attribut][b.getAttribute(nom_attribut)]) code += dico[nom_attribut][b.getAttribute(nom_attribut)]
code += f.table_cell(0) code += f.table_cell(0)
for tag in [u'description', u"clients",u"mac",u"canal"]: for tag in [u'description', u"clients",u"mac",u"canal"]: