kdeldycke/mail-deduplicate

warning messages do not go well with progress bar

leggewie opened this issue · 2 comments

Preliminary checks

  • I am running the latest version (but on Bionic with python 3.6, I recompiled my own package)
  • I have read the Code of Conduct
  • I have checked there is not other Issues or Pull Requests covering the same topic to open

Describe the bug

$ mdedup -n -s discard-all-but-one -a delete-selected ~/Maildir/.Erledigt/

● Phase #0 - Load mails
Opening /home/user/Maildir/.Erledigt ...
maildir detected.
54361 mails found.
Mail sources  [####################################]  1/1

● Phase #1 - Compute hashes and group duplicates
Use [date, from, to, subject, mime-version, content-type, content-disposition, user-agent, x-priority, message-id] headers to compute hashes.
Hashed mails  [###---------------------------------]  4596/54361  00:12:13 warning: ╒═════════════╤════════════════╕
warning: │ Header ID   │ Header value   │
warning: ╞═════════════╪════════════════╡
warning: ╘═════════════╧════════════════╛
warning: Rejecting <MaildirDedupMail /home/user/Maildir/.Erledigt:1406922416.M923538P22149.giga,W=2249,S=2199>: 0 headers found out of 4.
Hashed mails  [###---------------------------------]  4822/54361  00:12:00 warning: ╒═════════════╤════════════════╕
warning: │ Header ID   │ Header value   │
warning: ╞═════════════╪════════════════╡
warning: ╘═════════════╧════════════════╛
warning: Rejecting <MaildirDedupMail /home/user/Maildir/.Erledigt:1406925672.M913903P22654.giga,W=962,S=943>: 0 headers found out of 4.

Notice how the warning and the ongoing progress bar don't interact well. The first of the four warning lines for each error should have a newline prepended to it to have it start on a newline.

I am not 100% sure this would be the entirely correct way to deal with this problem. FWIW, there is still an ugly "warning: " tag added on the same line as the progress bar, but at least the following lines with the table and the other relevant information do show up correctly with this patch.

$ mdedup -n -s discard-all-but-one -a delete-selected ~/Maildir/.Erledigt/

● Phase #0 - Load mails
Opening /home/user/Maildir/.Erledigt ...
maildir detected.
54361 mails found.
Mail sources [####################################] 1/1

● Phase #1 - Compute hashes and group duplicates
Use [date, from, to, subject, mime-version, content-type, content-disposition, user-agent, x-priority, message-id] headers to compute hashes.
Hashed mails [###---------------------------------] 4596/54361 00:12:13 warning: 
warning: ╒═════════════╤════════════════╕
warning: │ Header ID │ Header value │
warning: ╞═════════════╪════════════════╡
warning: ╘═════════════╧════════════════╛
warning: Rejecting : 0 headers found out of 4.
Hashed mails [###---------------------------------] 4822/54361 00:12:00 warning: 
warning: ╒═════════════╤════════════════╕
warning: │ Header ID │ Header value │
warning: ╞═════════════╪════════════════╡
warning: ╘═════════════╧════════════════╛
warning: Rejecting : 0 headers found out of 4.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.