/offlineimap/head: changeset 307
Starting to work now.
This commit is contained in:
parent
86df6db630
commit
c48d8d4fda
@ -17,6 +17,7 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
from threading import *
|
from threading import *
|
||||||
|
from offlineimap.ui.UIBase import UIBase
|
||||||
import thread
|
import thread
|
||||||
|
|
||||||
class BlinkenBase:
|
class BlinkenBase:
|
||||||
|
@ -231,7 +231,7 @@ class Blinkenlights(BlinkenBase, UIBase):
|
|||||||
try:
|
try:
|
||||||
s.gettf().setcolor('white')
|
s.gettf().setcolor('white')
|
||||||
s._addline_unlocked(" *** Input Required", s.gettf().getcolor())
|
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.gettf().getcolor())
|
||||||
s.logwindow.refresh()
|
s.logwindow.refresh()
|
||||||
password = s.logwindow.getstr()
|
password = s.logwindow.getstr()
|
||||||
|
@ -54,19 +54,21 @@ class UIBase:
|
|||||||
def registerthread(s, account):
|
def registerthread(s, account):
|
||||||
"""Provides a hint to UIs about which account this particular
|
"""Provides a hint to UIs about which account this particular
|
||||||
thread is processing."""
|
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)" % \
|
raise ValueError, "Thread already registered (old %s, new %s)" % \
|
||||||
(s.getthreadaccount(s), account)
|
(s.getthreadaccount(s), account)
|
||||||
s.threadaccounts[thread.get_ident()] = account
|
s.threadaccounts[threading.currentThread()] = account
|
||||||
|
|
||||||
def unregisterthread(s, thr):
|
def unregisterthread(s, thr):
|
||||||
"""Recognizes a thread has exited."""
|
"""Recognizes a thread has exited."""
|
||||||
if s.threadaccounts.has_key(thr):
|
if s.threadaccounts.has_key(thr):
|
||||||
del s.threadaccounts[thr]
|
del s.threadaccounts[thr]
|
||||||
|
|
||||||
def getthreadaccount(s):
|
def getthreadaccount(s, thr = None):
|
||||||
if s.threadaccounts.has_key(thread.get_ident()):
|
if not thr:
|
||||||
return s.threadaccounts[thread.get_ident()]
|
thr = threading.currentThread()
|
||||||
|
if s.threadaccounts.has_key(thr):
|
||||||
|
return s.threadaccounts[thr]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def debug(s, debugtype, msg):
|
def debug(s, debugtype, msg):
|
||||||
|
Loading…
Reference in New Issue
Block a user