From 0c4976519fee77e2f2c246c2e87324e8814eb16b Mon Sep 17 00:00:00 2001 From: glondu Date: Fri, 28 Apr 2006 19:31:47 +0200 Subject: [PATCH] Amelioration de la mise en page. Tri des bornes par noms. darcs-hash:20060428173147-68412-3dc507a9556dd6c805b30402b7dc4f1060fd118d.gz --- wiki/macro/InfosBornes.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/wiki/macro/InfosBornes.py b/wiki/macro/InfosBornes.py index 630a64ed..e52d0b0c 100755 --- a/wiki/macro/InfosBornes.py +++ b/wiki/macro/InfosBornes.py @@ -23,18 +23,25 @@ def execute(macro, text): code = f.text(u"Mise ŕ jour le "+bornes.getAttribute("date")) code += f.linebreak(0) - code += f.table(1) + code += f.table(True, {'tablealign': 'center'}) - code += f.table_row(1) - 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"]: - code += f.table_cell(1) - code += f.strong(1) + code += f.table_row(True, {'rowbgcolor': '#FFFFA0'}) + for nom_col in (u"Nom", u"Hotspot", u"État", u"Localisation", u"Clients", + u"MAC", u"Canal", u"Uptime", u"°E", u"°N"): + code += f.table_cell(True) + code += f.strong(True) code += f.text(nom_col) - code += f.strong(0) - code += f.table_cell(0) - code += f.table_row(0) + code += f.strong(False) + code += f.table_cell(False) + 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: code += f.table_row(1) @@ -42,12 +49,10 @@ def execute(macro, text): code += f.text(b.getAttribute(u"nom")) 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.text(dico[nom_attribut][b.getAttribute(nom_attribut)]) + code += dico[nom_attribut][b.getAttribute(nom_attribut)] code += f.table_cell(0) for tag in [u'description', u"clients",u"mac",u"canal"]: