Detabification
darcs-hash:20050429145423-d1718-6918a85270b55df7ae9b838316aeee53213a336b.gz
This commit is contained in:
parent
5b003d8768
commit
69f0a20bb1
2 changed files with 223 additions and 223 deletions
|
@ -20,7 +20,7 @@ def mail_details (Objets, Subject = "Modifications dans la base LDAP", To = ['ro
|
|||
"""
|
||||
|
||||
if not len(Objets) :
|
||||
return True
|
||||
return True
|
||||
|
||||
base_txt_mail = """From: %(From)s
|
||||
To: %(To)s
|
||||
|
@ -31,20 +31,20 @@ Subject: %(Subject)s
|
|||
details = []
|
||||
|
||||
for i in Objets :
|
||||
if i.__class__ == machine :
|
||||
details.append(machine_details(i))
|
||||
elif i.__class__ == adherent :
|
||||
details.append(adher_details(i))
|
||||
elif i.__class__ == club :
|
||||
details.append(club_details(i))
|
||||
else :
|
||||
ok = False
|
||||
|
||||
if i.__class__ == machine :
|
||||
details.append(machine_details(i))
|
||||
elif i.__class__ == adherent :
|
||||
details.append(adher_details(i))
|
||||
elif i.__class__ == club :
|
||||
details.append(club_details(i))
|
||||
else :
|
||||
ok = False
|
||||
|
||||
texte = '\n\n- - - - = = = = # # # # # # = = = = - - - -\n\n'.join(details)
|
||||
|
||||
if no_ascii :
|
||||
import sre
|
||||
texte = sre.sub('\x1b\[1;([0-9]|[0-9][0-9])m','',texte)
|
||||
import sre
|
||||
texte = sre.sub('\x1b\[1;([0-9]|[0-9][0-9])m','',texte)
|
||||
|
||||
mail_complet = base_txt_mail % { 'From' : From, 'To' : ','.join(To), 'Subject' : Subject, 'Text' : texte.encode('iso8859-15') }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue