On sort de la phase de test + qq details de la ligne de commande.
darcs-hash:20060527053217-68412-4f519f0de3792da5f5c679d91445f2ade2c3dec0.gz
This commit is contained in:
parent
ab0ce3387d
commit
2547ccda39
1 changed files with 14 additions and 13 deletions
|
@ -7,7 +7,7 @@
|
|||
derniereConnexion dans la base LDAP.
|
||||
|
||||
UTILISATION
|
||||
%(prog)s action
|
||||
%(prog)s [action...]
|
||||
|
||||
ACTIONS POSSIBLES
|
||||
%(acts)s"""
|
||||
|
@ -22,7 +22,7 @@ from socket import gethostname
|
|||
from smtplib import SMTP
|
||||
|
||||
host = gethostname()
|
||||
debug = u'disconnect@crans.org'
|
||||
debug = None
|
||||
mail_report = u'disconnect@crans.org'
|
||||
mail_sender = u"Comptes inactifs <disconnect@crans.org>"
|
||||
template_path = '/usr/scripts/templates/comptes_inactifs.%d.txt'
|
||||
|
@ -274,6 +274,7 @@ comptes_inactifs.py
|
|||
sujet,
|
||||
corps,
|
||||
server = smtp,
|
||||
cc = debug,
|
||||
debug = debug)
|
||||
|
||||
recapitulatif = []
|
||||
|
@ -286,8 +287,8 @@ comptes_inactifs.py
|
|||
stats[i]))
|
||||
|
||||
recapitulatif = tableau(recapitulatif,
|
||||
titre = (u"Inscrits", u"Procmail", u"Mails", u"Nombre"),
|
||||
largeur = (10, 10, 7, 8),
|
||||
titre = (u"Inscrits", u"Forward", u"Mails", u"Nombre"),
|
||||
largeur = (10, 9, 7, 8),
|
||||
alignement = ('c', 'c', 'c', 'd'))
|
||||
recapitulatif += u"""
|
||||
Total : %d
|
||||
|
@ -317,16 +318,16 @@ def usage():
|
|||
if __name__ == '__main__':
|
||||
args = sys.argv[1:]
|
||||
|
||||
if len(args) != 1:
|
||||
sys.stderr.write("Arguments incorrects\n")
|
||||
if len(args) == 0:
|
||||
usage()
|
||||
sys.exit(1)
|
||||
sys.exit(0)
|
||||
|
||||
commande = args[0]
|
||||
if commande not in actions:
|
||||
sys.stderr.write("Commande incorrecte : %s\n" % commande)
|
||||
usage()
|
||||
sys.exit(2)
|
||||
for commande in args:
|
||||
if commande not in actions:
|
||||
sys.stderr.write("Commande incorrecte : %s\n" % commande)
|
||||
usage()
|
||||
sys.exit(2)
|
||||
|
||||
ci = ComptesInactifs()
|
||||
eval('ci.do_%s()' % commande)
|
||||
for commande in args:
|
||||
eval('ci.do_%s()' % commande)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue