ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: make it easier to test the archiver - --dry option
Date Wed, 23 Nov 2016 16:27:38 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 732fbedef -> 02db41dd0


make it easier to test the archiver - --dry option

This fixes #264

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

Branch: refs/heads/master
Commit: 02db41dd0e228412b8496e1047f5dc66c78aae60
Parents: 732fbed
Author: Sebb <sebb@apache.org>
Authored: Wed Nov 23 16:27:08 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Wed Nov 23 16:27:08 2016 +0000

----------------------------------------------------------------------
 tools/archiver.py | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/02db41dd/tools/archiver.py
----------------------------------------------------------------------
diff --git a/tools/archiver.py b/tools/archiver.py
index 55a4d95..581b0bf 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -367,6 +367,10 @@ class Archiver(object):
             id = msg.get('message-id') or msg.get('Subject') or msg.get("Date")
             raise Exception("Could not parse message %s for %s" % (id,lid))
 
+        if args.dry:
+            print("**** Dry run, not saving message to database *****")
+            return lid, ojson['mid']
+
         msg_metadata = self.msg_metadata
         irt = self.irt
 
@@ -519,6 +523,8 @@ if __name__ == '__main__':
                        help='Output additional log messages')
     parser.add_argument('--html2text', dest='html2text', action='store_true', 
                        help='Try to convert HTML to text if no text/plain message is found')
+    parser.add_argument('--dry', dest='dry', action='store_true',
+                       help='Do not save emails to elasticsearch, only test parsing')
     args = parser.parse_args()
     
     if args.html2text:


Mime
View raw message