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: It's cheaper to check self.html first
Date Sun, 29 Jan 2017 13:51:24 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 84eff685e -> 257fb336e


It's cheaper to check self.html first

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

Branch: refs/heads/master
Commit: 257fb336ef358783f167b44dbd1179d8145f898c
Parents: 84eff68
Author: Sebb <sebb@apache.org>
Authored: Sun Jan 29 13:51:10 2017 +0000
Committer: Sebb <sebb@apache.org>
Committed: Sun Jan 29 13:51:10 2017 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/257fb336/tools/archiver.py
----------------------------------------------------------------------
diff --git a/tools/archiver.py b/tools/archiver.py
index bf4033b..48c4d22 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -218,12 +218,12 @@ class Archiver(object):
                                 body = subpart.get_payload(decode=True)
                             if subpart.get_content_type() == 'text/enriched' and not body:
                                 body = subpart.get_payload(decode=True)
-                            elif subpart.get_content_type() == 'text/html' and self.html
and not firstHTML:
+                            elif self.html and subpart.get_content_type() == 'text/html'
and not firstHTML:
                                 firstHTML = subpart.get_payload(decode=True)
             
                     elif part.get_content_type() == 'text/plain' and not body:
                         body = part.get_payload(decode=True)
-                    elif part.get_content_type() == 'text/html' and self.html and not firstHTML:
+                    elif self.html and part.get_content_type() == 'text/html' and not firstHTML:
                         firstHTML = part.get_payload(decode=True)
                 except Exception as err:
                     print(err)
@@ -231,7 +231,7 @@ class Archiver(object):
             body = msg.get_payload(decode=True)
         elif msg.get_content_type() == 'text/enriched':
             body = msg.get_payload(decode=True)
-        elif msg.get_content_type() == 'text/html' and self.html and not firstHTML:
+        elif self.html and msg.get_content_type() == 'text/html' and not firstHTML:
             firstHTML = msg.get_payload(decode=True)
             
         # this requires a GPL lib, user will have to install it themselves


Mime
View raw message