scripts/gestion/tools/list_droits.py
Michel Blockelet a1a9308602 Petite mise jour tools
Pseudo-rparation des scripts dans /usr/scripts/gestion/tools/

darcs-hash:20071211003807-ddb99-4670b17b63d914f1c06f84612aecdb3b9bb909f0.gz
2007-12-11 01:38:07 +01:00

25 lines
621 B
Python
Executable file

#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
import sys
sys.path.append('/usr/scripts/gestion')
from ldap_crans import crans_ldap, decode
db = crans_ldap()
txts = []
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())
txt += u' %s' % '\n '.join(noms)
txts.append(txt)
print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts)