From a1a9308602e093eee4b2b19deb266dc057538107 Mon Sep 17 00:00:00 2001 From: Michel Blockelet Date: Tue, 11 Dec 2007 01:38:07 +0100 Subject: [PATCH] Petite mise jour tools Pseudo-rparation des scripts dans /usr/scripts/gestion/tools/ darcs-hash:20071211003807-ddb99-4670b17b63d914f1c06f84612aecdb3b9bb909f0.gz --- gestion/tools/list_droits.py | 4 ++-- gestion/tools/list_exempt.py | 4 ++-- gestion/tools/list_firewall.py | 2 +- gestion/tools/list_quotas.py | 6 +++--- gestion/tools/list_solde.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gestion/tools/list_droits.py b/gestion/tools/list_droits.py index 6075bf0a..c8ad3ff6 100755 --- a/gestion/tools/list_droits.py +++ b/gestion/tools/list_droits.py @@ -9,14 +9,14 @@ from ldap_crans import crans_ldap, decode db = crans_ldap() txts = [] -for droit in [ u'Nounou', u'Apprenti', u'Modérateur', u'Câbleur', u'Déconnecteur',u'CVSWeb' , u'WebRadio' , u'Imprimeur'] : +for droit in [ u'Nounou', u'Apprenti', u'Moderateur', u'Cableur', u'WebRadio' , u'Imprimeur', u'Bureau', u'Tresorier'] : adhs = db.search('droits=%s' % droit)['adherent'] noms = [] txt = '%s\n' % droit for adh in adhs : - noms.append(u'%s' % adh.Nom().encode('iso-8859-1')) + noms.append(u'%s' % adh.Nom()) txt += u' %s' % '\n '.join(noms) diff --git a/gestion/tools/list_exempt.py b/gestion/tools/list_exempt.py index f75bc605..3ee5043c 100755 --- a/gestion/tools/list_exempt.py +++ b/gestion/tools/list_exempt.py @@ -4,7 +4,7 @@ import sys sys.path.append('/usr/scripts/gestion') -from ldap_crans import crans_ldap, decode, crans +from ldap_crans import crans_ldap, decode db = crans_ldap() machines = db.search('exempt=*')['machine'] @@ -15,7 +15,7 @@ for m in machines : # texte pour la machine txt = u'' - txt += u'Propriétaire : %s\n' % m.proprietaire().Nom().encode('iso-8859-1') + txt += u'Propriétaire : %s\n' % m.proprietaire().Nom() txt += u'Machine : %s\n' % m.nom() txt += u'destination : %s\n' % ', '.join(m.exempt()) diff --git a/gestion/tools/list_firewall.py b/gestion/tools/list_firewall.py index 9fb96a06..c69bfb59 100755 --- a/gestion/tools/list_firewall.py +++ b/gestion/tools/list_firewall.py @@ -22,7 +22,7 @@ for m in machines : # texte pour la machine txt = u'' - txt += u'Propriétaire : %s\n' % m.proprietaire().Nom().encode('iso-8859-1') + txt += u'Propriétaire : %s\n' % m.proprietaire().Nom() txt += u'Machine : %s\n' % m.nom() if m.portTCPin() : txt += u'ports TCP in : %s\n' % ' '.join(m.portTCPin()) diff --git a/gestion/tools/list_quotas.py b/gestion/tools/list_quotas.py index baae0547..e0ff2b7f 100755 --- a/gestion/tools/list_quotas.py +++ b/gestion/tools/list_quotas.py @@ -15,8 +15,8 @@ txts = [] for c in comptes : if not c.compte() : continue - quota = getoutput('quota %s | grep "/dev/" | awk \'{ print $1" "$3" "$4 }\'' % c.compte() ) + 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(u'%s (%s)\n%s' % (c.Nom(), c.compte(), quota)) -print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts).encode('iso-8859-1') +print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts) diff --git a/gestion/tools/list_solde.py b/gestion/tools/list_solde.py index 234dcc00..c6f4e77e 100755 --- a/gestion/tools/list_solde.py +++ b/gestion/tools/list_solde.py @@ -17,7 +17,7 @@ for a in adherents : # texte pour l'adhérent txt = u'' - txt += u'Nom : %s\n' % a.Nom().encode('iso-8859-1') + txt += u'Nom : %s\n' % a.Nom() txt += u'Solde : %s\n' % a.solde() txts.append(txt.strip())