reboot after a year

This commit is contained in:
gauthiier 2020-12-15 15:39:19 +01:00
parent 202f72a228
commit c6bbbb8454
2 changed files with 10 additions and 110 deletions

View File

@ -130,12 +130,12 @@ def emit_mail_xml(msg, li, thread_nbr, msg_nbr):
h = hash(msg) # patch h = hash(msg) # patch
if h in hashes: if h in hashes:
#logging.warning("Duplicate: " + msg['from'] + " - " + msg['subject'] + " - " + msg['date'] + ". Skipping...") logging.warning("Duplicate: " + msg['from'] + " - " + msg['subject'] + " - " + msg['date'] + ". Skipping...")
return '' return ''
else: else:
hashes.append(h) hashes.append(h)
print(msg['date'] + " - " + msg['subject']) # print(msg['date'] + " - " + msg['subject'])
nbr = make_xml_element("nbr", str(thread_nbr) + "." + str(msg_nbr)) + "\n" nbr = make_xml_element("nbr", str(thread_nbr) + "." + str(msg_nbr)) + "\n"
@ -249,7 +249,10 @@ def export_single_tag(t, sel, fout):
thread_nbr = 0 thread_nbr = 0
for m in ch['lists']: for m in ch['lists']:
chapter_mails += emit_mail_xml(m, m['list'], thread_nbr, 0) mail = emit_mail_xml(m, m['list'], thread_nbr, 0)
if mail == '':
continue
chapter_mails += mail
thread_nbr += 1 thread_nbr += 1
@ -266,13 +269,14 @@ def export_single_tag(t, sel, fout):
print(str(len(all_follow))) print(str(len(all_follow)))
all_follow = sorted(all_follow, key=lambda m: export.utils.parse_date_msg(m)) all_follow = sorted(all_follow, key=lambda m: export.utils.parse_date_msg(m))
for f in all_follow: for f in all_follow:
chapter_mails += emit_mail_xml(f, m['list'], thread_nbr, msg_nbr) mail = emit_mail_xml(f, m['list'], thread_nbr, msg_nbr)
if mail != '':
chapter_mails += mail
msg_nbr += 1 msg_nbr += 1
chapter_mails += "</mails>\n" chapter_mails += "</mails>\n"
chapter = "<chapter>\n" + chapter_title + chapter_desc + chapter_mails + "</chapter>" chapter = "<chapter>\n" + chapter_title + chapter_desc + chapter_mails + "</chapter>"

File diff suppressed because one or more lines are too long