rev 307 - offlineimap/head/offlineimap/ui

[email protected] Sun, 5 Jan 2003 00:01:18 -0600 (CST)
Newsgroups gmane.mail.imap.offlineimap.subversion
Message-ID <[email protected]>
Author: jgoerzen
Date: 2003-01-05 00:01:17 -0600 (Sun, 05 Jan 2003)
New Revision: 307

Modified:
   offlineimap/head/offlineimap/ui/Blinkenlights.py
   offlineimap/head/offlineimap/ui/Curses.py
   offlineimap/head/offlineimap/ui/UIBase.py
Log:
Starting to work now.


Modified: offlineimap/head/offlineimap/ui/UIBase.py
==============================================================================
--- offlineimap/head/offlineimap/ui/UIBase.py	(original)
+++ offlineimap/head/offlineimap/ui/UIBase.py	Sun Jan  5 00:01:18 2003
@@ -54,19 +54,21 @@
     def registerthread(s, account):
         """Provides a hint to UIs about which account this particular
         thread is processing."""
-        if s.threadaccounts.has_key(thread.get_ident()):
+        if s.threadaccounts.has_key(threading.currentThread()):
             raise ValueError, "Thread already registered (old %s, new %s)" % \
                   (s.getthreadaccount(s), account)
-        s.threadaccounts[thread.get_ident()] = account
+        s.threadaccounts[threading.currentThread()] = account
 
     def unregisterthread(s, thr):
         """Recognizes a thread has exited."""
         if s.threadaccounts.has_key(thr):
             del s.threadaccounts[thr]
 
-    def getthreadaccount(s):
-        if s.threadaccounts.has_key(thread.get_ident()):
-            return s.threadaccounts[thread.get_ident()]
+    def getthreadaccount(s, thr = None):
+        if not thr:
+            thr = threading.currentThread()
+        if s.threadaccounts.has_key(thr):
+            return s.threadaccounts[thr]
         return None
 
     def debug(s, debugtype, msg):

Modified: offlineimap/head/offlineimap/ui/Blinkenlights.py
==============================================================================
--- offlineimap/head/offlineimap/ui/Blinkenlights.py	(original)
+++ offlineimap/head/offlineimap/ui/Blinkenlights.py	Sun Jan  5 00:01:18 2003
@@ -17,6 +17,7 @@
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 from threading import *
+from offlineimap.ui.UIBase import UIBase
 import thread
 
 class BlinkenBase:

Modified: offlineimap/head/offlineimap/ui/Curses.py
==============================================================================
--- offlineimap/head/offlineimap/ui/Curses.py	(original)
+++ offlineimap/head/offlineimap/ui/Curses.py	Sun Jan  5 00:01:18 2003
@@ -231,7 +231,7 @@
         try:
             s.gettf().setcolor('white')
             s._addline_unlocked(" *** Input Required", s.gettf().getcolor())
-            s._addline_unlocked(" *** Please enter password for account %s: ", accountname,
+            s._addline_unlocked(" *** Please enter password for account %s: " % accountname,
                    s.gettf().getcolor())
             s.logwindow.refresh()
             password = s.logwindow.getstr()