Commit ed476ca3 authored by Valentin Samir's avatar Valentin Samir

[gestion] Un petit whos_lc en 20 lignes de python, parce que je veux whoser des factures

et que j'ai la flemme de l'ajouter au whos actuel
parent b9e05f32
#!/bin/bash /usr/scripts/python.sh
# -*- mode: python; coding: utf-8 -*-
import sys
from affich_tools import coul, prompt
import lc_ldap.shortcuts
import lc_ldap.printing
import lc_ldap.filter2 as filter
if __name__ == '__main__':
if len(sys.argv) >1:
conn=lc_ldap.shortcuts.lc_ldap_admin()
result=conn.search(filter.human_to_ldap(sys.argv[1]))
if not result:
print "rien trouvé"
else:
if len(result) == 1:
result[0].display()
else:
print lc_ldap.printing.sprint_list(result)
print "%s résultats" % len(result)
else:
sys.stderr.write("Usage: %s {filtre}" % sys.argv[0])
#!/bin/sh
LANG=fr_FR.UTF-8 sudo -u respbats /usr/scripts/gestion/whos_lc.py $*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment