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 2016/11/17 16:38:58 UTC

incubator-ponymail git commit: Show failures per slurp

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master f593020a6 -> e9c08ce2d


Show failures per slurp

Makes it easier to see which sources had problems

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/e9c08ce2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/e9c08ce2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/e9c08ce2

Branch: refs/heads/master
Commit: e9c08ce2d8733034e5114d027f27d485cf53eabc
Parents: f593020
Author: Sebb <se...@apache.org>
Authored: Thu Nov 17 16:38:47 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Thu Nov 17 16:38:47 2016 +0000

----------------------------------------------------------------------
 tools/import-mbox.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/e9c08ce2/tools/import-mbox.py
----------------------------------------------------------------------
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index b59e924..b325bc6 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -222,6 +222,7 @@ class SlurpThread(Thread):
                 messages = mailbox.mbox(tmpname)
 
             count = 0
+            bad = 0
             LEY = EY
             
             
@@ -308,19 +309,20 @@ class SlurpThread(Thread):
                         jas = []
                 else:
                     print("Failed to parse: Return=%s Message-Id=%s" % (message.get('Return-Path'), message.get('Message-Id')))
-                    baddies += 1
+                    bad += 1
 
             if filebased:
-                print("Parsed %u records from %s" % (count, filename))
+                print("Parsed %u records (failed: %u) from %s" % (count, bad, filename))
                 if dFile:
                     os.unlink(tmpname)
             elif imap:
-                print("Parsed %u records from imap" % count)
+                print("Parsed %u records (failed: %u) from imap" % (count, bad))
             else:
-                print("Parsed %s/%s: %u records from %s" % (ml, mboxfile, count, tmpname))
+                print("Parsed %s/%s: %u records (failed: %u) from %s" % (ml, mboxfile, count, bad, tmpname))
                 os.unlink(tmpname)
                 
             y += count
+            baddies += bad
             if not args.dry:
                 bulk = BulkThread()
                 bulk.assign(ja, es)