Commit bebdd4fd authored by Nicolas Joyard's avatar Nicolas Joyard

Extract 3

parent 52f4d92e
...@@ -241,7 +241,7 @@ def extraire_mails_cada(app): ...@@ -241,7 +241,7 @@ def extraire_mails_cada(app):
with open(os.path.join(emails_root, eml)) as f: with open(os.path.join(emails_root, eml)) as f:
message = email.message_from_file(f) message = email.message_from_file(f)
cada_id = message['subject'] cada_id = message['subject']
date_avis = dateparser.parse(message['date'].replace(" (CET)", "") date_avis = dateparser.parse(message['date'].replace(" (CET)", ""))
# Extraction pièce jointe 'Avis.pdf' # Extraction pièce jointe 'Avis.pdf'
pdf = None pdf = None
......
...@@ -122,7 +122,7 @@ def export_pour_ta(app): ...@@ -122,7 +122,7 @@ def export_pour_ta(app):
.all() .all()
output_order = ['num', 'nom', 'sexe', 'refus', 'demande', 'bordereau', output_order = ['num', 'nom', 'sexe', 'refus', 'demande', 'bordereau',
'avis_cada'] 'avis_cada', 'date_cada']
print(';'.join(output_order)) print(';'.join(output_order))
...@@ -148,5 +148,6 @@ def export_pour_ta(app): ...@@ -148,5 +148,6 @@ def export_pour_ta(app):
if act.etape == ETAPE_DOC_MASQUE and \ if act.etape == ETAPE_DOC_MASQUE and \
act.attachment.startswith('avis-cada'): act.attachment.startswith('avis-cada'):
data['avis_cada'] = act.attachment data['avis_cada'] = act.attachment
data['date_cada'] = act.date.strftime('%d/%m/%Y')
print(';'.join([data.get(k, '') for k in output_order])) print(';'.join([data.get(k, '') for k in output_order]))
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