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__":
|
||||
def aide():
|
||||
print help
|
||||
sys.exit(0)
|
||||
|
||||
if '--help' in sys.argv or '-h' in sys.argv:
|
||||
aide()
|
||||
|
||||
db = crans_ldap()
|
||||
|
||||
sanction = ''
|
||||
|
@ -86,13 +93,11 @@ if __name__ == "__main__":
|
|||
|
||||
if not sanction :
|
||||
print "Erreur : aucune sanction définie.\n"
|
||||
print help
|
||||
sys.exit(0)
|
||||
aide()
|
||||
|
||||
if len(sys.argv) <= 2 :
|
||||
print "Erreur : aucun motif de recherche défini.\n"
|
||||
print help
|
||||
sys.exit(0)
|
||||
aide()
|
||||
else :
|
||||
motif = sys.argv[2]
|
||||
|
||||
|
@ -100,12 +105,10 @@ if __name__ == "__main__":
|
|||
|
||||
if len(recherche) == 0:
|
||||
print "Erreur : aucun résultat pour %s.\n" % motif
|
||||
print help
|
||||
sys.exit(0)
|
||||
aide()
|
||||
elif len(recherche) != 1:
|
||||
print "Erreur : plusieurs résultats pour %s.\n" % motif
|
||||
print help
|
||||
sys.exit(0)
|
||||
aide()
|
||||
else :
|
||||
adherent = recherche[0]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue