You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/08/18 07:22:54 UTC

[incubator-ponymail-foal] branch master updated (f0dce33 -> 0d507b9)

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

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


    from f0dce33  fix some more warnings from mypy
     new 0c96a24  switch to .assign, don't muck about with internals externally
     new 0d507b9  simplify by using __repr__

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/archiver.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)


[incubator-ponymail-foal] 02/02: simplify by using __repr__

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0d507b900c347b20f99cda505e58eef58a115e0f
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Aug 18 09:22:19 2020 +0200

    simplify by using __repr__
---
 tools/archiver.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index a238979..32c2597 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -181,8 +181,8 @@ class Body:
             if not self.string:
                 self.string = contents.decode("utf-8", errors="replace")
 
-    def __str__(self):
-        return self.string or "None"
+    def __repr__(self):
+        return self.string
 
     def __len__(self):
         return len(self.string or "")


[incubator-ponymail-foal] 01/02: switch to .assign, don't muck about with internals externally

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0c96a2447f3f568f5ca1d7e524884781a3e7ee9a
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Aug 18 09:20:13 2020 +0200

    switch to .assign, don't muck about with internals externally
    
    Also wipe unneeded variable
---
 tools/archiver.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 755dfeb..a238979 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -187,6 +187,9 @@ class Body:
     def __len__(self):
         return len(self.string or "")
 
+    def assign(self, new_string):
+        self.string = new_string
+
     def encode(self, charset="utf-8", errors="strict"):
         return self.string.encode(charset, errors=errors)
 
@@ -287,9 +290,8 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
             or len(body) <= 1
             or (ignore_body and str(body).find(str(ignore_body)) != -1)
         ):
-            content_type = "text/html"
             body = first_html
-            body.string = self.html2text(body.string)
+            body.assign(self.html2text(str(body)))
         return body
 
     def format_flowed(self, body, msg_metadata):