On donne l'aide
darcs-hash:20060424161605-72cb0-ed0b8ca55031600ec93b88e5b191920a95fdc420.gz
This commit is contained in:
parent
0a3fe1b494
commit
e867e4f99b
1 changed files with 11 additions and 8 deletions
|
@ -77,6 +77,13 @@ def generate_ps(sanction, proprio, db):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
def aide():
|
||||||
|
print help
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
if '--help' in sys.argv or '-h' in sys.argv:
|
||||||
|
aide()
|
||||||
|
|
||||||
db = crans_ldap()
|
db = crans_ldap()
|
||||||
|
|
||||||
sanction = ''
|
sanction = ''
|
||||||
|
@ -86,13 +93,11 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
if not sanction :
|
if not sanction :
|
||||||
print "Erreur : aucune sanction définie.\n"
|
print "Erreur : aucune sanction définie.\n"
|
||||||
print help
|
aide()
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
if len(sys.argv) <= 2 :
|
if len(sys.argv) <= 2 :
|
||||||
print "Erreur : aucun motif de recherche défini.\n"
|
print "Erreur : aucun motif de recherche défini.\n"
|
||||||
print help
|
aide()
|
||||||
sys.exit(0)
|
|
||||||
else :
|
else :
|
||||||
motif = sys.argv[2]
|
motif = sys.argv[2]
|
||||||
|
|
||||||
|
@ -100,12 +105,10 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
if len(recherche) == 0:
|
if len(recherche) == 0:
|
||||||
print "Erreur : aucun résultat pour %s.\n" % motif
|
print "Erreur : aucun résultat pour %s.\n" % motif
|
||||||
print help
|
aide()
|
||||||
sys.exit(0)
|
|
||||||
elif len(recherche) != 1:
|
elif len(recherche) != 1:
|
||||||
print "Erreur : plusieurs résultats pour %s.\n" % motif
|
print "Erreur : plusieurs résultats pour %s.\n" % motif
|
||||||
print help
|
aide()
|
||||||
sys.exit(0)
|
|
||||||
else :
|
else :
|
||||||
adherent = recherche[0]
|
adherent = recherche[0]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue