[scripts] Going to utf-8

This commit is contained in:
Pierre-Elliott Bécue 2013-05-04 19:19:36 +02:00
parent c4a19a88ed
commit a1bf0a4547
54 changed files with 676 additions and 573 deletions

View file

@ -1,5 +1,5 @@
#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
# -*- coding: utf-8 -*-
import sys, re
from time import sleep
@ -37,11 +37,11 @@ class interroge_switch (threading.Thread) :
if (prise != None):
nom=sw.nom(None,prise)
if self.affiche_uplinks or "uplink" not in nom:
self.reponse = ("%-10s => prise %-2s : %s" % (self.switch.encode('iso-8859-15').replace('.adm.crans.org',''), str(prise), nom))
self.reponse = ("%-10s => prise %-2s : %s" % (self.switch.encode('utf-8').replace('.adm.crans.org',''), str(prise), nom))
# Retourne les infos sur la machine (l'équivalent d'un whos, mais renvoie la
# chaîne de caractères)
# Retourne les infos sur la machine (l'équivalent d'un whos, mais renvoie la
# chaîne de caractères)
def info_machine(mac):
s = []
db = crans_ldap()
@ -52,7 +52,7 @@ def info_machine(mac):
r = re.sub('\x1b\[1;([0-9]|[0-9][0-9])m', '', r)
s.append(r)
if len(machines) == 0:
s.append(u"Recherche LDAP de la MAC %s : aucune machine trouvée\n" % mac)
s.append(u"Recherche LDAP de la MAC %s : aucune machine trouvée\n" % mac)
return u"\n".join(s)
@ -66,7 +66,7 @@ def trace_machine(mac, affiche_uplinks=False):
for t in tableau:
t.join()
resultat = u'Traçage de %s...\n' % mac
resultat = u'Traçage de %s...\n' % mac
tracage = u''
for t in tableau: