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 :
|
Les options de recherches sont :
|
||||||
* limitations sur la recherche :
|
* limitations sur la recherche :
|
||||||
-a ou --adherent : limitation de la recherche aux adhérents
|
-a ou --adherent : limitation de l'affichage aux adhérents
|
||||||
-m ou --machine : limitation de la recherche aux machines
|
-m ou --machine : limitation de l'affichage aux machines
|
||||||
-c ou --club : limitation de la recherche aux clubs
|
-c ou --club : limitation de l'affichage aux clubs
|
||||||
-b ou --bornes : limitation de la recherche aux bornes wifi
|
-b ou --bornes : limitation de l'affichage aux bornes wifi
|
||||||
* options d'affichage :
|
* options d'affichage :
|
||||||
-t ou --tech : affichages des infos techniques des machines
|
-t ou --tech : affichages des infos techniques des machines
|
||||||
à la place des infos administratives dans les résumés.
|
à 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 *
|
from affich_tools import *
|
||||||
|
|
||||||
limit_aff_details = 1
|
limit_aff_details = 1
|
||||||
|
@ -219,28 +219,16 @@ def list_bornes(bornes) :
|
||||||
* canal
|
* canal
|
||||||
* lieu (la première remarque en fait)
|
* lieu (la première remarque en fait)
|
||||||
"""
|
"""
|
||||||
p = u'**'
|
data = [ ( u'mid' , u'Nom', u'Adresse IP', u'Adresse MAC', u'C' , u'P', u'Lieu') ]
|
||||||
|
|
||||||
if isadm : p = u'P'
|
|
||||||
|
|
||||||
data = [ ( u'mid' , u'Nom', u'Adresse IP', u'Adresse MAC', u'C' , p, u'Lieu') ]
|
|
||||||
|
|
||||||
for b in bornes :
|
for b in bornes :
|
||||||
t, bl = __bases_machines(b)
|
t, bl = __bases_machines(b)
|
||||||
if t != 'born' : continue
|
if t != 'born' : continue
|
||||||
|
|
||||||
if isadm :
|
|
||||||
p = b.puissance()
|
|
||||||
|
|
||||||
# Données
|
# 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 :
|
return u"C=canal, P=puissance\n" + tableau([5, 14, 17, 19, 2, 2, 13], data)
|
||||||
t = u"C=canal, P=puissance\n"
|
|
||||||
else :
|
|
||||||
t = u"C=canal\n"
|
|
||||||
|
|
||||||
return t + tableau([5, 14, 17, 19, 2, 2, 13], data)
|
|
||||||
|
|
||||||
def adher_details(adher) :
|
def adher_details(adher) :
|
||||||
"""
|
"""
|
||||||
|
@ -398,7 +386,7 @@ def machine_details(machine) :
|
||||||
f += '\n'
|
f += '\n'
|
||||||
|
|
||||||
# Borne wifi
|
# Borne wifi
|
||||||
if isadm and machine.puissance() :
|
if machine.puissance() :
|
||||||
f += coul(u'Puissance : ','gras') + machine.puissance()
|
f += coul(u'Puissance : ','gras') + machine.puissance()
|
||||||
f += coul(u'\tCanal : ', 'gras') + machine.canal()
|
f += coul(u'\tCanal : ', 'gras') + machine.canal()
|
||||||
f += '\n'
|
f += '\n'
|
||||||
|
@ -628,16 +616,16 @@ def __recherche() :
|
||||||
__usage_brief('Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
__usage_brief('Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
||||||
elif opt in [ '-a', '--adherent' ] :
|
elif opt in [ '-a', '--adherent' ] :
|
||||||
only_adh = 1
|
only_adh = 1
|
||||||
print "Recherche limitée aux adhérents."
|
print "Affichage limité aux adhérents."
|
||||||
elif opt in [ '-m', '--machine' ] :
|
elif opt in [ '-m', '--machine' ] :
|
||||||
only_mac = 1
|
only_mac = 1
|
||||||
print "Recherche limitée aux machines."
|
print "Affichage limité aux machines."
|
||||||
elif opt in [ '-c', '--club' ] :
|
elif opt in [ '-c', '--club' ] :
|
||||||
only_club = 1
|
only_club = 1
|
||||||
print "Recherche limitée aux clubs."
|
print "Affichage limité aux clubs."
|
||||||
elif opt in [ '-b', '--bornes' ] :
|
elif opt in [ '-b', '--bornes' ] :
|
||||||
only_bornes = 1
|
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
|
# On va tenter de limiter un peu la recherche
|
||||||
if arg[0] == '*' :
|
if arg[0] == '*' :
|
||||||
# Recherche initiale sans critètre
|
# Recherche initiale sans critètre
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue