You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/11/08 22:57:49 UTC

incubator-ponymail git commit: Tidy imports and global use

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 7d2e52775 -> bdb7a7aae


Tidy imports and global use

logging is unconditionally needed, so do it at start
drop global refs that are read-only

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

Branch: refs/heads/master
Commit: bdb7a7aae032469be361a005d9158cea49446289
Parents: 7d2e527
Author: Sebb <se...@apache.org>
Authored: Tue Nov 8 22:57:38 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Tue Nov 8 22:57:38 2016 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/bdb7a7aa/tools/archiver.py
----------------------------------------------------------------------
diff --git a/tools/archiver.py b/tools/archiver.py
index 320905e..60339fc 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -52,6 +52,7 @@ import configparser
 import os
 import fnmatch
 import io
+import logging
 
 # Fetch config
 path = os.path.dirname(os.path.realpath(__file__))
@@ -65,7 +66,6 @@ if config.has_section('mailman') and config.has_option('mailman', 'plugin'):
     from zope.interface import implementer
     from mailman.interfaces.archiver import IArchiver
     from mailman.interfaces.archiver import ArchivePolicy
-    import logging
     logger = logging.getLogger("mailman.archiver")
 elif __name__ == '__main__':
     import sys
@@ -141,7 +141,6 @@ class Archiver(object):
 
     def __init__(self, parseHTML=False):
         """ Just initialize ES. """
-        global config, auth
         self.html = parseHTML
         if parseHTML:
             import html2text
@@ -189,7 +188,6 @@ class Archiver(object):
     
     
     def msgbody(self, msg):
-        global iBody
         body = None
         firstHTML = None
         if msg.is_multipart():
@@ -523,11 +521,9 @@ if __name__ == '__main__':
         parseHTML = True
 
     if args.verbose:
-        import logging
         logging.basicConfig(stream=sys.stdout, level=logging.INFO)
     else:
         # elasticsearch logs lots of warnings on retries/connection failure
-        import logging
         logging.getLogger("elasticsearch").setLevel(logging.ERROR)