Debugger/DebuggerInterfacePython.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1079
f05ca3490bd1
diff -r 1b59c4ba121e -r 8cd4d08fa9f6 Debugger/DebuggerInterfacePython.py
--- a/Debugger/DebuggerInterfacePython.py	Fri Mar 11 08:55:14 2011 +0100
+++ b/Debugger/DebuggerInterfacePython.py	Fri Mar 11 16:51:57 2011 +0100
@@ -28,11 +28,12 @@
 
 ClientDefaultCapabilities = DebugClientCapabilities.HasAll
     
+
 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)
     """
     exts = []
@@ -47,6 +48,7 @@
     else:
         return ["", 0, []]
 
+
 class DebuggerInterfacePython(QObject):
     """
     Class implementing the Python debugger interface for the debug server.
@@ -87,7 +89,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.
         
@@ -98,7 +100,7 @@
         """
         return fn
         
-    def __remoteTranslation(self, fn, remote2local = True):
+    def __remoteTranslation(self, fn, remote2local=True):
         """
         Private method to perform the path translation.
         
@@ -112,7 +114,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.
         
@@ -141,7 +143,7 @@
         Public method to start a remote Python 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)
@@ -156,7 +158,7 @@
         
         debugClientType = Preferences.getDebugger("DebugClientType")
         if debugClientType == "standard":
-            debugClient = os.path.join(getConfig('ericDir'), 
+            debugClient = os.path.join(getConfig('ericDir'),
                                        "DebugClients", "Python", "DebugClient.py")
         elif debugClientType == "threaded":
             debugClient = os.path.join(getConfig('ericDir'),
@@ -235,8 +237,8 @@
                             """<p>The debugger backend could not be started.</p>"""))
                 return process, self.__isNetworked
         
-        process = self.__startProcess(interpreter, 
-            [debugClient, noencoding, str(port), redirect, ipaddr], 
+        process = self.__startProcess(interpreter,
+            [debugClient, noencoding, str(port), redirect, ipaddr],
             clientEnv)
         if process is None:
             E5MessageBox.critical(None,
@@ -249,7 +251,7 @@
         Public method to start a remote Python 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 client process object (QProcess) and a flag to indicate
             a network connection (boolean)
@@ -328,8 +330,8 @@
                             """<p>The debugger backend could not be started.</p>"""))
                 return process, self.__isNetworked
         
-        process = self.__startProcess(interpreter, 
-            [debugClient, noencoding, str(port), redirect, ipaddr], 
+        process = self.__startProcess(interpreter,
+            [debugClient, noencoding, str(port), redirect, ipaddr],
             clientEnv)
         if process is None:
             E5MessageBox.critical(None,
@@ -416,8 +418,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.
         
@@ -440,7 +442,7 @@
             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.
         
@@ -456,14 +458,14 @@
         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)
         """
         wd = self.translate(wd, False)
@@ -472,7 +474,7 @@
             RequestCoverage, wd, fn, str(Utilities.parseOptionString(argv)),
              erase))
 
-    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.
         
@@ -488,7 +490,7 @@
 
     def remoteStatement(self, stmt):
         """
-        Public method to execute a Python statement.  
+        Public method to execute a Python statement.
         
         @param stmt the Python statement to execute (string). It
               should not have a trailing newline.
@@ -520,7 +522,7 @@
         """
         self.__sendCommand(RequestStepQuit + '\n')
 
-    def remoteContinue(self, special = False):
+    def remoteContinue(self, special=False):
         """
         Public method to continue the debugged program.
         
@@ -528,7 +530,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.
         
@@ -566,7 +568,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.
         
@@ -597,7 +599,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.
         
@@ -619,7 +621,7 @@
         """
         self.__sendCommand('{0}{1:d}\n'.format(RequestThreadSet, tid))
         
-    def remoteClientVariables(self, scope, filter, framenr = 0):
+    def remoteClientVariables(self, scope, filter, framenr=0):
         """
         Public method to request the variables of the debugged program.
         
@@ -630,7 +632,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.
         
@@ -775,7 +777,7 @@
                         self.__autoContinue = False
                         QTimer.singleShot(0, self.remoteContinue)
                     else:
-                        self.debugServer.signalClientLine(cf[0], int(cf[1]), 
+                        self.debugServer.signalClientLine(cf[0], int(cf[1]),
                                                     resp == ResponseStack)
                         self.debugServer.signalClientStack(stack)
                     continue

eric ide

mercurial