'Get Account() for a thread (current if None)
If no account has been registered with this thread, return \'None\'.'

def getthreadaccount(self, thr=None):

    if (thr == None):
        thr = threading.currentThread()
    if (thr in self.threadaccounts):
        return self.threadaccounts[thr]
    return None
