Amlioration des infos.
darcs-hash:20040908165016-41617-76fc8222c63cfb5085392778041fbd50bc60e64d.gz
This commit is contained in:
parent
20440a9b30
commit
2678597ba9
1 changed files with 13 additions and 25 deletions
|
@ -20,10 +20,10 @@ Les champs de recherche possibles sont :
|
|||
|
||||
Les options de recherches sont :
|
||||
* limitations sur la recherche :
|
||||
-a ou --adherent : limitation de la recherche aux adhérents
|
||||
-m ou --machine : limitation de la recherche aux machines
|
||||
-c ou --club : limitation de la recherche aux clubs
|
||||
-b ou --bornes : limitation de la recherche aux bornes wifi
|
||||
-a ou --adherent : limitation de l'affichage aux adhérents
|
||||
-m ou --machine : limitation de l'affichage aux machines
|
||||
-c ou --club : limitation de l'affichage aux clubs
|
||||
-b ou --bornes : limitation de l'affichage aux bornes wifi
|
||||
* options d'affichage :
|
||||
-t ou --tech : affichages des infos techniques des machines
|
||||
à la place des infos administratives dans les résumés.
|
||||
|
@ -35,7 +35,7 @@ d'historique affich
|
|||
|
||||
"""
|
||||
|
||||
from ldap_crans import is_actif , crans_ldap, isadm, ann_scol
|
||||
from ldap_crans import is_actif , crans_ldap, ann_scol
|
||||
from affich_tools import *
|
||||
|
||||
limit_aff_details = 1
|
||||
|
@ -219,28 +219,16 @@ def list_bornes(bornes) :
|
|||
* canal
|
||||
* lieu (la première remarque en fait)
|
||||
"""
|
||||
p = u'**'
|
||||
|
||||
if isadm : p = u'P'
|
||||
|
||||
data = [ ( u'mid' , u'Nom', u'Adresse IP', u'Adresse MAC', u'C' , p, u'Lieu') ]
|
||||
data = [ ( u'mid' , u'Nom', u'Adresse IP', u'Adresse MAC', u'C' , u'P', u'Lieu') ]
|
||||
|
||||
for b in bornes :
|
||||
t, bl = __bases_machines(b)
|
||||
if t != 'born' : continue
|
||||
|
||||
if isadm :
|
||||
p = b.puissance()
|
||||
|
||||
# Données
|
||||
data.append((b.id() , b.nom().split('.')[0], b.ip(), b.mac(), b.canal(), p, b.info()[0] ))
|
||||
data.append((b.id() , b.nom().split('.')[0], b.ip(), b.mac(), b.canal(), b.puissance(), b.info()[0] ))
|
||||
|
||||
if isadm :
|
||||
t = u"C=canal, P=puissance\n"
|
||||
else :
|
||||
t = u"C=canal\n"
|
||||
|
||||
return t + tableau([5, 14, 17, 19, 2, 2, 13], data)
|
||||
return u"C=canal, P=puissance\n" + tableau([5, 14, 17, 19, 2, 2, 13], data)
|
||||
|
||||
def adher_details(adher) :
|
||||
"""
|
||||
|
@ -398,7 +386,7 @@ def machine_details(machine) :
|
|||
f += '\n'
|
||||
|
||||
# Borne wifi
|
||||
if isadm and machine.puissance() :
|
||||
if machine.puissance() :
|
||||
f += coul(u'Puissance : ','gras') + machine.puissance()
|
||||
f += coul(u'\tCanal : ', 'gras') + machine.canal()
|
||||
f += '\n'
|
||||
|
@ -628,16 +616,16 @@ def __recherche() :
|
|||
__usage_brief('Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
||||
elif opt in [ '-a', '--adherent' ] :
|
||||
only_adh = 1
|
||||
print "Recherche limitée aux adhérents."
|
||||
print "Affichage limité aux adhérents."
|
||||
elif opt in [ '-m', '--machine' ] :
|
||||
only_mac = 1
|
||||
print "Recherche limitée aux machines."
|
||||
print "Affichage limité aux machines."
|
||||
elif opt in [ '-c', '--club' ] :
|
||||
only_club = 1
|
||||
print "Recherche limitée aux clubs."
|
||||
print "Affichage limité aux clubs."
|
||||
elif opt in [ '-b', '--bornes' ] :
|
||||
only_bornes = 1
|
||||
print "Recherche limitée aux bornes wifi."
|
||||
print "Affichage limité aux bornes wifi."
|
||||
# On va tenter de limiter un peu la recherche
|
||||
if arg[0] == '*' :
|
||||
# Recherche initiale sans critètre
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue