def __init__(self, command, onSuccess, onFailure, param=None, onStatusReport=None, onProgressReport=None, onCustomReport=None, passTC=True):
        """'command' is a tuple containing a function reference, a sequence of parameters and a dictionary of parameters.
        The func will be called but the first arg will be 'self' (this ThreadCommand instance)
        'onSuccess' will be called passing 'param' and the result on success 
        'onFailure' will be called passing 'param' and an error message object on failure
        'param' is passed to all callback funcs, unless it is 'None'
        'onStatusReport' will be called passing a string for showing to the user along with param
        'onProgressReport' will be called passing a float between 0 and 100 along with param
        'onCustomReport' will be called with whatever params and kwparams the caller and server decide on,
        but the first param will be 'param'
        """
        self.command = command
        self.onStatusReport = onStatusReport
        self.onProgressReport = onProgressReport
        self.onSuccess = onSuccess
        self.onFailure = onFailure
        self.onCustomReport = onCustomReport
        self.param = param
        self.state = QUEUED
        self.passTC = passTC
        # Queue ourselves or...
        if self.twistedThread: self.twistedThread.runCommand(self)
        else:
            # Just run in current thread
            import pdb
            pdb.set_trace()
            try:
                if passTC: res = command[0](self, *command[1], **command[2])
                else: res = command[0](*command[1], **command[2])
            except Exception, e:
                if onFailure:
                    if param: onFailure(e, param)
                    else: onFailure(e)
                else:
                    if param: onFailure(e, param)
                    else: onFailure(e)
            if onSuccess:
                if isinstance(res, Deferred):
                    if param: res.addCallback(onSuccess, param)
                    else: res.addCallback(onSuccess)
                else:
                    if param: onSuccess(res, param)
                    else: onSuccess(res)
'command' is a tuple containing a function reference, a sequence of parameters and a dictionary of parameters.
        The func will be called but the first arg will be 'self' (this ThreadCommand instance)
        'onSuccess' will be called passing 'param' and the result on success 
        'onFailure' will be called passing 'param' and an error message object on failure
        'param' is passed to all callback funcs, unless it is 'None'
        'onStatusReport' will be called passing a string for showing to the user along with param
        'onProgressReport' will be called passing a float between 0 and 100 along with param
        'onCustomReport' will be called with whatever params and kwparams the caller and server decide on,
        but the first param will be 'param'
        
recipes/Python/286201_wx_twisted_support_using_threads/recipe-286201.py