Commit d91798fb authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue
Browse files

[mac_prises] Oups.

parent 9b8bf60a
......@@ -122,8 +122,11 @@ def summary():
liste_triee[entry['mac']][entry['type']][chbres].append((entry['date'], entry['rapport'], entry['seuil']))
else:
liste_triee[entry['mac']][entry['type']][chbres] = []
liste_triee[entry['mac']][entry['type']][chbres].append((entry['date'], entry['rapport'], entry['seuil']))
else:
liste_triee[entry['mac']][entry['type']] = {}
liste_triee[entry['mac']][entry['type']][chbres] = []
liste_triee[entry['mac']][entry['type']][chbres].append((entry['date'], entry['rapport'], entry['seuil']))
for mac, ltype in liste_triee.items():
data = []
......@@ -138,7 +141,10 @@ def summary():
data += [[dtype, ", ".join(list(chbres)), donnee[0], donnee[1], donnee[2]] for donnee in dataframe]
output += u'Sur le relevé %s, la mac est apparue %s fois. Elle est apparue dans les chambres suivantes : %s.\n' % (dtype, number, ", ".join(list(chambres)))
output += u'Consulter les logs (en PJ) pour plus d\'informations.\n\n'
maxlen = max([len(a[1]) for a in data]) + 4
try:
maxlen = max([len(a[1]) for a in data]) + 4
except ValueError:
maxlen = 4
titres = (u'relevé', u'chambres', u'date', u'rapport', u'seuil')
alignements = ('c', 'c', 'c', 'c', 'c')
largeurs = (12, maxlen, 20, 10, 10)
......@@ -215,6 +221,9 @@ if __name__ == '__main__':
Logs = Logs.encode('UTF-8')
output = output.encode('UTF-8')
if "--debug" in sys.argv or "debug" in sys.argv:
print output
sys.exit(0)
message = """From: %(from)s
To: %(to)s
Subject: Résumé quotidien : mac_prises.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment