Debugger/DebuggerInterfacePython.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3357
2390df6f42ba
child 3640
2bf828881e86
--- a/Debugger/DebuggerInterfacePython.py	Sun Mar 30 22:00:14 2014 +0200
+++ b/Debugger/DebuggerInterfacePython.py	Thu Apr 03 23:05:31 2014 +0200
@@ -152,17 +152,18 @@
         @param port portnumber the debug server is listening on (integer)
         @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)
+        @return client process object (QProcess), a flag to indicate
+            a network connection (boolean) and the name of the interpreter
+            in case of a local execution (string)
         """
         interpreter = Preferences.getDebugger("PythonInterpreter")
         if interpreter == "":
             E5MessageBox.critical(
                 None,
-                self.trUtf8("Start Debugger"),
-                self.trUtf8(
+                self.tr("Start Debugger"),
+                self.tr(
                     """<p>No Python2 interpreter configured.</p>"""))
-            return None, False
+            return None, False, ""
         
         debugClientType = Preferences.getDebugger("DebugClientType")
         if debugClientType == "standard":
@@ -199,8 +200,8 @@
                 if process is None:
                     E5MessageBox.critical(
                         None,
-                        self.trUtf8("Start Debugger"),
-                        self.trUtf8(
+                        self.tr("Start Debugger"),
+                        self.tr(
                             """<p>The debugger backend could not be"""
                             """ started.</p>"""))
                 
@@ -213,7 +214,7 @@
                     self.translate = self.__remoteTranslation
                 else:
                     self.translate = self.__identityTranslation
-                return process, self.__isNetworked
+                return process, self.__isNetworked, ""
         
         # set translation function
         self.translate = self.__identityTranslation
@@ -246,11 +247,11 @@
                 if process is None:
                     E5MessageBox.critical(
                         None,
-                        self.trUtf8("Start Debugger"),
-                        self.trUtf8(
+                        self.tr("Start Debugger"),
+                        self.tr(
                             """<p>The debugger backend could not be"""
                             """ started.</p>"""))
-                return process, self.__isNetworked
+                return process, self.__isNetworked, interpreter
         
         process = self.__startProcess(
             interpreter,
@@ -259,10 +260,10 @@
         if process is None:
             E5MessageBox.critical(
                 None,
-                self.trUtf8("Start Debugger"),
-                self.trUtf8(
+                self.tr("Start Debugger"),
+                self.tr(
                     """<p>The debugger backend could not be started.</p>"""))
-        return process, self.__isNetworked
+        return process, self.__isNetworked, interpreter
 
     def startRemoteForProject(self, port, runInConsole):
         """
@@ -271,12 +272,13 @@
         @param port portnumber the debug server is listening on (integer)
         @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)
+        @return client process object (QProcess), a flag to indicate
+            a network connection (boolean) and the name of the interpreter
+            in case of a local execution (string)
         """
         project = e5App().getObject("Project")
         if not project.isDebugPropertiesLoaded():
-            return None, self.__isNetworked
+            return None, self.__isNetworked, ""
         
         # start debugger with project specific settings
         interpreter = project.getDebugProperty("INTERPRETER")
@@ -301,8 +303,8 @@
                 if process is None:
                     E5MessageBox.critical(
                         None,
-                        self.trUtf8("Start Debugger"),
-                        self.trUtf8(
+                        self.tr("Start Debugger"),
+                        self.tr(
                             """<p>The debugger backend could not be"""
                             """ started.</p>"""))
                 # set translation function
@@ -314,7 +316,7 @@
                     self.translate = self.__remoteTranslation
                 else:
                     self.translate = self.__identityTranslation
-                return process, self.__isNetworked
+                return process, self.__isNetworked, ""
         
         # set translation function
         self.translate = self.__identityTranslation
@@ -348,11 +350,11 @@
                 if process is None:
                     E5MessageBox.critical(
                         None,
-                        self.trUtf8("Start Debugger"),
-                        self.trUtf8(
+                        self.tr("Start Debugger"),
+                        self.tr(
                             """<p>The debugger backend could not be"""
                             """ started.</p>"""))
-                return process, self.__isNetworked
+                return process, self.__isNetworked, interpreter
         
         process = self.__startProcess(
             interpreter,
@@ -361,10 +363,10 @@
         if process is None:
             E5MessageBox.critical(
                 None,
-                self.trUtf8("Start Debugger"),
-                self.trUtf8(
+                self.tr("Start Debugger"),
+                self.tr(
                     """<p>The debugger backend could not be started.</p>"""))
-        return process, self.__isNetworked
+        return process, self.__isNetworked, interpreter
 
     def getClientCapabilities(self):
         """
@@ -386,8 +388,8 @@
         if self.qsock is not None:
             return False
         
-        sock.disconnected[()].connect(self.debugServer.startClient)
-        sock.readyRead[()].connect(self.__parseClientLine)
+        sock.disconnected.connect(self.debugServer.startClient)
+        sock.readyRead.connect(self.__parseClientLine)
         
         self.qsock = sock
         
@@ -417,7 +419,7 @@
         
         # do not want any slots called during shutdown
         self.qsock.disconnected.disconnect(self.debugServer.startClient)
-        self.qsock.readyRead[()].disconnect(self.__parseClientLine)
+        self.qsock.readyRead.disconnect(self.__parseClientLine)
         
         # close down socket, and shut down client as well.
         self.__sendCommand('{0}\n'.format(DebugProtocol.RequestShutdown))
@@ -800,12 +802,12 @@
         """
         Private method to ask the user which branch of a fork to follow.
         """
-        selections = [self.trUtf8("Parent Process"),
-                      self.trUtf8("Child process")]
+        selections = [self.tr("Parent Process"),
+                      self.tr("Child process")]
         res, ok = QInputDialog.getItem(
             None,
-            self.trUtf8("Client forking"),
-            self.trUtf8("Select the fork branch to follow."),
+            self.tr("Client forking"),
+            self.tr("Select the fork branch to follow."),
             selections,
             0, False)
         if not ok or res == selections[0]:

eric ide

mercurial