From 0449a457b2bb51ff46e7227eeb9a28adfd71959f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 1 Nov 2019 14:06:36 +0100 Subject: [PATCH] feed emails: display list names and message counts in verbose mode --- eodb/events/management/commands/feed_emails.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eodb/events/management/commands/feed_emails.py b/eodb/events/management/commands/feed_emails.py index e393c97..748941c 100644 --- a/eodb/events/management/commands/feed_emails.py +++ b/eodb/events/management/commands/feed_emails.py @@ -18,7 +18,10 @@ class Command(BaseCommand): for maildir in options.get('maildir'): if 'commits' in maildir: continue + if options['verbosity'] >= 2: + print(maildir) box = mailbox.Maildir(maildir, create=False) + count = 0 for message_id in box.iterkeys(): message = box[message_id] try: @@ -37,3 +40,6 @@ class Command(BaseCommand): 'list_id': list_id, 'author_email': author_email, 'author_datetime': author_date}) + count += 1 + if options['verbosity'] >= 2: + print(' ->', count)