'Register current thread as being associated with an account name.'

def registerthread(self, account):

    cur_thread = threading.currentThread()
    if (cur_thread in self.threadaccounts):
        self.debug('thread', ("Register    thread    '%s'    (previously    '%s',    now    '%s')" % (cur_thread.getName(), self.getthreadaccount(cur_thread), account)))
    else:
        self.debug('thread', ("Register    new    thread    '%s'    (account    '%s')" % (cur_thread.getName(), account)))
    self.threadaccounts[cur_thread] = account
