How to use the pydevd.pydevd_comm.NetCommand function in pydevd

To help you get started, we’ve selected a few pydevd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deis / deis / pydevd / pydevd_comm.py View on Github external
myLine = str(curFrame.f_lineno)
                #print "line is ", myLine
                
                #the variables are all gotten 'on-demand'
                #variables = pydevd_vars.frameVarsToXML(curFrame)

                variables = ''
                cmdTextList.append('"' % (quote(myFile, '/>_= \t'), myLine)) 
                cmdTextList.append(variables) 
                cmdTextList.append("") 
                curFrame = curFrame.f_back
            
            cmdTextList.append("")
            cmdText = ''.join(cmdTextList)
            return NetCommand(CMD_THREAD_SUSPEND, 0, cmdText)
        except:
            return self.makeErrorMessage(0, GetExceptionTracebackStr())
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeGetVariableMessage(self, seq, payload):
        try:
            return NetCommand(CMD_GET_VARIABLE, seq, payload)
        except Exception:
            return self.makeErrorMessage(seq, GetExceptionTracebackStr())
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeIoMessage(self, v, ctx, dbg=None):
        '''
        @param v: the message to pass to the debug server
        @param ctx: 1 for stdio 2 for stderr
        @param dbg: If not none, add to the writer
        '''
        
        try:
            if len(v) > MAX_IO_MSG_SIZE:
                v = v[0:MAX_IO_MSG_SIZE]
                v += '...'
                
            v = pydevd_vars.makeValidXmlValue(quote(v, '/>_= \t'))
            net = NetCommand(str(CMD_WRITE_TO_CONSOLE), 0, '' % (v, ctx))
            if dbg:
                dbg.writer.addCommand(net)
        except:
            return self.makeErrorMessage(0, GetExceptionTracebackStr())
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeListThreadsMessage(self, seq):
        """ returns thread listing as XML """
        try:
            t = threading.enumerate()
            cmdText = ""
            for i in t:
                if t.isAlive():
                    cmdText += self.threadToXML(i)
            cmdText += ""
            return NetCommand(CMD_RETURN, seq, cmdText)
        except:
            return self.makeErrorMessage(seq, GetExceptionTracebackStr())
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeSendConsoleMessage(self, seq, payload):
        try:
            return NetCommand(CMD_EVALUATE_CONSOLE_EXPRESSION, seq, payload)
        except Exception:
            return self.makeErrorMessage(seq, GetExceptionTracebackStr())
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeVersionMessage(self, seq):
        try:
            return NetCommand(CMD_VERSION, seq, VERSION_STRING)
        except:
            return self.makeErrorMessage(seq, GetExceptionTracebackStr())
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeThreadKilledMessage(self, id):
        try:
            return NetCommand(CMD_THREAD_KILL, 0, str(id))
        except:
            return self.makeErrorMessage(0, GetExceptionTracebackStr())
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeThreadCreatedMessage(self, thread):
        cmdText = "" + self.threadToXML(thread) + ""
        return NetCommand(CMD_THREAD_CREATE, 0, cmdText)
github deis / deis / pydevd / pydevd_comm.py View on Github external
def makeErrorMessage(self, seq, text):
        cmd = NetCommand(CMD_ERROR, seq, text)
        if DEBUG_TRACE_LEVEL > 2:
            sys.stderr.write("Error: %s" % (text,))
        return cmd