From fcbf4c47552919b895ab5614eb117d4cfa09ea43 Mon Sep 17 00:00:00 2001 From: bernat Date: Tue, 11 Oct 2005 12:45:26 +0200 Subject: [PATCH] En fait, cela marche, j'avais pas vu le .encode tratre la fin... darcs-hash:20051011104526-d1718-0a4fc6accad5f803001fd0b22361c7ddfde83466.gz --- wiki/macro/HostStatus.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wiki/macro/HostStatus.py b/wiki/macro/HostStatus.py index a304e5a0..9016d0ba 100644 --- a/wiki/macro/HostStatus.py +++ b/wiki/macro/HostStatus.py @@ -20,10 +20,10 @@ def execute(macro, text) : status = getstatusoutput('grep -v " 0 " /etc/autostatus/local.status') if status[0] and status[0] != 256 : - return Cellule(u'Impossible d\'analyser le fichier de status.'.encode('utf-8'),'yellow',macro.formatter) + return Cellule(u'Impossible d\'analyser le fichier de status.','yellow',macro.formatter) if not status[1].strip() : - return Cellule(u'Toutes les machines importantes sont up.'.encode('utf-8'),'lime',macro.formatter) + return Cellule(u'Toutes les machines importantes sont up.','lime',macro.formatter) lines = status[1].split('\n') @@ -35,18 +35,18 @@ def execute(macro, text) : line = line.split(' ') code += f.table_row(1) code += f.table_cell(1,{'style':'background-color:silver'}) - code += f.text('%s (%s)' % (line [0], getoutput("grep '%s' /etc/autostatus/hosts | cut -d ' ' -f 5-" % line [0])) ) + code += f.text('%s (%s)' % (line [0], getoutput("grep '^%s' /etc/autostatus/hosts | cut -d ' ' -f 5-" % line [0])) ) code += f.table_cell(0) # nombre de non réponse au ping if int(line[1]) > 2 : code += f.table_cell(1,{'style':'background-color:red'}) - code += f.text(u'down'.encode('utf-8')) + code += f.text(u'down') else : code += f.table_cell(1,{'style':'background-color:blue'}) - code += f.text(u'etat incertain'.encode('utf-8')) + code += f.text(u'état incertain') code += f.table_cell(0) code += f.table_row(0) code += f.table(0) - return code.encode('iso-8859-15') + return code