| Class implementing the client side of the debugger.    It provides access to the Python interpeter from a debugger running in another
    process whether or not the Qt event loop is running.     The protocol between the debugger and the client assumes that there will be
    a single source of debugger commands and a single source of Python
    statements.  Commands and statement are always exactly one line and may be
    interspersed.     The protocol is as follows.  First the client opens a connection to the
    debugger and then sends a series of one line commands.  A command is either
    >Load<, >Step<, >StepInto<, ... or a Python statement. See DebugProtocol.py
    for a listing of valid protocol tokens.     A Python statement consists of the statement to execute, followed (in a
    separate line) by >OK?<.  If the statement was incomplete then the response
    is >Continue<.  If there was an exception then the response is >Exception<.
    Otherwise the response is >OK<.  The reason for the >OK?< part is to
    provide a sentinal (ie. the responding >OK<) after any possible output as a
    result of executing the command.     The client may send any other lines at any other time which should be
    interpreted as program output.     If the debugger closes the session there is no response from the client.
    The client may close the session at any time as a result of the script
    being debugged closing or crashing.     Note: This class is meant to be subclassed by individual DebugClient classes.
    Do not instantiate it directly. 
        
            | Methods |  |  
        |  |  
            |  | __init__ |  
        | 
__init__ ( self )
 Constructor |  
            |  | absPath |  
        | 
absPath ( self,  fn )
 Private method to convert a filename to an absolute name.        sys.path is used as a set of possible prefixes. The name stays 
        relative if a file could not be found.         Arguments
            fnfilename (string)         Returns            the converted filename (string) |  
            |  | attachThread |  
        | 
attachThread (
        self,
        target=None,
        args=None,
        kwargs=None,
        mainThread=0,
        )
Public method to setup a thread for DebugClient to debug.        If mainThread is non-zero, then we are attaching to the already 
        started mainthread of the app and the rest of the args are ignored.         This is just an empty function and is overridden in the threaded
        debugger.         Arguments
            targetthe start function of the target thread (i.e. the user code)            argsarguments to pass to target            kwargskeyword arguments to pass to target            mainThreadnon-zero, if we are attaching to the already 
              started mainthread of the app         Returns            The identifier of the created thread |  
            |  | completionList |  
        | 
completionList ( self,  text )
 Private slot to handle the request for a commandline completion list.        Arguments
            textthe text to be completed (string) |  
            |  | connectDebugger |  
        | 
connectDebugger (
        self,
        port,
        remoteAddress=None,
        )
Public method to establish a session with the debugger.         It opens a network connection to the debugger, connects it to stdin, 
        stdout and stderr and saves these file objects in case the application
        being debugged redirects them itself.         Arguments
            portthe port number to connect to (int)            remoteAddressthe network address of the debug server host (string) |  
            |  | dumpVariable |  
        | 
dumpVariable (
        self,
        var,
        frmnr,
        scope,
        filter,
        )
Private method to return the variables of a frame to the debug server.        Arguments
            varlist encoded name of the requested variable (list of strings)            frmnrdistance of frame reported on. 0 is the current frame (int)            scope1 to report global variables, 0 for local variables (int)            filterthe indices of variable types to be filtered (list of int) |  
            |  | dumpVariables |  
        | 
dumpVariables (
        self,
        frmnr,
        scope,
        filter,
        )
Private method to return the variables of a frame to the debug server.        Arguments
            frmnrdistance of frame reported on. 0 is the current frame (int)            scope1 to report global variables, 0 for local variables (int)            filterthe indices of variable types to be filtered (list of int) |  
            |  | eventLoop |  
        | 
eventLoop ( self )
 Private method implementing our event loop. |  
            |  | formatVariablesList |  
        | 
formatVariablesList (
        self,
        keylist,
        dict,
        filter=[],
        classdict=0,
        prefix='',
        )
Private method to produce a formated variables list.        The dictionary passed in to it is scanned. If classdict is false,
        it builds a list of all class instances in dict. If it is
        true, we are formatting a class dictionary. In this case
        we prepend prefix to the variable names. Variables are
        only added to the list, if their type is not contained 
        in the filter list. The formated variables list (a list of 
        tuples of 3 values) and the list of class instances is returned.         Arguments
            keylistkeys of the dictionary            dictthe dictionary to be scanned            filterthe indices of variable types to be filtered. Variables are
              only added to the list, if their type is not contained 
              in the filter list.            classdictboolean indicating the formating of a class or
              module dictionary. If classdict is false,
              it builds a list of all class instances in dict. If it is
              true, we are formatting a class dictionary. In this case
              we prepend prefix to the variable names.            prefixprefix to prepend to the variable names (string)         Returns            A tuple consisting of a list of formatted variables and a list of
            class instances. Each variable entry is a tuple of three elements,
            the variable name, its type and value. |  
            |  | getRunning |  
        | 
getRunning ( self )
 Public method to return the main script we are currently running. |  
            |  | handleException |  
        | 
handleException ( self )
 Private method called in the case of an exception        It ensures that the debug server is informed of the raised exception. |  
            |  | handleLine |  
        | 
handleLine ( self,  line )
 Private method to handle the receipt of a complete line.        It first looks for a valid protocol token at the start of the line. Thereafter
        it trys to execute the lines accumulated so far.         Arguments
            linethe received line |  
            |  | interact |  
        | 
interact ( self )
 Private method to Interact with  the debugger. |  
            |  | progTerminated |  
        | 
progTerminated ( self,  status )
 Private method to tell the debugger that the program has terminated.        Arguments
            statusthe return status |  
            |  | raw_input |  
        | 
raw_input ( self,  prompt )
 Public method to implement raw_input() using the event loop.        Arguments
            promptthe prompt to be shown (string)         Returns
            the entered string |  
            |  | run_call |  
        | 
run_call (
        self,
        scriptname,
        func,
        *args,
        )
Public method used to start the remote debugger and call a function.        Arguments
            scriptnamename of the script to be debugged (string)            funcfunction to be called            *argsarguments being passed to func         Returns            result of the function call |  
            |  | sessionClose |  
        | 
sessionClose ( self )
 Private method to close the session with the debugger and terminate. |  
            |  | shouldSkip |  
        | 
shouldSkip ( self,  fn )
 Public method to check if a file should be skipped.        Arguments
            fnfilename to be checked         Returns
            non-zero if fn represents a file we are skipping, zero otherwise. |  
            |  | startDebugger |  
        | 
startDebugger (
        self,
        filename=None,
        host=None,
        port=None,
        enableTrace=1,
        )
Method used to start the remote debugger.        Arguments
            filenamethe program to be debugged (string)            hosthostname of the debug server (string)            portportnumber of the debug server (int)            enableTraceflag to enable the tracing function (boolean) |  
            |  | unhandled_exception |  
        | 
unhandled_exception (
        self,
        exctype,
        excval,
        exctb,
        )
Private method called to report an uncaught exception.        Arguments
            exctypethe type of the exception            excvaldata about the exception            exctbtraceback for the exception |  
            |  | write |  
        | 
write ( self,  s )
 Private method to write data to the output stream.        Arguments
            sdata to be written (string) |  |