Detabification massive.

darcs-hash:20051018083823-d1718-09c2df38cfb707d3c3679188b9b9a812009f4f7c.gz
This commit is contained in:
bernat 2005-10-18 10:38:23 +02:00
parent 3c54fb2904
commit 37b21339a6
40 changed files with 1473 additions and 1473 deletions

View file

@ -16,7 +16,7 @@ for droit in [ u'Nounou', u'Apprenti', u'Mod
txt = '%s\n' % droit
for adh in adhs :
noms.append(u'%s' % adh.Nom().encode('iso-8859-1'))
noms.append(u'%s' % adh.Nom().encode('iso-8859-1'))
txt += u' %s' % '\n '.join(noms)

View file

@ -15,9 +15,9 @@ txts = []
for m in machines :
# on vérifie qu'on l'a pas encore traité
if m.ip() in done :
continue
continue
if m.proprietaire().__class__ == crans :
continue
continue
done.append(m.ip())
# texte pour la machine
@ -25,13 +25,13 @@ for m in machines :
txt += u'Propriétaire : %s\n' % m.proprietaire().Nom().encode('iso-8859-1')
txt += u'Machine : %s\n' % m.nom()
if m.portTCPin() :
txt += u'ports TCP in : %s\n' % m.portTCPin()
txt += u'ports TCP in : %s\n' % m.portTCPin()
if m.portTCPout() :
txt += u'ports TCP out : %s\n' % m.portTCPout()
txt += u'ports TCP out : %s\n' % m.portTCPout()
if m.portUDPin() :
txt += u'ports UDP in : %s\n' % m.portUDPin()
txt += u'ports UDP in : %s\n' % m.portUDPin()
if m.portUDPout() :
txt += u'ports UDP out : %s\n' % m.portUDPout()
txt += u'ports UDP out : %s\n' % m.portUDPout()
txts.append(txt.strip())

View file

@ -14,9 +14,9 @@ txts = []
for c in comptes :
if not c.compte() :
continue
continue
quota = getoutput('quota %s | grep "/dev/" | awk \'{ print $1" "$3" "$4 }\'' % c.compte() )
if quota != '/dev/sda1 400000 600000\n/dev/sda2 102400 153600' and quota != '/dev/sda2 102400 153600\n/dev/sda1 400000 600000' :
txts.append( '%s (%s)\n%s' % (c.Nom(), c.compte(), quota) )
txts.append( '%s (%s)\n%s' % (c.Nom(), c.compte(), quota) )
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts).encode('iso-8859-1')

View file

@ -13,7 +13,7 @@ txts = []
for a in adherents :
if a.solde() == 0 :
continue
continue
# texte pour l'adhérent
txt = u''

View file

@ -25,7 +25,7 @@ class interroge_switch (threading.Thread) :
sw = hpswitch(self.switch)
prise = sw.where_is_mac(mac)
if prise != None :
print "%-10s => prise %-2s : %s" % (self.switch.encode('iso-8859-15').replace('.adm.crans.org',''), str(prise), sw.nom(None, prise))
print "%-10s => prise %-2s : %s" % (self.switch.encode('iso-8859-15').replace('.adm.crans.org',''), str(prise), sw.nom(None, prise))
# on onterroge trois fois car il donne pas toujours les clients
for switch in ['backbone'] + all_switchs():

View file

@ -29,10 +29,10 @@ mac_done=[]
def done (mac) :
global mac_done
if mac in mac_done :
return True
return True
else :
mac_done.append(mac)
return False
mac_done.append(mac)
return False
# liste des résultats
results = []
@ -40,40 +40,40 @@ results = []
# classe d'interrogation des bornes
class interroge_borne (threading.Thread) :
def __init__ (self, db, borne, mac = None) :
threading.Thread.__init__(self)
self.borne = borne
self.mac = mac
self.db = db
self.start()
threading.Thread.__init__(self)
self.borne = borne
self.mac = mac
self.db = db
self.start()
def aff_client (self, mac, rssi) :
if done(mac) :
return
res = db.search("mac=%s" % mac)['machine']
if not res:
client_nom = '????'
coul_rssi = 'rouge'
rssi = 0
else:
# On va choisir la bonne couleur pour le RSSI
if rssi > -88:
coul_rssi = 'vert'
elif rssi > -93:
coul_rssi = 'jaune'
else:
coul_rssi = 'rouge'
global results
results.append('%-10s %-30s (%-15s, RSSI: %s)' % (self.borne.nom().split('.')[0], res[0].proprietaire().Nom(), res[0].nom().split('.')[0],coul("%d" % rssi, coul_rssi)))
if done(mac) :
return
res = db.search("mac=%s" % mac)['machine']
if not res:
client_nom = '????'
coul_rssi = 'rouge'
rssi = 0
else:
# On va choisir la bonne couleur pour le RSSI
if rssi > -88:
coul_rssi = 'vert'
elif rssi > -93:
coul_rssi = 'jaune'
else:
coul_rssi = 'rouge'
global results
results.append('%-10s %-30s (%-15s, RSSI: %s)' % (self.borne.nom().split('.')[0], res[0].proprietaire().Nom(), res[0].nom().split('.')[0],coul("%d" % rssi, coul_rssi)))
def run (self) :
nom = self.borne.nom()
if not borne_etat(nom) :
return
clients = borne_clients_canal(nom)['mac-rssi']
for (mac, rssi) in clients :
if not self.mac.upper() or self.mac == mac.upper() :
self.aff_client(mac,rssi)
nom = self.borne.nom()
if not borne_etat(nom) :
return
clients = borne_clients_canal(nom)['mac-rssi']
for (mac, rssi) in clients :
if not self.mac.upper() or self.mac == mac.upper() :
self.aff_client(mac,rssi)
# on onterroge trois fois car il donne pas toujours les clients
for i in range(0,3) :
@ -81,7 +81,7 @@ for i in range(0,3) :
resultat = {}
bornes = db.search('canal=*')['machine']
for borne in bornes :
interroge_borne(db, borne, mac)
interroge_borne(db, borne, mac)
# on attend la fin de threads
while len(threading.enumerate()) > 1 :