Debugger/DebuggerInterfacePython.py

changeset 12
1d8dd9706f46
parent 0
de9c2efb9d02
child 13
1af94a91f439
diff -r b0996e4a289e -r 1d8dd9706f46 Debugger/DebuggerInterfacePython.py
--- a/Debugger/DebuggerInterfacePython.py	Fri Jan 01 16:11:36 2010 +0000
+++ b/Debugger/DebuggerInterfacePython.py	Sat Jan 02 15:11:35 2010 +0000
@@ -17,8 +17,8 @@
 
 from E4Gui.E4Application import e4App
 
-from DebugProtocol import *
-import DebugClientCapabilities
+from .DebugProtocol import *
+from . import DebugClientCapabilities
 
 import Preferences
 import Utilities
@@ -122,7 +122,7 @@
         proc = QProcess()
         if environment is not None:
             env = []
-            for key, value in environment.items():
+            for key, value in list(environment.items()):
                 env.append("%s=%s" % (key, value))
             proc.setEnvironment(env)
         args = []
@@ -412,7 +412,7 @@
         
         @param env environment settings (dictionary)
         """
-        self.__sendCommand('%s%s\n' % (RequestEnv, unicode(env)))
+        self.__sendCommand('%s%s\n' % (RequestEnv, str(env)))
         
     def remoteLoad(self, fn, argv, wd, traceInterpreter = False, autoContinue = True, 
                    autoFork = False, forkChild = False):
@@ -435,7 +435,7 @@
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('%s%s\n' % (RequestForkMode, repr((autoFork, forkChild))))
         self.__sendCommand('%s%s|%s|%s|%d\n' % \
-            (RequestLoad, wd, fn, unicode(Utilities.parseOptionString(argv)),
+            (RequestLoad, wd, fn, str(Utilities.parseOptionString(argv)),
              traceInterpreter))
         
     def remoteRun(self, fn, argv, wd):
@@ -449,7 +449,7 @@
         wd = self.translate(wd, False)
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('%s%s|%s|%s\n' % \
-            (RequestRun, wd, fn, unicode(Utilities.parseOptionString(argv))))
+            (RequestRun, wd, fn, str(Utilities.parseOptionString(argv))))
         
     def remoteCoverage(self, fn, argv, wd, erase = False):
         """
@@ -464,7 +464,7 @@
         wd = self.translate(wd, False)
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('%s%s@@%s@@%s@@%d\n' % \
-            (RequestCoverage, wd, fn, unicode(Utilities.parseOptionString(argv)),
+            (RequestCoverage, wd, fn, str(Utilities.parseOptionString(argv)),
              erase))
 
     def remoteProfile(self, fn, argv, wd, erase = False):
@@ -479,7 +479,7 @@
         wd = self.translate(wd, False)
         fn = self.translate(os.path.abspath(fn), False)
         self.__sendCommand('%s%s|%s|%s|%d\n' % \
-            (RequestProfile, wd, fn, unicode(Utilities.parseOptionString(argv)), erase))
+            (RequestProfile, wd, fn, str(Utilities.parseOptionString(argv)), erase))
 
     def remoteStatement(self, stmt):
         """
@@ -621,7 +621,7 @@
         @param framenr framenumber of the variables to retrieve (int)
         """
         self.__sendCommand('%s%d, %d, %s\n' % \
-            (RequestVariables, framenr, scope, unicode(filter)))
+            (RequestVariables, framenr, scope, str(filter)))
         
     def remoteClientVariable(self, scope, filter, var, framenr = 0):
         """
@@ -633,7 +633,7 @@
         @param framenr framenumber of the variables to retrieve (int)
         """
         self.__sendCommand('%s%s, %d, %d, %s\n' % \
-            (RequestVariable, unicode(var), framenr, scope, str(filter)))
+            (RequestVariable, str(var), framenr, scope, str(filter)))
         
     def remoteClientSetFilter(self, scope, filter):
         """
@@ -732,16 +732,15 @@
         while self.qsock and self.qsock.canReadLine():
             qs = self.qsock.readLine()
             if self.codec is not None:
-                us = self.codec.fromUnicode(unicode(qs))
+                line = self.codec.toUnicode(qs)
             else:
-                us = qs
-            line = str(us)
+                line = bytes(qs).decode()
             if line.endswith(EOT):
                 line = line[:-len(EOT)]
                 if not line:
                     continue
             
-##            print "Server: ", line          ##debug
+##            print("Server: ", line)          ##debug
             
             eoc = line.find('<') + 1
             

eric ide

mercurial