Sat, 19 Oct 2013 11:49:31 +0200
Fixed various coding style issues.
--- a/Cooperation/ChatWidget.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Cooperation/ChatWidget.py Sat Oct 19 11:49:31 2013 +0200 @@ -587,7 +587,7 @@ self.trUtf8("""<p>The chat contents could not be""" """ written to <b>{0}</b></p>""" """<p>Reason: {1}</p>""") .format( - fname, str(err))) + fname, str(err))) def __copyChat(self): """
--- a/DataViews/PyCoverageDialog.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DataViews/PyCoverageDialog.py Sat Oct 19 11:49:31 2013 +0200 @@ -195,7 +195,7 @@ try: statements, excluded, missing, readable = \ cover.analysis2(file)[1:] - readableEx = (excluded and self.__format_lines(excluded) + readableEx = (excluded and self.__format_lines(excluded) or '') n = len(statements) m = n - len(missing)
--- a/DebugClients/Python/AsyncFile.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python/AsyncFile.py Sat Oct 19 11:49:31 2013 +0200 @@ -276,7 +276,7 @@ if not self.wpending: self.wpending = s elif type(self.wpending) != type(s) or \ - len(self.wpending) + len(s) > self.maxbuffersize: + len(self.wpending) + len(s) > self.maxbuffersize: # flush wpending so that different string types are not # concatenated while self.wpending:
--- a/DebugClients/Python/DebugBase.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python/DebugBase.py Sat Oct 19 11:49:31 2013 +0200 @@ -740,7 +740,7 @@ """ # The program has finished if we have just left the first frame. if frame == self._dbgClient.mainFrame and \ - self._mainThread: + self._mainThread: atexit._run_exitfuncs() self._dbgClient.progTerminated(retval) elif frame is not self.stepFrame: @@ -783,7 +783,7 @@ #XXX - think of a better way to do this. It's only a convience for #debugging the debugger - when the debugger code is in the current #directory. - if os.path.basename(fn) in [\ + if os.path.basename(fn) in [ 'AsyncFile.py', 'AsyncIO.py', 'DebugConfig.py', 'DCTestResult.py', 'DebugBase.py', 'DebugClientBase.py',
--- a/DebugClients/Python/DebugClientBase.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python/DebugClientBase.py Sat Oct 19 11:49:31 2013 +0200 @@ -673,9 +673,9 @@ compile(cond, '<string>', 'eval') except SyntaxError: self.write( - '%s%s,%d\n' % \ - (DebugProtocol.ResponseBPConditionError, - fn, line)) + '%s%s,%d\n' % + (DebugProtocol.ResponseBPConditionError, + fn, line)) return self.mainThread.set_break(fn, line, temporary, cond) else: @@ -852,13 +852,13 @@ try: if failed: self.test = unittest.defaultTestLoader\ - .loadTestsFromNames(failed, utModule) + .loadTestsFromNames(failed, utModule) else: self.test = unittest.defaultTestLoader\ - .loadTestsFromName(tfn, utModule) + .loadTestsFromName(tfn, utModule) except AttributeError: self.test = unittest.defaultTestLoader\ - .loadTestsFromModule(utModule) + .loadTestsFromModule(utModule) except: exc_type, exc_value, exc_tb = sys.exc_info() self.write( @@ -1011,7 +1011,7 @@ pass return self.clientCapabilities except ImportError: - return (self.clientCapabilities & + return (self.clientCapabilities & ~DebugClientCapabilities.HasProfiler) def write(self, s): @@ -1490,7 +1490,7 @@ if qtVariable: vlist = self.__formatQt4Variable(qvar, qvtype) elif ("sipThis" in dict.keys() and len(dict) == 1) or \ - (len(dict) == 0 and len(udict) > 0): + (len(dict) == 0 and len(udict) > 0): if access: exec 'qvar = udict%s' % access # this has to be in line with VariablesViewer.indicators @@ -1643,7 +1643,7 @@ varlist.append( ("internalId", "int", "%s" % value.internalId())) varlist.append( - ("internalPointer", "void *", "%s" % \ + ("internalPointer", "void *", "%s" % value.internalPointer())) elif qttype == 'QRegExp': varlist.append(("pattern", "str", "%s" % value.pattern())) @@ -1761,7 +1761,7 @@ if ConfigVarTypeStrings.index('class') in filter: continue elif not valtype.startswith("PySide") and \ - ConfigVarTypeStrings.index('other') in filter: + ConfigVarTypeStrings.index('other') in filter: continue try:
--- a/DebugClients/Python/DebugClientCapabilities.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python/DebugClientCapabilities.py Sat Oct 19 11:49:31 2013 +0200 @@ -16,7 +16,7 @@ HasShell = 0x0040 HasAll = HasDebugger | HasInterpreter | HasProfiler | \ - HasCoverage | HasCompleter | HasUnittest | HasShell + HasCoverage | HasCompleter | HasUnittest | HasShell # # eflag: FileType = Python2
--- a/DebugClients/Python/DebugConfig.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python/DebugConfig.py Sat Oct 19 11:49:31 2013 +0200 @@ -8,13 +8,13 @@ """ ConfigVarTypeStrings = [ - '__', 'NoneType', 'type',\ - 'bool', 'int', 'long', 'float', 'complex',\ - 'str', 'unicode', 'tuple', 'list',\ - 'dict', 'dict-proxy', 'set', 'file', 'xrange',\ - 'slice', 'buffer', 'class', 'instance',\ - 'instance method', 'property', 'generator',\ - 'function', 'builtin_function_or_method', 'code', 'module',\ + '__', 'NoneType', 'type', + 'bool', 'int', 'long', 'float', 'complex', + 'str', 'unicode', 'tuple', 'list', + 'dict', 'dict-proxy', 'set', 'file', 'xrange', + 'slice', 'buffer', 'class', 'instance', + 'instance method', 'property', 'generator', + 'function', 'builtin_function_or_method', 'code', 'module', 'ellipsis', 'traceback', 'frame', 'other' ]
--- a/DebugClients/Python/FlexCompleter.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python/FlexCompleter.py Sat Oct 19 11:49:31 2013 +0200 @@ -126,7 +126,7 @@ @param namespace namespace for the completer @exception TypeError raised to indicate a wrong namespace structure """ - if namespace and type(namespace) != type({}): + if namespace and isinstance(namespace, dict): raise TypeError('namespace must be a dictionary') # Don't bind to namespace quite yet, but flag whether the user wants a
--- a/DebugClients/Python/PyProfile.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python/PyProfile.py Sat Oct 19 11:49:31 2013 +0200 @@ -115,7 +115,7 @@ """ # get module name from __file__ if not isinstance(frame, profile.Profile.fake_frame) and \ - '__file__' in frame.f_globals: + '__file__' in frame.f_globals: root, ext = os.path.splitext(frame.f_globals['__file__']) if ext == '.pyc' or ext == '.py': fixedName = root + '.py' @@ -142,7 +142,7 @@ rframe, rframe.f_back, frame, frame.f_back) self.trace_dispatch_return(rframe, 0) - assert (self.cur is None or \ + assert (self.cur is None or frame.f_back is self.cur[-2]), ("Bad call", self.cur[-3]) fcode = frame.f_code @@ -165,7 +165,7 @@ "c_exception": profile.Profile.trace_dispatch_return, # the C function returned "c_return": profile.Profile.trace_dispatch_return, - } + } # # eflag: FileType = Python2
--- a/DebugClients/Python3/DebugBase.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python3/DebugBase.py Sat Oct 19 11:49:31 2013 +0200 @@ -763,7 +763,7 @@ """ # The program has finished if we have just left the first frame. if frame == self._dbgClient.mainFrame and \ - self._mainThread: + self._mainThread: atexit._run_exitfuncs() self._dbgClient.progTerminated(retval) elif frame is not self.stepFrame: @@ -807,7 +807,7 @@ #XXX - think of a better way to do this. It's only a convience for #debugging the debugger - when the debugger code is in the current #directory. - if os.path.basename(fn) in [\ + if os.path.basename(fn) in [ 'AsyncFile.py', 'AsyncIO.py', 'DebugConfig.py', 'DCTestResult.py', 'DebugBase.py', 'DebugClientBase.py',
--- a/DebugClients/Python3/DebugClientBase.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python3/DebugClientBase.py Sat Oct 19 11:49:31 2013 +0200 @@ -859,13 +859,13 @@ try: if failed: self.test = unittest.defaultTestLoader\ - .loadTestsFromNames(failed, utModule) + .loadTestsFromNames(failed, utModule) else: self.test = unittest.defaultTestLoader\ - .loadTestsFromName(tfn, utModule) + .loadTestsFromName(tfn, utModule) except AttributeError: self.test = unittest.defaultTestLoader\ - .loadTestsFromModule(utModule) + .loadTestsFromModule(utModule) except: exc_type, exc_value, exc_tb = sys.exc_info() self.write('{0}{1}\n'.format( @@ -1019,7 +1019,7 @@ pass return self.clientCapabilities except ImportError: - return (self.clientCapabilities & + return (self.clientCapabilities & ~DebugClientCapabilities.HasProfiler) def write(self, s): @@ -1432,7 +1432,7 @@ oaccess = '' try: loc = {"dict": dict} - exec('mdict = dict{0!s}.__dict__\nobj = dict{0!s}'\ + exec('mdict = dict{0!s}.__dict__\nobj = dict{0!s}' .format(access), globals(), loc) mdict = loc["mdict"] obj = loc["obj"] @@ -1445,7 +1445,7 @@ pass try: loc = {"dict": dict} - exec('mcdict = dict{0!s}.__class__.__dict__'\ + exec('mcdict = dict{0!s}.__class__.__dict__' .format(access), globals(), loc) ndict.update(loc["mcdict"]) if mdict and not "sipThis" in mdict.keys(): @@ -1461,8 +1461,7 @@ try: loc["v"] = v exec('cdict[v] = dict{0!s}.{1!s}'.format( - access, v), - globals, loc) + access, v), globals, loc) except: pass ndict.update(loc["cdict"]) @@ -1496,7 +1495,7 @@ try: loc["v"] = v exec('cdict[v] = dict[var[i]].{0!s}' - .format(v), + .format(v), globals(), loc) except: pass @@ -1515,7 +1514,7 @@ if qtVariable: vlist = self.__formatQt4Variable(qvar, qvtype) elif ("sipThis" in dict.keys() and len(dict) == 1) or \ - (len(dict) == 0 and len(udict) > 0): + (len(dict) == 0 and len(udict) > 0): if access: loc = {"udict": udict} exec('qvar = udict{0!s}'.format(access), globals(), loc) @@ -1817,7 +1816,7 @@ if ConfigVarTypeStrings.index('class') in filter: continue elif not valtype.startswith("PySide") and \ - ConfigVarTypeStrings.index('other') in filter: + ConfigVarTypeStrings.index('other') in filter: continue try:
--- a/DebugClients/Python3/DebugClientCapabilities.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python3/DebugClientCapabilities.py Sat Oct 19 11:49:31 2013 +0200 @@ -16,4 +16,4 @@ HasShell = 0x0040 HasAll = HasDebugger | HasInterpreter | HasProfiler | \ - HasCoverage | HasCompleter | HasUnittest | HasShell + HasCoverage | HasCompleter | HasUnittest | HasShell
--- a/DebugClients/Python3/DebugConfig.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python3/DebugConfig.py Sat Oct 19 11:49:31 2013 +0200 @@ -8,12 +8,12 @@ """ ConfigVarTypeStrings = [ - '__', 'NoneType', 'type',\ - 'bool', 'int', 'long', 'float', 'complex',\ - 'str', 'unicode', 'tuple', 'list',\ - 'dict', 'dict-proxy', 'set', 'file', 'xrange',\ - 'slice', 'buffer', 'class', 'instance',\ - 'instance method', 'property', 'generator',\ - 'function', 'builtin_function_or_method', 'code', 'module',\ + '__', 'NoneType', 'type', + 'bool', 'int', 'long', 'float', 'complex', + 'str', 'unicode', 'tuple', 'list', + 'dict', 'dict-proxy', 'set', 'file', 'xrange', + 'slice', 'buffer', 'class', 'instance', + 'instance method', 'property', 'generator', + 'function', 'builtin_function_or_method', 'code', 'module', 'ellipsis', 'traceback', 'frame', 'other' ]
--- a/DebugClients/Python3/FlexCompleter.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python3/FlexCompleter.py Sat Oct 19 11:49:31 2013 +0200 @@ -77,7 +77,7 @@ @exception TypeError raised to indicate a wrong data structure of the namespace object """ - if namespace and type(namespace) != type({}): + if namespace and isinstance(namespace, dict): raise TypeError('namespace must be a dictionary') # Don't bind to namespace quite yet, but flag whether the user wants a
--- a/DebugClients/Python3/PyProfile.py Sat Oct 19 11:14:51 2013 +0200 +++ b/DebugClients/Python3/PyProfile.py Sat Oct 19 11:49:31 2013 +0200 @@ -117,7 +117,7 @@ """ # get module name from __file__ if not isinstance(frame, profile.Profile.fake_frame) and \ - '__file__' in frame.f_globals: + '__file__' in frame.f_globals: root, ext = os.path.splitext(frame.f_globals['__file__']) if ext in ['.pyc', '.py', '.py3', '.pyo']: fixedName = root + '.py' @@ -148,7 +148,7 @@ rframe, rframe.f_back, frame, frame.f_back) self.trace_dispatch_return(rframe, 0) - assert (self.cur is None or \ + assert (self.cur is None or frame.f_back is self.cur[-2]), ("Bad call", self.cur[-3]) fcode = frame.f_code @@ -171,4 +171,4 @@ "c_exception": profile.Profile.trace_dispatch_return, # the C function returned "c_return": profile.Profile.trace_dispatch_return, - } + }
--- a/Debugger/BreakPointModel.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/BreakPointModel.py Sat Oct 19 11:49:31 2013 +0200 @@ -40,7 +40,7 @@ Qt.Alignment(Qt.AlignHCenter), Qt.Alignment(Qt.AlignRight), Qt.Alignment(Qt.AlignHCenter), - ] + ] def columnCount(self, parent=QModelIndex()): """
--- a/Debugger/CallStackViewer.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/CallStackViewer.py Sat Oct 19 11:49:31 2013 +0200 @@ -191,5 +191,5 @@ self.trUtf8("Error saving Call Stack Info"), self.trUtf8("""<p>The call stack info could not be""" """ written to <b>{0}</b></p>""" - """<p>Reason: {1}</p>""")\ - .format(fname, str(err))) + """<p>Reason: {1}</p>""") + .format(fname, str(err)))
--- a/Debugger/CallTraceViewer.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/CallTraceViewer.py Sat Oct 19 11:49:31 2013 +0200 @@ -162,8 +162,8 @@ self.trUtf8("Error saving Call Trace Info"), self.trUtf8("""<p>The call trace info could not""" """ be written to <b>{0}</b></p>""" - """<p>Reason: {1}</p>""")\ - .format(fname, str(err))) + """<p>Reason: {1}</p>""") + .format(fname, str(err))) @pyqtSlot(QTreeWidgetItem, int) def on_callTrace_itemDoubleClicked(self, item, column):
--- a/Debugger/Config.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/Config.py Sat Oct 19 11:49:31 2013 +0200 @@ -12,46 +12,46 @@ # Variables type definition ConfigVarTypeDispStrings = [ - QT_TRANSLATE_NOOP('Variable Types', 'Hidden Attributes'), - QT_TRANSLATE_NOOP('Variable Types', 'None'), - QT_TRANSLATE_NOOP('Variable Types', 'Type'), - QT_TRANSLATE_NOOP('Variable Types', 'Boolean'), - QT_TRANSLATE_NOOP('Variable Types', 'Integer'), - QT_TRANSLATE_NOOP('Variable Types', 'Long Integer'), - QT_TRANSLATE_NOOP('Variable Types', 'Float'), - QT_TRANSLATE_NOOP('Variable Types', 'Complex'), - QT_TRANSLATE_NOOP('Variable Types', 'String'), - QT_TRANSLATE_NOOP('Variable Types', 'Unicode String'), - QT_TRANSLATE_NOOP('Variable Types', 'Tuple'), - QT_TRANSLATE_NOOP('Variable Types', 'List/Array'), - QT_TRANSLATE_NOOP('Variable Types', 'Dictionary/Hash/Map'), - QT_TRANSLATE_NOOP('Variable Types', 'Dictionary Proxy'), - QT_TRANSLATE_NOOP('Variable Types', 'Set'), - QT_TRANSLATE_NOOP('Variable Types', 'File'), - QT_TRANSLATE_NOOP('Variable Types', 'X Range'), - QT_TRANSLATE_NOOP('Variable Types', 'Slice'), - QT_TRANSLATE_NOOP('Variable Types', 'Buffer'), - QT_TRANSLATE_NOOP('Variable Types', 'Class'), - QT_TRANSLATE_NOOP('Variable Types', 'Class Instance'), - QT_TRANSLATE_NOOP('Variable Types', 'Class Method'), - QT_TRANSLATE_NOOP('Variable Types', 'Class Property'), - QT_TRANSLATE_NOOP('Variable Types', 'Generator'), - QT_TRANSLATE_NOOP('Variable Types', 'Function'), - QT_TRANSLATE_NOOP('Variable Types', 'Builtin Function'), - QT_TRANSLATE_NOOP('Variable Types', 'Code'), - QT_TRANSLATE_NOOP('Variable Types', 'Module'), - QT_TRANSLATE_NOOP('Variable Types', 'Ellipsis'), - QT_TRANSLATE_NOOP('Variable Types', 'Traceback'), - QT_TRANSLATE_NOOP('Variable Types', 'Frame'), - QT_TRANSLATE_NOOP('Variable Types', 'Other') + QT_TRANSLATE_NOOP('Variable Types', 'Hidden Attributes'), + QT_TRANSLATE_NOOP('Variable Types', 'None'), + QT_TRANSLATE_NOOP('Variable Types', 'Type'), + QT_TRANSLATE_NOOP('Variable Types', 'Boolean'), + QT_TRANSLATE_NOOP('Variable Types', 'Integer'), + QT_TRANSLATE_NOOP('Variable Types', 'Long Integer'), + QT_TRANSLATE_NOOP('Variable Types', 'Float'), + QT_TRANSLATE_NOOP('Variable Types', 'Complex'), + QT_TRANSLATE_NOOP('Variable Types', 'String'), + QT_TRANSLATE_NOOP('Variable Types', 'Unicode String'), + QT_TRANSLATE_NOOP('Variable Types', 'Tuple'), + QT_TRANSLATE_NOOP('Variable Types', 'List/Array'), + QT_TRANSLATE_NOOP('Variable Types', 'Dictionary/Hash/Map'), + QT_TRANSLATE_NOOP('Variable Types', 'Dictionary Proxy'), + QT_TRANSLATE_NOOP('Variable Types', 'Set'), + QT_TRANSLATE_NOOP('Variable Types', 'File'), + QT_TRANSLATE_NOOP('Variable Types', 'X Range'), + QT_TRANSLATE_NOOP('Variable Types', 'Slice'), + QT_TRANSLATE_NOOP('Variable Types', 'Buffer'), + QT_TRANSLATE_NOOP('Variable Types', 'Class'), + QT_TRANSLATE_NOOP('Variable Types', 'Class Instance'), + QT_TRANSLATE_NOOP('Variable Types', 'Class Method'), + QT_TRANSLATE_NOOP('Variable Types', 'Class Property'), + QT_TRANSLATE_NOOP('Variable Types', 'Generator'), + QT_TRANSLATE_NOOP('Variable Types', 'Function'), + QT_TRANSLATE_NOOP('Variable Types', 'Builtin Function'), + QT_TRANSLATE_NOOP('Variable Types', 'Code'), + QT_TRANSLATE_NOOP('Variable Types', 'Module'), + QT_TRANSLATE_NOOP('Variable Types', 'Ellipsis'), + QT_TRANSLATE_NOOP('Variable Types', 'Traceback'), + QT_TRANSLATE_NOOP('Variable Types', 'Frame'), + QT_TRANSLATE_NOOP('Variable Types', 'Other') ] except ImportError: # Variables type definition (for non-Qt only) ConfigVarTypeDispStrings = [ - 'Hidden Attributes', 'None', 'Type', 'Boolean', 'Integer', - 'Long Integer', 'Float', 'Complex', 'String', 'Unicode String', - 'Tuple', 'List/Array', 'Dictionary/Hash/Map', 'Dictionary Proxy', - 'Set', 'File', 'X Range', 'Slice', 'Buffer', 'Class', - 'Class Instance', 'Class Method', 'Class Property', 'Generator', - 'Function', 'Builtin Function', 'Code', 'Module', 'Ellipsis', - 'Traceback', 'Frame', 'Other'] + 'Hidden Attributes', 'None', 'Type', 'Boolean', 'Integer', + 'Long Integer', 'Float', 'Complex', 'String', 'Unicode String', + 'Tuple', 'List/Array', 'Dictionary/Hash/Map', 'Dictionary Proxy', + 'Set', 'File', 'X Range', 'Slice', 'Buffer', 'Class', + 'Class Instance', 'Class Method', 'Class Property', 'Generator', + 'Function', 'Builtin Function', 'Code', 'Module', 'Ellipsis', + 'Traceback', 'Frame', 'Other']
--- a/Debugger/DebugClientCapabilities.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/DebugClientCapabilities.py Sat Oct 19 11:49:31 2013 +0200 @@ -16,4 +16,4 @@ HasShell = 0x0040 HasAll = HasDebugger | HasInterpreter | HasProfiler | \ - HasCoverage | HasCompleter | HasUnittest | HasShell + HasCoverage | HasCompleter | HasUnittest | HasShell
--- a/Debugger/DebugServer.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/DebugServer.py Sat Oct 19 11:49:31 2013 +0200 @@ -243,7 +243,7 @@ if addressEntry.ip().toString().lower() == \ address.lower(): return networkInterface.humanReadableName(), \ - networkInterface.index() + networkInterface.index() return "", 0 @@ -291,8 +291,8 @@ if shellOnly: languages = \ - [lang for lang in languages \ - if self.__clientCapabilities[lang] & + [lang for lang in languages + if self.__clientCapabilities[lang] & DebugClientCapabilities.HasShell] return languages[:] @@ -637,8 +637,8 @@ self.trUtf8("Connection from illegal host"), self.trUtf8( """<p>A connection was attempted by the illegal host""" - """ <b>{0}</b>. Accept this connection?</p>""")\ - .format(peerAddress), + """ <b>{0}</b>. Accept this connection?</p>""") + .format(peerAddress), icon=E5MessageBox.Warning) if not res: sock.abort()
--- a/Debugger/DebugUI.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/DebugUI.py Sat Oct 19 11:49:31 2013 +0200 @@ -972,7 +972,7 @@ self.profileProjectAct.setEnabled(self.projectOpen) self.coverageProjectAct.setEnabled(self.projectOpen) if self.lastDebuggedFile is not None and \ - (self.editorOpen or self.projectOpen): + (self.editorOpen or self.projectOpen): self.restartAct.setEnabled(True) else: self.restartAct.setEnabled(False) @@ -1027,8 +1027,8 @@ else: msg = self.trUtf8('"{0}" has terminated with an exit' ' status of {1}.')\ - .format(os.path.basename(self.ui.currentProg), - status) + .format(os.path.basename(self.ui.currentProg), + status) self.ui.showNotification( UI.PixmapCache.getPixmap("debug48.png"), self.trUtf8("Program terminated"), msg) @@ -1103,9 +1103,9 @@ ' See the shell window for details.')) return - if (self.exceptions and \ - exceptionType not in self.excIgnoreList and \ - (not len(self.excList) or \ + if (self.exceptions and + exceptionType not in self.excIgnoreList and + (not len(self.excList) or (len(self.excList) and exceptionType in self.excList)))\ or exceptionType.startswith('unhandled'): res = None @@ -1130,12 +1130,12 @@ if stackTrace: if exceptionType.startswith('unhandled'): buttons = E5MessageBox.StandardButtons( - E5MessageBox.No | \ + E5MessageBox.No | E5MessageBox.Yes) else: buttons = E5MessageBox.StandardButtons( - E5MessageBox.No | \ - E5MessageBox.Yes | \ + E5MessageBox.No | + E5MessageBox.Yes | E5MessageBox.Ignore) res = E5MessageBox.critical( self.ui, Program, @@ -1144,11 +1144,11 @@ ' <b>{0}</b><br>"<b>{1}</b>"<br>' 'File: <b>{2}</b>, Line: <b>{3}</b></p>' '<p>Break here?</p>') - .format( - exceptionType, - Utilities.html_encode(exceptionMessage), - stackTrace[0][0], - stackTrace[0][1]), + .format( + exceptionType, + Utilities.html_encode(exceptionMessage), + stackTrace[0][0], + stackTrace[0][1]), buttons, E5MessageBox.No) else: @@ -1157,9 +1157,9 @@ self.trUtf8( '<p>The debugged program raised the exception' ' <b>{0}</b><br>"<b>{1}</b>"</p>') - .format( - exceptionType, - Utilities.html_encode(exceptionMessage))) + .format( + exceptionType, + Utilities.html_encode(exceptionMessage))) if res == E5MessageBox.Yes: self.exceptionInterrupt.emit() stack = [] @@ -1267,8 +1267,8 @@ self.trUtf8("Breakpoint Condition Error"), self.trUtf8( """<p>The condition of the breakpoint <b>{0}, {1}</b>""" - """ contains a syntax error.</p>""")\ - .format(filename, lineno)) + """ contains a syntax error.</p>""") + .format(filename, lineno)) model = self.debugServer.getBreakPointModel() index = model.getBreakPointIndex(filename, lineno) @@ -1302,8 +1302,8 @@ self.ui, self.trUtf8("Watch Expression Error"), self.trUtf8("""<p>The watch expression <b>{0}</b>""" - """ contains a syntax error.</p>""")\ - .format(cond)) + """ contains a syntax error.</p>""") + .format(cond)) model = self.debugServer.getWatchPointModel() index = model.getWatchPointIndex(cond) @@ -1330,7 +1330,7 @@ if not special: msg = self.trUtf8("""<p>A watch expression '<b>{0}</b>'""" """ already exists.</p>""")\ - .format(Utilities.html_encode(cond)) + .format(Utilities.html_encode(cond)) else: msg = self.trUtf8( """<p>A watch expression '<b>{0}</b>'""" @@ -1345,7 +1345,7 @@ model.deleteWatchPointByIndex(index) else: model.setWatchPointByIndex(index, cond, special, - (temp, enabled, count)) + (temp, enabled, count)) def __configureVariablesFilters(self): """ @@ -1526,9 +1526,10 @@ if editor is None: return - if not self.viewmanager.checkDirty(editor, - Preferences.getDebugger("Autosave")) or \ - editor.getFileName() is None: + if not self.viewmanager.checkDirty( + editor, + Preferences.getDebugger("Autosave")) or \ + editor.getFileName() is None: return fn = editor.getFileName() @@ -1643,9 +1644,10 @@ if editor is None: return - if not self.viewmanager.checkDirty(editor, - Preferences.getDebugger("Autosave")) or \ - editor.getFileName() is None: + if not self.viewmanager.checkDirty( + editor, + Preferences.getDebugger("Autosave")) or \ + editor.getFileName() is None: return fn = editor.getFileName() @@ -1762,9 +1764,10 @@ if editor is None: return - if not self.viewmanager.checkDirty(editor, - Preferences.getDebugger("Autosave")) or \ - editor.getFileName() is None: + if not self.viewmanager.checkDirty( + editor, + Preferences.getDebugger("Autosave")) or \ + editor.getFileName() is None: return fn = editor.getFileName() @@ -1883,9 +1886,10 @@ if editor is None: return - if not self.viewmanager.checkDirty(editor, - Preferences.getDebugger("Autosave")) or \ - editor.getFileName() is None: + if not self.viewmanager.checkDirty( + editor, + Preferences.getDebugger("Autosave")) or \ + editor.getFileName() is None: return fn = editor.getFileName() @@ -2149,11 +2153,11 @@ curr = -1 arg, ok = QInputDialog.getItem( - self.ui, - self.trUtf8("Evaluate"), - self.trUtf8("Enter the statement to evaluate"), - self.evalHistory, - curr, True) + self.ui, + self.trUtf8("Evaluate"), + self.trUtf8("Enter the statement to evaluate"), + self.evalHistory, + curr, True) if ok: if not arg: @@ -2178,11 +2182,11 @@ curr = -1 stmt, ok = QInputDialog.getItem( - self.ui, - self.trUtf8("Execute"), - self.trUtf8("Enter the statement to execute"), - self.execHistory, - curr, True) + self.ui, + self.trUtf8("Execute"), + self.trUtf8("Enter the statement to execute"), + self.execHistory, + curr, True) if ok: if not stmt:
--- a/Debugger/DebuggerInterfacePython.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/DebuggerInterfacePython.py Sat Oct 19 11:49:31 2013 +0200 @@ -190,7 +190,7 @@ rhost = "localhost" if rexec: args = Utilities.parseOptionString(rexec) + \ - [rhost, interpreter, os.path.abspath(debugClient), + [rhost, interpreter, os.path.abspath(debugClient), noencoding, str(port), redirect, ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:]) @@ -237,7 +237,7 @@ ccmd = Preferences.getDebugger("ConsoleDbgCommand") if ccmd: args = Utilities.parseOptionString(ccmd) + \ - [interpreter, os.path.abspath(debugClient), + [interpreter, os.path.abspath(debugClient), noencoding, str(port), '0', ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:], clientEnv) @@ -292,7 +292,7 @@ rhost = "localhost" if rexec: args = Utilities.parseOptionString(rexec) + \ - [rhost, interpreter, os.path.abspath(debugClient), + [rhost, interpreter, os.path.abspath(debugClient), noencoding, str(port), redirect, ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:]) @@ -336,10 +336,10 @@ ipaddr = self.debugServer.getHostAddress(True) if runInConsole or project.getDebugProperty("CONSOLEDEBUGGER"): ccmd = project.getDebugProperty("CONSOLECOMMAND") or \ - Preferences.getDebugger("ConsoleDbgCommand") + Preferences.getDebugger("ConsoleDbgCommand") if ccmd: args = Utilities.parseOptionString(ccmd) + \ - [interpreter, os.path.abspath(debugClient), + [interpreter, os.path.abspath(debugClient), noencoding, str(port), '0', ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:], clientEnv)
--- a/Debugger/DebuggerInterfacePython3.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/DebuggerInterfacePython3.py Sat Oct 19 11:49:31 2013 +0200 @@ -185,7 +185,7 @@ rhost = "localhost" if rexec: args = Utilities.parseOptionString(rexec) + \ - [rhost, interpreter, os.path.abspath(debugClient), + [rhost, interpreter, os.path.abspath(debugClient), noencoding, str(port), redirect, ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:]) @@ -232,7 +232,7 @@ ccmd = Preferences.getDebugger("ConsoleDbgCommand") if ccmd: args = Utilities.parseOptionString(ccmd) + \ - [interpreter, os.path.abspath(debugClient), + [interpreter, os.path.abspath(debugClient), noencoding, str(port), '0', ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:], clientEnv) @@ -287,7 +287,7 @@ rhost = "localhost" if rexec: args = Utilities.parseOptionString(rexec) + \ - [rhost, interpreter, os.path.abspath(debugClient), + [rhost, interpreter, os.path.abspath(debugClient), noencoding, str(port), redirect, ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:]) @@ -331,10 +331,10 @@ ipaddr = self.debugServer.getHostAddress(True) if runInConsole or project.getDebugProperty("CONSOLEDEBUGGER"): ccmd = project.getDebugProperty("CONSOLECOMMAND") or \ - Preferences.getDebugger("ConsoleDbgCommand") + Preferences.getDebugger("ConsoleDbgCommand") if ccmd: args = Utilities.parseOptionString(ccmd) + \ - [interpreter, os.path.abspath(debugClient), + [interpreter, os.path.abspath(debugClient), noencoding, str(port), '0', ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:], clientEnv)
--- a/Debugger/DebuggerInterfaceRuby.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/DebuggerInterfaceRuby.py Sat Oct 19 11:49:31 2013 +0200 @@ -157,7 +157,7 @@ rhost = "localhost" if rexec: args = Utilities.parseOptionString(rexec) + \ - [rhost, interpreter, os.path.abspath(debugClient), + [rhost, interpreter, os.path.abspath(debugClient), str(port), redirect, ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:]) @@ -204,7 +204,7 @@ ccmd = Preferences.getDebugger("ConsoleDbgCommand") if ccmd: args = Utilities.parseOptionString(ccmd) + \ - [interpreter, os.path.abspath(debugClient), + [interpreter, os.path.abspath(debugClient), str(port), '0', ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:], clientEnv) @@ -257,7 +257,7 @@ rhost = "localhost" if rexec: args = Utilities.parseOptionString(rexec) + \ - [rhost, interpreter, os.path.abspath(debugClient), + [rhost, interpreter, os.path.abspath(debugClient), str(port), redirect, ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:]) @@ -301,10 +301,10 @@ ipaddr = self.debugServer.getHostAddress(True) if runInConsole or project.getDebugProperty("CONSOLEDEBUGGER"): ccmd = project.getDebugProperty("CONSOLECOMMAND") or \ - Preferences.getDebugger("ConsoleDbgCommand") + Preferences.getDebugger("ConsoleDbgCommand") if ccmd: args = Utilities.parseOptionString(ccmd) + \ - [interpreter, os.path.abspath(debugClient), + [interpreter, os.path.abspath(debugClient), str(port), '0', ipaddr] args[0] = Utilities.getExecutablePath(args[0]) process = self.__startProcess(args[0], args[1:], clientEnv)
--- a/Debugger/VariablesViewer.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/VariablesViewer.py Sat Oct 19 11:49:31 2013 +0200 @@ -522,17 +522,17 @@ @return The item that was generated (VariableItem). """ if isSpecial and \ - (self.dvar_rx_class1.exactMatch(dvar) or \ - self.dvar_rx_class2.exactMatch(dvar)): + (self.dvar_rx_class1.exactMatch(dvar) or + self.dvar_rx_class2.exactMatch(dvar)): isSpecial = False if self.rx_class2.exactMatch(dtype): return SpecialVarItem(parent, dvar, dvalue, dtype[7:-1], self.framenr, self.scope) elif dtype != "void *" and \ - (self.rx_class.exactMatch(dvalue) or \ - self.rx_class3.exactMatch(dvalue) or \ - isSpecial): + (self.rx_class.exactMatch(dvalue) or + self.rx_class3.exactMatch(dvalue) or + isSpecial): if self.dvar_rx_special_array_element.exactMatch(dvar): return SpecialArrayElementVarItem(parent, dvar, dvalue, dtype, self.framenr, self.scope)
--- a/Debugger/WatchPointModel.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/WatchPointModel.py Sat Oct 19 11:49:31 2013 +0200 @@ -37,7 +37,7 @@ Qt.Alignment(Qt.AlignHCenter), Qt.Alignment(Qt.AlignHCenter), Qt.Alignment(Qt.AlignRight), - ] + ] def columnCount(self, parent=QModelIndex()): """
--- a/Debugger/WatchPointViewer.py Sat Oct 19 11:14:51 2013 +0200 +++ b/Debugger/WatchPointViewer.py Sat Oct 19 11:49:31 2013 +0200 @@ -237,7 +237,7 @@ if not special: msg = self.trUtf8("""<p>A watch expression '<b>{0}</b>'""" """ already exists.</p>""")\ - .format(Utilities.html_encode(cond)) + .format(Utilities.html_encode(cond)) else: msg = self.trUtf8( """<p>A watch expression '<b>{0}</b>'"""
--- a/compileUiFiles.py Sat Oct 19 11:14:51 2013 +0200 +++ b/compileUiFiles.py Sat Oct 19 11:49:31 2013 +0200 @@ -119,8 +119,8 @@ except SystemExit: raise except: - print(""" -An internal error occured. Please report all the output of the program, -including the following traceback, to eric5-bugs@eric-ide.python-projects.org. - """) + print( + "\nAn internal error occured. Please report all the output of the" + " program, \nincluding the following traceback, to" + " eric5-bugs@eric-ide.python-projects.org.\n") raise
--- a/eric5.e4p Sat Oct 19 11:14:51 2013 +0200 +++ b/eric5.e4p Sat Oct 19 11:49:31 2013 +0200 @@ -1929,7 +1929,7 @@ <string>ExcludeMessages</string> </key> <value> - <string>E24, D, W293, N802, N803, N807, N808, N821,E,W</string> + <string>E24, D, W293, N802, N803, N807, N808, N821</string> </value> <key> <string>FixCodes</string> @@ -1953,7 +1953,7 @@ <string>IncludeMessages</string> </key> <value> - <string>E128</string> + <string></string> </value> <key> <string>MaxLineLength</string>