Utilisateurs de jed, lisez http://www.python.org/peps/pep-0008.html
darcs-hash:20051005121651-d1718-05f1ae0d121a8bb2f12dbbf7f067b70770001c7a.gz
This commit is contained in:
parent
7cb50d6957
commit
45e58dec8f
1 changed files with 18 additions and 18 deletions
|
@ -20,11 +20,11 @@ def execute(macro, text) :
|
||||||
status = getstatusoutput('grep -v " 0 " /etc/autostatus/local.status')
|
status = getstatusoutput('grep -v " 0 " /etc/autostatus/local.status')
|
||||||
|
|
||||||
if status[0] :
|
if status[0] :
|
||||||
return Cellule('Impossible d\'analyser le fichier de status.','yellow',macro.formatter)
|
return Cellule('Impossible d\'analyser le fichier de status.','yellow',macro.formatter)
|
||||||
|
|
||||||
if not status[1].strip() :
|
if not status[1].strip() :
|
||||||
return Cellule('Toutes les machines sont up, Vince est de bonne humeur.','lime',macro.formatter)
|
return Cellule('Toutes les machines sont up, Vince est de bonne humeur.','lime',macro.formatter)
|
||||||
|
|
||||||
lines = status[1].split('\n')
|
lines = status[1].split('\n')
|
||||||
|
|
||||||
f = macro.formatter
|
f = macro.formatter
|
||||||
|
@ -32,21 +32,21 @@ def execute(macro, text) :
|
||||||
code += f.table(1)
|
code += f.table(1)
|
||||||
|
|
||||||
for line in lines :
|
for line in lines :
|
||||||
line = line.split(' ')
|
line = line.split(' ')
|
||||||
code += f.table_row(1)
|
code += f.table_row(1)
|
||||||
code += f.table_cell(1,{'style':'background-color:silver'})
|
code += f.table_cell(1,{'style':'background-color:silver'})
|
||||||
code += f.text(line [0])
|
code += f.text(line [0])
|
||||||
code += f.table_cell(0)
|
code += f.table_cell(0)
|
||||||
# nombre de non réponse au ping
|
# nombre de non réponse au ping
|
||||||
if int(line[1]) > 2 :
|
if int(line[1]) > 2 :
|
||||||
code += f.table_cell(1,{'style':'background-color:red'})
|
code += f.table_cell(1,{'style':'background-color:red'})
|
||||||
code += f.text('down')
|
code += f.text('down')
|
||||||
else :
|
else :
|
||||||
code += f.table_cell(1,{'style':'background-color:blue'})
|
code += f.table_cell(1,{'style':'background-color:blue'})
|
||||||
code += f.text('up')
|
code += f.text('up')
|
||||||
code += f.table_cell(0)
|
code += f.table_cell(0)
|
||||||
code += f.table_row(0)
|
code += f.table_row(0)
|
||||||
|
|
||||||
code += f.table(0)
|
code += f.table(0)
|
||||||
|
|
||||||
return code.encode('iso-8859-15')
|
return code.encode('iso-8859-15')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue