--- a/Debugger/DebuggerInterfaceRuby.py Sun Jul 25 17:08:39 2010 +0200 +++ b/Debugger/DebuggerInterfaceRuby.py Mon Jul 26 15:45:23 2010 +0200 @@ -116,7 +116,7 @@ if environment is not None: env = [] for key, value in list(environment.items()): - env.append("%s=%s" % (key, value)) + env.append("{0}={1}".format(key, value)) proc.setEnvironment(env) args = [] for arg in arguments: @@ -364,7 +364,7 @@ self.disconnect(self.qsock, SIGNAL('readyRead()'), self.__parseClientLine) # close down socket, and shut down client as well. - self.__sendCommand('%s\n' % RequestShutdown) + self.__sendCommand('{0}\n'.format(RequestShutdown)) self.qsock.flush() self.qsock.close() @@ -387,7 +387,7 @@ @param env environment settings (dictionary) """ - self.__sendCommand('%s%s\n' % (RequestEnv, str(env))) + self.__sendCommand('{0}{1}\n'.format(RequestEnv, str(env))) def remoteLoad(self, fn, argv, wd, traceInterpreter = False, autoContinue = True, autoFork = False, forkChild = False): @@ -409,8 +409,8 @@ wd = self.translate(wd, False) fn = self.translate(os.path.abspath(fn), False) - self.__sendCommand('%s%s|%s|%s|%d\n' % \ - (RequestLoad, wd, fn, str(Utilities.parseOptionString(argv)), + self.__sendCommand('{0}{1}|{2}|{3}|{4:d}\n'.format( + RequestLoad, wd, fn, str(Utilities.parseOptionString(argv)), traceInterpreter)) def remoteRun(self, fn, argv, wd, autoFork = False, forkChild = False): @@ -426,8 +426,8 @@ """ wd = self.translate(wd, False) fn = self.translate(os.path.abspath(fn), False) - self.__sendCommand('%s%s|%s|%s\n' % \ - (RequestRun, wd, fn, str(Utilities.parseOptionString(argv)))) + self.__sendCommand('{0}{1}|{2}|{3}\n'.format( + RequestRun, wd, fn, str(Utilities.parseOptionString(argv)))) def remoteCoverage(self, fn, argv, wd, erase = False): """ @@ -459,7 +459,7 @@ @param stmt the Ruby statement to execute (string). It should not have a trailing newline. """ - self.__sendCommand('%s\n' % stmt) + self.__sendCommand('{0}\n'.format(stmt)) self.__sendCommand(RequestOK + '\n') def remoteStep(self): @@ -492,7 +492,7 @@ @param special flag indicating a special continue operation (boolean) """ - self.__sendCommand('%s%d\n' % (RequestContinue, special)) + self.__sendCommand('{0}{1:d}\n'.format(RequestContinue, special)) def remoteBreakpoint(self, fn, line, set, cond = None, temp = False): """ @@ -505,8 +505,8 @@ @param temp flag indicating a temporary breakpoint (boolean) """ fn = self.translate(fn, False) - self.__sendCommand('%s%s@@%d@@%d@@%d@@%s\n' % \ - (RequestBreak, fn, line, temp, set, cond)) + self.__sendCommand('{0}{1}@@{2:d}@@{3:d}@@{4:d}@@{5}\n'.format( + RequestBreak, fn, line, temp, set, cond)) def remoteBreakpointEnable(self, fn, line, enable): """ @@ -517,7 +517,8 @@ @param enable flag indicating enabling or disabling a breakpoint (boolean) """ fn = self.translate(fn, False) - self.__sendCommand('%s%s,%d,%d\n' % (RequestBreakEnable, fn, line, enable)) + self.__sendCommand('{0}{1},{2:d},{3:d}\n'.format( + RequestBreakEnable, fn, line, enable)) def remoteBreakpointIgnore(self, fn, line, count): """ @@ -528,7 +529,8 @@ @param count number of occurrences to ignore (int) """ fn = self.translate(fn, False) - self.__sendCommand('%s%s,%d,%d\n' % (RequestBreakIgnore, fn, line, count)) + self.__sendCommand('{0}{1},{2:d},{3:d}\n'.format( + RequestBreakIgnore, fn, line, count)) def remoteWatchpoint(self, cond, set, temp = False): """ @@ -539,7 +541,7 @@ @param temp flag indicating a temporary watch expression (boolean) """ # cond is combination of cond and special (s. watch expression viewer) - self.__sendCommand('%s%s@@%d@@%d\n' % (RequestWatch, cond, temp, set)) + self.__sendCommand('{0}{1}@@{2:d}@@{3:d}\n'.format(RequestWatch, cond, temp, set)) def remoteWatchpointEnable(self, cond, enable): """ @@ -549,7 +551,7 @@ @param enable flag indicating enabling or disabling a watch expression (boolean) """ # cond is combination of cond and special (s. watch expression viewer) - self.__sendCommand('%s%s,%d\n' % (RequestWatchEnable, cond, enable)) + self.__sendCommand('{0}{1},{2:d}\n'.format(RequestWatchEnable, cond, enable)) def remoteWatchpointIgnore(self, cond, count): """ @@ -559,7 +561,7 @@ @param count number of occurrences to ignore (int) """ # cond is combination of cond and special (s. watch expression viewer) - self.__sendCommand('%s%s,%d\n' % (RequestWatchIgnore, cond, count)) + self.__sendCommand('{0}{1},{2:d}\n'.format(RequestWatchIgnore, cond, count)) def remoteRawInput(self,s): """ @@ -591,8 +593,8 @@ @param filter list of variable types to filter out (list of int) @param framenr framenumber of the variables to retrieve (int) """ - self.__sendCommand('%s%d, %d, %s\n' % \ - (RequestVariables, framenr, scope, str(filter))) + self.__sendCommand('{0}{1:d}, {2:d}, {3}\n'.format( + RequestVariables, framenr, scope, str(filter))) def remoteClientVariable(self, scope, filter, var, framenr = 0): """ @@ -603,8 +605,8 @@ @param var list encoded name of variable to retrieve (string) @param framenr framenumber of the variables to retrieve (int) """ - self.__sendCommand('%s%s, %d, %d, %s\n' % \ - (RequestVariable, str(var), framenr, scope, str(filter))) + self.__sendCommand('{0}{1}, {2:d}, {3:d}, {4}\n'.format( + RequestVariable, str(var), framenr, scope, str(filter))) def remoteClientSetFilter(self, scope, filter): """ @@ -613,7 +615,7 @@ @param scope the scope of the variables (0 = local, 1 = global) @param filter regexp string for variable names to filter out (string) """ - self.__sendCommand('%s%d, "%s"\n' % (RequestSetFilter, scope, filter)) + self.__sendCommand('{0}{1:d}, "{2}"\n'.format(RequestSetFilter, scope, filter)) def remoteEval(self, arg): """ @@ -621,7 +623,7 @@ @param arg the arguments to evaluate (string) """ - self.__sendCommand('%s%s\n' % (RequestEval, arg)) + self.__sendCommand('{0}{1}\n'.format(RequestEval, arg)) def remoteExec(self, stmt): """ @@ -629,7 +631,7 @@ @param stmt statement to execute (string) """ - self.__sendCommand('%s%s\n' % (RequestExec, stmt)) + self.__sendCommand('{0}{1}\n'.format(RequestExec, stmt)) def remoteBanner(self): """ @@ -650,7 +652,7 @@ @param text the text to be completed (string) """ - self.__sendCommand("%s%s\n" % (RequestCompletion, text)) + self.__sendCommand("{0}{1}\n".format(RequestCompletion, text)) def remoteUTPrepare(self, fn, tn, tfn, cov, covname, coverase): """