[PATCH 03/13] remove some unneeded includes

Sebastian Spaeth Sebastian at SSpaeth.de
Wed Nov 24 09:56:40 GMT 2010


Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
 offlineimap/init.py |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/offlineimap/init.py b/offlineimap/init.py
index f930c0f..5f7f007 100644
--- a/offlineimap/init.py
+++ b/offlineimap/init.py
@@ -17,13 +17,12 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
 import imaplib
-from offlineimap import imapserver, repository, folder, mbnames, threadutil, version, syncmaster, accounts
+from offlineimap import imapserver, threadutil, version, syncmaster, accounts
 from offlineimap.localeval import LocalEval
 from offlineimap.threadutil import InstanceLimitedThread, ExitNotifyThread
-from offlineimap.ui import UIBase
-import re, os, os.path, offlineimap, sys
-from offlineimap.CustomConfig import CustomConfigParser
-from threading import *
+import offlineimap.ui
+import os, sys
+from offlineimap.CustomConfig import CustomConfigParser as ConfigParser
 import threading, socket
 from getopt import getopt
 import signal
@@ -79,7 +78,7 @@ class OfflineImap:
             threadutil.setprofiledir(profiledir)
             sys.stderr.write("WARNING: profile mode engaged;\nPotentially large data will be created in " + profiledir + "\n")
     
-        config = CustomConfigParser()
+        config = ConfigParser()
         if not os.path.exists(configfilename):
             sys.stderr.write(" *** Config file %s does not exist; aborting!\n" % configfilename)
             sys.exit(1)
@@ -97,7 +96,7 @@ class OfflineImap:
             config.set(section, key, value)
     
         ui = offlineimap.ui.detector.findUI(config, options.get('-u'))
-        UIBase.setglobalui(ui)
+        offlineimap.ui.UIBase.setglobalui(ui)
     
         if options.has_key('-l'):
             ui.setlogfd(open(options['-l'], 'wt'))
@@ -140,7 +139,9 @@ class OfflineImap:
     
         def sigterm_handler(self, signum, frame):
             # die immediately
+            ui = BaseUI.getglobalui()
             ui.terminate(errormsg="terminating...")
+
         signal.signal(signal.SIGTERM,sigterm_handler)
     
         try:
@@ -231,6 +232,6 @@ class OfflineImap:
         except SystemExit:
             raise
         except:
-            ui.mainException()                  # Also expected to terminate.
+            ui.mainException()  # Also expected to terminate.
 
         
-- 
1.7.1





More information about the OfflineIMAP-project mailing list