import initial
darcs-hash:20060616111103-4ec08-de0d42e77be3cd156aaab42a8f9550714c315ad1.gz
This commit is contained in:
parent
500d0fbbc5
commit
58b36ad4c1
1 changed files with 38 additions and 0 deletions
38
adm/analyse-batg.py
Executable file
38
adm/analyse-batg.py
Executable file
|
@ -0,0 +1,38 @@
|
|||
#! /usr/bin/env python
|
||||
# -*- coding: iso8859-15 -*-
|
||||
|
||||
"""
|
||||
Ce script sert à donner l'occupation des switchs du batiment G
|
||||
Il affiche 3 colonnes :
|
||||
- la prise
|
||||
- la chambre
|
||||
- si il y a qqun dans la chambre
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
from annuaires import reverse
|
||||
from ldap_crans import crans_ldap
|
||||
from affich_tools import tableau
|
||||
db = crans_ldap()
|
||||
|
||||
# dictionnaire revers du bat
|
||||
dico = reverse('g')
|
||||
|
||||
# toutes les prises
|
||||
prises = dico.keys()
|
||||
prises.sort()
|
||||
|
||||
# chambres occupées
|
||||
chbres = [ a.chbre() for a in db.search('chbre=G*&paiement=ok')['adherent'] ]
|
||||
|
||||
data= []
|
||||
|
||||
for p in prises:
|
||||
if [ chbre for chbre in dico[p] if 'G%s'%chbre in chbres ]:
|
||||
data.append( [ p, ','.join(dico[p]), 'O'] )
|
||||
else:
|
||||
data.append( [ p, ','.join(dico[p]), 'N'] )
|
||||
|
||||
print tableau(data)
|
Loading…
Add table
Add a link
Reference in a new issue