#! /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'Modérateur', u'Câbleur', u'Déconnecteur',u'CVSWeb' , u'WebRadio' , u'Imprimeur'] : adhs = db.search('droits=%s' % droit)['adherent'] noms = [] txt = '%s\n' % droit for adh in adhs : noms.append(u'%s' % adh.Nom().encode('iso-8859-1')) txt += u' %s' % '\n '.join(noms) txts.append(txt) print '\n- - - - - - = = = = = = # # # # # # # # = = = = = = - - - - - -\n'.join(txts)