Pass ui.registerthread an Account() and not a name as string

This way, we can use all the account functions such as set_abort_event()
from the ui if needed.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2011-11-03 13:45:44 +01:00
parent ab184d84e2
commit f4a32bafd6
5 changed files with 16 additions and 15 deletions

View File

@ -160,12 +160,14 @@ class UIBase(object):
self.debug('thread', "Unregister thread '%s'" % thr.getName())
def getthreadaccount(self, thr = None):
"""Get name of account for a thread (current if None)"""
if not thr:
"""Get Account() for a thread (current if None)
If no account has been registered with this thread, return 'None'"""
if thr == None:
thr = threading.currentThread()
if thr in self.threadaccounts:
return self.threadaccounts[thr]
return '*Control' # unregistered thread is '*Control'
return None
def debug(self, debugtype, msg):
cur_thread = threading.currentThread()