scripts/gestion/tools/list_droits.py
Antoine Durand-Gasselin 4a68475e34 [wiki-lenny] suppression de static/
darcs-hash:20090314092631-bd074-b01256aeaf71e935851b3ecdbd623eaae8c9e8a1.gz
2009-03-14 10:26:31 +01:00

25 lines
621 B
Python

#! /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)