You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2020/03/18 10:53:27 UTC

[incubator-ponymail] branch master updated: Enh: add some debug output to import-mbox

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new e089fe2  Enh: add some debug output to import-mbox
e089fe2 is described below

commit e089fe2795348fd2ecd6c02c724501eeb9cf2d0f
Author: Sebb <se...@apache.org>
AuthorDate: Wed Mar 18 10:53:07 2020 +0000

    Enh: add some debug output to import-mbox
    
    This fixes #396
---
 CHANGELOG.md         | 1 +
 tools/import-mbox.py | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8715f60..0abbf48 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## Changes in 0.12:
+- Enh: add some debug output to import-mbox (#396)
 - Enh: Allow fetching emails with quotes in their document ID
 - Enh: URI-encode permalinks (#510)
 - Bug: only 12 months in a year (#508)
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index ea490ea..e2f94f0 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -287,6 +287,9 @@ class SlurpThread(Thread):
                     count += 1
                     ja.append(json)
                     jas.append(json_source)
+                    if args.verbose:
+                        # TODO optionally show other fields (e.g. From_ line)
+                        print("%(mid)s %(message-id)s" % json)
                     if contents:
                         if not args.dry:
                             for key in contents:
@@ -353,6 +356,8 @@ parser.add_argument('--private', dest='private', action='store_true',
                    help='This is a privately archived list. Filter through auth proxy.')
 parser.add_argument('--dry', dest='dry', action='store_true',
                    help='Do not save emails to elasticsearch, only test importing')
+parser.add_argument('--verbose', dest='verbose', action='store_true',
+                   help='Show details of generated id (for use with --dry)')
 parser.add_argument('--duplicates', dest='dups', action='store_true',
                    help='Detect duplicate mids in this run')
 parser.add_argument('--html2text', dest='html2text', action='store_true',