diff -r c99695c0f13a -r f53c03574697 Debugger/DebuggerInterfacePython3.py --- a/Debugger/DebuggerInterfacePython3.py Sun Oct 06 18:02:21 2013 +0200 +++ b/Debugger/DebuggerInterfacePython3.py Sun Oct 06 19:00:04 2013 +0200 @@ -73,7 +73,8 @@ # set default values for capabilities of clients self.clientCapabilities = ClientDefaultCapabilities - self.codec = QTextCodec.codecForName(str(Preferences.getSystem("StringEncoding"))) + self.codec = QTextCodec.codecForName( + str(Preferences.getSystem("StringEncoding"))) if passive: # set translation function @@ -120,7 +121,8 @@ @param program name of the executable to start (string) @param arguments arguments to be passed to the program (list of string) - @param environment dictionary of environment settings to pass (dict of string) + @param environment dictionary of environment settings to pass + (dict of string) @return the process object (QProcess) or None """ proc = QProcess() @@ -158,19 +160,22 @@ debugClientType = Preferences.getDebugger("DebugClientType3") if debugClientType == "standard": debugClient = os.path.join(getConfig('ericDir'), - "DebugClients", "Python3", "DebugClient.py") + "DebugClients", "Python3", + "DebugClient.py") elif debugClientType == "threaded": debugClient = os.path.join(getConfig('ericDir'), - "DebugClients", "Python3", "DebugClientThreads.py") + "DebugClients", "Python3", + "DebugClientThreads.py") else: debugClient = Preferences.getDebugger("DebugClient3") if debugClient == "": debugClient = os.path.join(sys.path[0], - "DebugClients", "Python3", "DebugClient.py") + "DebugClients", "Python3", + "DebugClient.py") redirect = str(Preferences.getDebugger("Python3Redirect")) - noencoding = \ - Preferences.getDebugger("Python3NoEncoding") and '--no-encoding' or '' + noencoding = Preferences.getDebugger("Python3NoEncoding") and \ + '--no-encoding' or '' if Preferences.getDebugger("RemoteDbgEnabled"): ipaddr = self.debugServer.getHostAddress(False) @@ -188,7 +193,8 @@ E5MessageBox.critical(None, self.trUtf8("Start Debugger"), self.trUtf8( - """<p>The debugger backend could not be started.</p>""")) + """<p>The debugger backend could not be""" + """ started.</p>""")) # set translation function if Preferences.getDebugger("PathTranslation"): @@ -233,7 +239,8 @@ E5MessageBox.critical(None, self.trUtf8("Start Debugger"), self.trUtf8( - """<p>The debugger backend could not be started.</p>""")) + """<p>The debugger backend could not be""" + """ started.</p>""")) return process, self.__isNetworked process = self.__startProcess(interpreter, @@ -242,7 +249,8 @@ if process is None: E5MessageBox.critical(None, self.trUtf8("Start Debugger"), - self.trUtf8("""<p>The debugger backend could not be started.</p>""")) + self.trUtf8( + """<p>The debugger backend could not be started.</p>""")) return process, self.__isNetworked def startRemoteForProject(self, port, runInConsole): @@ -283,11 +291,14 @@ E5MessageBox.critical(None, self.trUtf8("Start Debugger"), self.trUtf8( - """<p>The debugger backend could not be started.</p>""")) + """<p>The debugger backend could not be""" + """ started.</p>""")) # set translation function if project.getDebugProperty("PATHTRANSLATION"): - self.translateRemote = project.getDebugProperty("REMOTEPATH") - self.translateLocal = project.getDebugProperty("LOCALPATH") + self.translateRemote = \ + project.getDebugProperty("REMOTEPATH") + self.translateLocal = \ + project.getDebugProperty("LOCALPATH") self.translate = self.__remoteTranslation else: self.translate = self.__identityTranslation @@ -326,7 +337,8 @@ E5MessageBox.critical(None, self.trUtf8("Start Debugger"), self.trUtf8( - """<p>The debugger backend could not be started.</p>""")) + """<p>The debugger backend could not be""" + """ started.</p>""")) return process, self.__isNetworked process = self.__startProcess(interpreter, @@ -335,7 +347,8 @@ if process is None: E5MessageBox.critical(None, self.trUtf8("Start Debugger"), - self.trUtf8("""<p>The debugger backend could not be started.</p>""")) + self.trUtf8( + """<p>The debugger backend could not be started.</p>""")) return process, self.__isNetworked def getClientCapabilities(self): @@ -415,22 +428,24 @@ @param env environment settings (dictionary) """ - self.__sendCommand('{0}{1}\n'.format(DebugProtocol.RequestEnv, str(env))) + self.__sendCommand('{0}{1}\n'.format( + DebugProtocol.RequestEnv, str(env))) - def remoteLoad(self, fn, argv, wd, traceInterpreter=False, autoContinue=True, - autoFork=False, forkChild=False): + def remoteLoad(self, fn, argv, wd, traceInterpreter=False, + autoContinue=True, autoFork=False, forkChild=False): """ Public method to load a new program to debug. @param fn the filename to debug (string) @param argv the commandline arguments to pass to the program (string) @param wd the working directory for the program (string) - @keyparam traceInterpreter flag indicating if the interpreter library should be - traced as well (boolean) - @keyparam autoContinue flag indicating, that the debugger should not stop - at the first executable line (boolean) + @keyparam traceInterpreter flag indicating if the interpreter library + should be traced as well (boolean) + @keyparam autoContinue flag indicating, that the debugger should not + stop at the first executable line (boolean) @keyparam autoFork flag indicating the automatic fork mode (boolean) - @keyparam forkChild flag indicating to debug the child after forking (boolean) + @keyparam forkChild flag indicating to debug the child after forking + (boolean) """ self.__autoContinue = autoContinue self.__scriptName = os.path.abspath(fn) @@ -440,8 +455,9 @@ self.__sendCommand('{0}{1}\n'.format( DebugProtocol.RequestForkMode, repr((autoFork, forkChild)))) self.__sendCommand('{0}{1}|{2}|{3}|{4:d}\n'.format( - DebugProtocol.RequestLoad, wd, fn, str(Utilities.parseOptionString(argv)), - traceInterpreter)) + DebugProtocol.RequestLoad, wd, fn, + str(Utilities.parseOptionString(argv)), + traceInterpreter)) def remoteRun(self, fn, argv, wd, autoFork=False, forkChild=False): """ @@ -451,7 +467,8 @@ @param argv the commandline arguments to pass to the program (string) @param wd the working directory for the program (string) @keyparam autoFork flag indicating the automatic fork mode (boolean) - @keyparam forkChild flag indicating to debug the child after forking (boolean) + @keyparam forkChild flag indicating to debug the child after forking + (boolean) """ self.__scriptName = os.path.abspath(fn) @@ -460,7 +477,8 @@ self.__sendCommand('{0}{1}\n'.format( DebugProtocol.RequestForkMode, repr((autoFork, forkChild)))) self.__sendCommand('{0}{1}|{2}|{3}\n'.format( - DebugProtocol.RequestRun, wd, fn, str(Utilities.parseOptionString(argv)))) + DebugProtocol.RequestRun, wd, fn, + str(Utilities.parseOptionString(argv)))) def remoteCoverage(self, fn, argv, wd, erase=False): """ @@ -477,8 +495,9 @@ wd = self.translate(wd, False) fn = self.translate(os.path.abspath(fn), False) self.__sendCommand('{0}{1}@@{2}@@{3}@@{4:d}\n'.format( - DebugProtocol.RequestCoverage, wd, fn, str(Utilities.parseOptionString(argv)), - erase)) + DebugProtocol.RequestCoverage, wd, fn, + str(Utilities.parseOptionString(argv)), + erase)) def remoteProfile(self, fn, argv, wd, erase=False): """ @@ -487,7 +506,8 @@ @param fn the filename to run (string) @param argv the commandline arguments to pass to the program (string) @param wd the working directory for the program (string) - @keyparam erase flag indicating that timing info should be cleared first (boolean) + @keyparam erase flag indicating that timing info should be cleared + first (boolean) """ self.__scriptName = os.path.abspath(fn) @@ -537,7 +557,8 @@ @param special flag indicating a special continue operation """ - self.__sendCommand('{0}{1:d}\n'.format(DebugProtocol.RequestContinue, special)) + self.__sendCommand('{0}{1:d}\n'.format( + DebugProtocol.RequestContinue, special)) def remoteBreakpoint(self, fn, line, set, cond=None, temp=False): """ @@ -551,7 +572,7 @@ """ fn = self.translate(fn, False) self.__sendCommand('{0}{1}@@{2:d}@@{3:d}@@{4:d}@@{5}\n'.format( - DebugProtocol.RequestBreak, fn, line, temp, set, cond)) + DebugProtocol.RequestBreak, fn, line, temp, set, cond)) def remoteBreakpointEnable(self, fn, line, enable): """ @@ -559,7 +580,8 @@ @param fn filename the breakpoint belongs to (string) @param line linenumber of the breakpoint (int) - @param enable flag indicating enabling or disabling a breakpoint (boolean) + @param enable flag indicating enabling or disabling a breakpoint + (boolean) """ fn = self.translate(fn, False) self.__sendCommand('{0}{1},{2:d},{3:d}\n'.format( @@ -582,7 +604,8 @@ Public method to set or clear a watch expression. @param cond expression of the watch expression (string) - @param set flag indicating setting or resetting a watch expression (boolean) + @param set flag indicating setting or resetting a watch expression + (boolean) @param temp flag indicating a temporary watch expression (boolean) """ # cond is combination of cond and special (s. watch expression viewer) @@ -594,7 +617,8 @@ Public method to enable or disable a watch expression. @param cond expression of the watch expression (string) - @param enable flag indicating enabling or disabling a watch expression (boolean) + @param enable flag indicating enabling or disabling a watch expression + (boolean) """ # cond is combination of cond and special (s. watch expression viewer) self.__sendCommand('{0}{1},{2:d}\n'.format( @@ -602,7 +626,8 @@ def remoteWatchpointIgnore(self, cond, count): """ - Public method to ignore a watch expression the next couple of occurrences. + Public method to ignore a watch expression the next couple of + occurrences. @param cond expression of the watch expression (string) @param count number of occurrences to ignore (int) @@ -631,7 +656,8 @@ @param tid id of the thread (integer) """ - self.__sendCommand('{0}{1:d}\n'.format(DebugProtocol.RequestThreadSet, tid)) + self.__sendCommand('{0}{1:d}\n'.format( + DebugProtocol.RequestThreadSet, tid)) def remoteClientVariables(self, scope, filter, framenr=0): """ @@ -654,7 +680,8 @@ @param framenr framenumber of the variables to retrieve (int) """ self.__sendCommand('{0}{1}, {2:d}, {3:d}, {4}\n'.format( - DebugProtocol.RequestVariable, str(var), framenr, scope, str(filter))) + DebugProtocol.RequestVariable, str(var), framenr, scope, + str(filter))) def remoteClientSetFilter(self, scope, filter): """ @@ -676,11 +703,13 @@ cmd = "on" else: cmd = "off" - self.__sendCommand('{0}{1}\n'.format(DebugProtocol.RequestCallTrace, cmd)) + self.__sendCommand('{0}{1}\n'.format( + DebugProtocol.RequestCallTrace, cmd)) def remoteEval(self, arg): """ - Public method to evaluate arg in the current context of the debugged program. + Public method to evaluate arg in the current context of the debugged + program. @param arg the arguments to evaluate (string) """ @@ -688,7 +717,8 @@ def remoteExec(self, stmt): """ - Public method to execute stmt in the current context of the debugged program. + Public method to execute stmt in the current context of the debugged + program. @param stmt statement to execute (string) """ @@ -713,7 +743,8 @@ @param text the text to be completed (string) """ - self.__sendCommand("{0}{1}\n".format(DebugProtocol.RequestCompletion, text)) + self.__sendCommand("{0}{1}\n".format( + DebugProtocol.RequestCompletion, text)) def remoteUTPrepare(self, fn, tn, tfn, failed, cov, covname, coverase): """ @@ -723,11 +754,13 @@ @param tn the testname to load (string) @param tfn the test function name to load tests from (string) @param failed list of failed test, if only failed test should be run - (list of strings) - @param cov flag indicating collection of coverage data is requested (boolean) + (list of strings) + @param cov flag indicating collection of coverage data is requested + (boolean) @param covname filename to be used to assemble the coverage caches - filename (string) - @param coverase flag indicating erasure of coverage data is requested (boolean) + filename (string) + @param coverase flag indicating erasure of coverage data is requested + (boolean) """ self.__scriptName = os.path.abspath(fn) @@ -752,7 +785,8 @@ """ Private method to ask the user which branch of a fork to follow. """ - selections = [self.trUtf8("Parent Process"), self.trUtf8("Child process")] + selections = [self.trUtf8("Parent Process"), + self.trUtf8("Child process")] res, ok = QInputDialog.getItem( None, self.trUtf8("Client forking"), @@ -807,8 +841,9 @@ self.__autoContinue = False QTimer.singleShot(0, self.remoteContinue) else: - self.debugServer.signalClientLine(cf[0], int(cf[1]), - resp == DebugProtocol.ResponseStack) + self.debugServer.signalClientLine( + cf[0], int(cf[1]), + resp == DebugProtocol.ResponseStack) self.debugServer.signalClientStack(stack) continue @@ -824,7 +859,8 @@ if resp == DebugProtocol.ResponseThreadList: currentId, threadList = eval(line[eoc:-1]) - self.debugServer.signalClientThreadList(currentId, threadList) + self.debugServer.signalClientThreadList( + currentId, threadList) continue if resp == DebugProtocol.ResponseThreadSet: @@ -877,7 +913,8 @@ exctype = None excmessage = '' stack = [] - self.debugServer.signalClientException(exctype, excmessage, stack) + self.debugServer.signalClientException( + exctype, excmessage, stack) continue if resp == DebugProtocol.ResponseSyntax: @@ -894,7 +931,8 @@ cn = 0 if cn is None: cn = 0 - self.debugServer.signalClientSyntaxError(message, fn, ln, cn) + self.debugServer.signalClientSyntaxError( + message, fn, ln, cn) continue if resp == DebugProtocol.ResponseExit: @@ -913,7 +951,8 @@ fn, lineno = line[eoc:-1].split(',') lineno = int(lineno) fn = self.translate(fn, True) - self.debugServer.signalClientBreakConditionError(fn, lineno) + self.debugServer.signalClientBreakConditionError( + fn, lineno) continue if resp == DebugProtocol.ResponseClearWatch: @@ -933,7 +972,8 @@ if resp == DebugProtocol.ResponseBanner: version, platform, dbgclient = eval(line[eoc:-1]) - self.debugServer.signalClientBanner(version, platform, dbgclient) + self.debugServer.signalClientBanner( + version, platform, dbgclient) continue if resp == DebugProtocol.ResponseCapabilities: @@ -971,12 +1011,14 @@ if resp == DebugProtocol.ResponseUTTestFailed: testname, traceback, id = eval(line[eoc:-1]) - self.debugServer.clientUtTestFailed(testname, traceback, id) + self.debugServer.clientUtTestFailed( + testname, traceback, id) continue if resp == DebugProtocol.ResponseUTTestErrored: testname, traceback, id = eval(line[eoc:-1]) - self.debugServer.clientUtTestErrored(testname, traceback, id) + self.debugServer.clientUtTestErrored( + testname, traceback, id) continue if resp == DebugProtocol.ResponseUTTestSkipped: @@ -986,12 +1028,14 @@ if resp == DebugProtocol.ResponseUTTestFailedExpected: testname, traceback, id = eval(line[eoc:-1]) - self.debugServer.clientUtTestFailedExpected(testname, traceback, id) + self.debugServer.clientUtTestFailedExpected( + testname, traceback, id) continue if resp == DebugProtocol.ResponseUTTestSucceededUnexpected: testname, id = eval(line[eoc:-1]) - self.debugServer.clientUtTestSucceededUnexpected(testname, id) + self.debugServer.clientUtTestSucceededUnexpected( + testname, id) continue if resp == DebugProtocol.ResponseUTFinished: