--- a/Debugger/DebuggerInterfaceRuby.py Fri Mar 11 08:55:14 2011 +0100 +++ b/Debugger/DebuggerInterfaceRuby.py Fri Mar 11 16:51:57 2011 +0100 @@ -31,15 +31,17 @@ ClientTypeAssociations = [".rb"] + def getRegistryData(): """ Module function to get characterising data for the debugger interface. - @return list of the following data. Client type (string), client + @return list of the following data. Client type (string), client capabilities (integer), client type association (list of strings) """ return ["Ruby", ClientDefaultCapabilities, ClientTypeAssociations] + class DebuggerInterfaceRuby(QObject): """ Class implementing the Ruby debugger interface for the debug server. @@ -78,7 +80,7 @@ else: self.translate = self.__identityTranslation - def __identityTranslation(self, fn, remote2local = True): + def __identityTranslation(self, fn, remote2local=True): """ Private method to perform the identity path translation. @@ -89,7 +91,7 @@ """ return fn - def __remoteTranslation(self, fn, remote2local = True): + def __remoteTranslation(self, fn, remote2local=True): """ Private method to perform the path translation. @@ -103,7 +105,7 @@ else: return fn.replace(self.translateLocal, self.translateRemote) - def __startProcess(self, program, arguments, environment = None): + def __startProcess(self, program, arguments, environment=None): """ Private method to start the debugger client process. @@ -132,7 +134,7 @@ Public method to start a remote Ruby interpreter. @param port portnumber the debug server is listening on (integer) - @param runInConsole flag indicating to start the debugger in a + @param runInConsole flag indicating to start the debugger in a console window (boolean) @return client process object (QProcess) and a flag to indicate a network connection (boolean) @@ -140,7 +142,7 @@ interpreter = Preferences.getDebugger("RubyInterpreter") if interpreter == "": interpreter = "/usr/bin/ruby" - debugClient = os.path.join(getConfig('ericDir'), + debugClient = os.path.join(getConfig('ericDir'), "DebugClients", "Ruby", "DebugClient.rb") redirect = str(Preferences.getDebugger("RubyRedirect")) @@ -209,8 +211,8 @@ """<p>The debugger backend could not be started.</p>""")) return process, self.__isNetworked - process = self.__startProcess(interpreter, - [debugClient, str(port), redirect, ipaddr], + process = self.__startProcess(interpreter, + [debugClient, str(port), redirect, ipaddr], clientEnv) if process is None: E5MessageBox.critical(None, @@ -223,7 +225,7 @@ Public method to start a remote Ruby interpreter for a project. @param port portnumber the debug server is listening on (integer) - @param runInConsole flag indicating to start the debugger in a + @param runInConsole flag indicating to start the debugger in a console window (boolean) @return pid of the client process (integer) and a flag to indicate a network connection (boolean) @@ -300,8 +302,8 @@ """<p>The debugger backend could not be started.</p>""")) return process, self.__isNetworked - process = self.__startProcess(interpreter, - [debugClient, str(port), redirect, ipaddr], + process = self.__startProcess(interpreter, + [debugClient, str(port), redirect, ipaddr], clientEnv) if process is None: E5MessageBox.critical(None, @@ -388,8 +390,8 @@ """ self.__sendCommand('{0}{1}\n'.format(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. @@ -401,7 +403,7 @@ @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) (ignored) - @keyparam forkChild flag indicating to debug the child after forking + @keyparam forkChild flag indicating to debug the child after forking (boolean) (ignored) """ self.__autoContinue = autoContinue @@ -409,10 +411,10 @@ wd = self.translate(wd, False) fn = self.translate(os.path.abspath(fn), False) self.__sendCommand('{0}{1}|{2}|{3}|{4:d}\n'.format( - RequestLoad, wd, fn, str(Utilities.parseOptionString(argv)), + RequestLoad, wd, fn, str(Utilities.parseOptionString(argv)), traceInterpreter)) - def remoteRun(self, fn, argv, wd, autoFork = False, forkChild = False): + def remoteRun(self, fn, argv, wd, autoFork=False, forkChild=False): """ Public method to load a new program to run. @@ -420,7 +422,7 @@ @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) (ignored) - @keyparam forkChild flag indicating to debug the child after forking + @keyparam forkChild flag indicating to debug the child after forking (boolean) (ignored) """ wd = self.translate(wd, False) @@ -428,19 +430,19 @@ self.__sendCommand('{0}{1}|{2}|{3}\n'.format( RequestRun, wd, fn, str(Utilities.parseOptionString(argv)))) - def remoteCoverage(self, fn, argv, wd, erase = False): + def remoteCoverage(self, fn, argv, wd, erase=False): """ Public method to load a new program to collect coverage data. @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 coverage info should be + @keyparam erase flag indicating that coverage info should be cleared first (boolean) """ raise NotImplementedError("Interface not available.") - def remoteProfile(self, fn, argv, wd, erase = False): + def remoteProfile(self, fn, argv, wd, erase=False): """ Public method to load a new program to collect profiling data. @@ -453,7 +455,7 @@ def remoteStatement(self, stmt): """ - Public method to execute a Ruby statement. + Public method to execute a Ruby statement. @param stmt the Ruby statement to execute (string). It should not have a trailing newline. @@ -485,7 +487,7 @@ """ self.__sendCommand(RequestStepQuit + '\n') - def remoteContinue(self, special = False): + def remoteContinue(self, special=False): """ Public method to continue the debugged program. @@ -493,7 +495,7 @@ """ self.__sendCommand('{0}{1:d}\n'.format(RequestContinue, special)) - def remoteBreakpoint(self, fn, line, set, cond = None, temp = False): + def remoteBreakpoint(self, fn, line, set, cond=None, temp=False): """ Public method to set or clear a breakpoint. @@ -531,7 +533,7 @@ self.__sendCommand('{0}{1},{2:d},{3:d}\n'.format( RequestBreakIgnore, fn, line, count)) - def remoteWatchpoint(self, cond, set, temp = False): + def remoteWatchpoint(self, cond, set, temp=False): """ Public method to set or clear a watch expression. @@ -562,7 +564,7 @@ # cond is combination of cond and special (s. watch expression viewer) self.__sendCommand('{0}{1},{2:d}\n'.format(RequestWatchIgnore, cond, count)) - def remoteRawInput(self,s): + def remoteRawInput(self, s): """ Public method to send the raw input to the debugged program. @@ -584,7 +586,7 @@ """ return - def remoteClientVariables(self, scope, filter, framenr = 0): + def remoteClientVariables(self, scope, filter, framenr=0): """ Public method to request the variables of the debugged program. @@ -595,7 +597,7 @@ self.__sendCommand('{0}{1:d}, {2:d}, {3}\n'.format( RequestVariables, framenr, scope, str(filter))) - def remoteClientVariable(self, scope, filter, var, framenr = 0): + def remoteClientVariable(self, scope, filter, var, framenr=0): """ Public method to request the variables of the debugged program. @@ -834,4 +836,4 @@ if self.qsock is not None: self.qsock.write(cmd.encode('utf8')) else: - self.queue.append(cmd) \ No newline at end of file + self.queue.append(cmd)