This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
commit 04aaf6c9cf878386ef79e8f9c47aa520d5fee20a Author: Sebb <[email protected]> AuthorDate: Fri Aug 21 23:28:27 2020 +0100 Simplify --- tools/archiver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/archiver.py b/tools/archiver.py index 1163cb0..5ca4ebb 100755 --- a/tools/archiver.py +++ b/tools/archiver.py @@ -331,7 +331,7 @@ class Archiver(object): # N.B. Also used by import-mbox.py lid = lid.replace(self.cropout, "") def default_empty_string(value): - return value and str(value) or "" + return str(value) if value else "" msg_metadata = dict([(k, default_empty_string(msg.get(k))) for k in self.keys]) mid = ( @@ -466,6 +466,7 @@ class Archiver(object): # N.B. Also used by import-mbox.py print("**** Dry run, not saving message to database *****") return lid, ojson["mid"] + # TODO: this belongs in __init__ once that has access to args.dry if self.dump_dir: try: self.elastic = plugins.elastic.Elastic()
