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: Use common function for creating the mbox_source data
Date Thu, 24 Nov 2016 16:24:20 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 185319149 -> d9d5dffb1


Use common function for creating the mbox_source data

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

Branch: refs/heads/master
Commit: d9d5dffb1257eda8d96a84222a3485966e3f7611
Parents: 1853191
Author: Sebb <sebb@apache.org>
Authored: Thu Nov 24 16:24:05 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Thu Nov 24 16:24:05 2016 +0000

----------------------------------------------------------------------
 tools/archiver.py    | 8 ++++++--
 tools/import-mbox.py | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/d9d5dffb/tools/archiver.py
----------------------------------------------------------------------
diff --git a/tools/archiver.py b/tools/archiver.py
index 581b0bf..c4bb776 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -400,7 +400,7 @@ class Archiver(object):
             consistency = self.consistency,
             body = {
                 "message-id": msg_metadata['message-id'],
-                "source": msg.as_string()
+                "source": self.mbox_source(msg)
             }
         )
         
@@ -492,7 +492,11 @@ class Archiver(object):
                         if logger:
                             logger.info("Notification sent to %s for %s" % (cid, mid))
         return lid, ojson['mid']
-            
+
+    def mbox_source(self, msg):
+        # Common method shared with import-mbox
+        return msg.as_string()
+
     def list_url(self, mlist):
         """ Required by MM3 plugin API
         """

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/d9d5dffb/tools/import-mbox.py
----------------------------------------------------------------------
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index 3cfa251..8f7f679 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -297,7 +297,7 @@ class SlurpThread(Thread):
                         json_source = {
                             'mid': json['mid'], # needed for bulk-insert only, not needed
in database
                             'message-id': json['message-id'],
-                            'source': message.as_string()
+                            'source': archie.mbox_source(message)
                         }
                     except Exception as e:
                         self.printid("Error '%s' processing id %s msg %s " % (e, json['mid'],
json['message-id']))


Mime
View raw message