Tue, 05 Nov 2013 22:23:38 +0100
Fixed a bunch of indentation issues.
--- a/Debugger/DebugServer.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Debugger/DebugServer.py Tue Nov 05 22:23:38 2013 +0100 @@ -188,16 +188,19 @@ self.clientType = \ Preferences.Prefs.settings.value('DebugClient/Type') - if self.clientType == None: + if self.clientType is None: import sys if sys.version_info[0] == 2: self.clientType = 'Python2' else: self.clientType = 'Python3' - # Change clientType if dependent interpreter not exist anymore (maybe deinstalled,...) - elif self.clientType == 'Python2' and Preferences.getDebugger("PythonInterpreter") == '': + # Change clientType if dependent interpreter not exist anymore + # (maybe deinstalled,...) + elif self.clientType == 'Python2' and Preferences.getDebugger( + "PythonInterpreter") == '': self.clientType = 'Python3' - elif self.clientType == 'Python3' and Preferences.getDebugger("Python3Interpreter") == '': + elif self.clientType == 'Python3' and Preferences.getDebugger( + "Python3Interpreter") == '': self.clientType = 'Python2' self.lastClientType = ''
--- a/Debugger/DebuggerInterfacePython3.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Debugger/DebuggerInterfacePython3.py Tue Nov 05 22:23:38 2013 +0100 @@ -154,7 +154,8 @@ """ interpreter = Preferences.getDebugger("Python3Interpreter") if interpreter == "": - E5MessageBox.critical(None, + E5MessageBox.critical( + None, self.trUtf8("Start Debugger"), self.trUtf8( """<p>No Python3 interpreter configured.</p>"""))
--- a/E5Gui/E5PasswordMeter.py Sun Nov 03 16:23:07 2013 +0100 +++ b/E5Gui/E5PasswordMeter.py Tue Nov 05 22:23:38 2013 +0100 @@ -59,7 +59,8 @@ strength = PasswordChecker().checkPassword(password) self.setStyleSheet(self.__styleSheetTemplate.format( self.__indicatorColors[strength])) - super(E5PasswordMeter, self).setValue((strength + 1) * self.__increment) + super(E5PasswordMeter, self).setValue( + (strength + 1) * self.__increment) def setValue(self, value): """
--- a/E5Gui/E5SqueezeLabels.py Sun Nov 03 16:23:07 2013 +0100 +++ b/E5Gui/E5SqueezeLabels.py Tue Nov 05 22:23:38 2013 +0100 @@ -79,7 +79,8 @@ (string) """ self.__surrounding = surrounding - super(E5SqueezeLabelPath, self).setText(self.__surrounding.format(self.__path)) + super(E5SqueezeLabelPath, self).setText( + self.__surrounding.format(self.__path)) def setPath(self, path): """ @@ -88,7 +89,8 @@ @param path path to be shown (string) """ self.__path = path - super(E5SqueezeLabelPath, self).setText(self.__surrounding.format(self.__path)) + super(E5SqueezeLabelPath, self).setText( + self.__surrounding.format(self.__path)) def setTextPath(self, surrounding, path): """ @@ -100,7 +102,8 @@ """ self.__surrounding = surrounding self.__path = path - super(E5SqueezeLabelPath, self).setText(self.__surrounding.format(self.__path)) + super(E5SqueezeLabelPath, self).setText( + self.__surrounding.format(self.__path)) def paintEvent(self, event): """ @@ -117,7 +120,8 @@ self.length)) ) else: - super(E5SqueezeLabelPath, self).setText(self.__surrounding.format(self.__path)) + super(E5SqueezeLabelPath, self).setText( + self.__surrounding.format(self.__path)) super(E5SqueezeLabelPath, self).paintEvent(event) def length(self, txt):
--- a/E5Network/E5Ftp.py Sun Nov 03 16:23:07 2013 +0100 +++ b/E5Network/E5Ftp.py Tue Nov 05 22:23:38 2013 +0100 @@ -166,7 +166,8 @@ return super(E5Ftp, self).connect( self.__proxyHost, self.__proxyPort, self.__timeout) else: - return super(E5Ftp, self).connect(self.__host, self.__port, self.__timeout) + return super(E5Ftp, self).connect( + self.__host, self.__port, self.__timeout) def login(self, user="", password="", acct=""): """
--- a/Graphics/UMLGraphicsView.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Graphics/UMLGraphicsView.py Tue Nov 05 22:23:38 2013 +0100 @@ -424,7 +424,8 @@ printDialog = QPrintDialog(printer, self) if printDialog.exec_(): - super(UMLGraphicsView, self).printDiagram(printer, self.diagramName) + super(UMLGraphicsView, self).printDiagram( + printer, self.diagramName) def printPreviewDiagram(self): """
--- a/Helpviewer/GreaseMonkey/GreaseMonkeyConfiguration/GreaseMonkeyConfigurationListWidget.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Helpviewer/GreaseMonkey/GreaseMonkeyConfiguration/GreaseMonkeyConfigurationListWidget.py Tue Nov 05 22:23:38 2013 +0100 @@ -77,4 +77,5 @@ self.removeItemRequested.emit(self.itemAt(evt.pos())) return - super(GreaseMonkeyConfigurationListWidget, self).mouseDoubleClickEvent(evt) + super(GreaseMonkeyConfigurationListWidget, self).mouseDoubleClickEvent( + evt)
--- a/Helpviewer/HelpBrowserWV.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Helpviewer/HelpBrowserWV.py Tue Nov 05 22:23:38 2013 +0100 @@ -279,7 +279,8 @@ files = sip.cast(output, QWebPage.ChooseMultipleFilesExtensionReturn) if info is None or files is None: - return super(HelpWebPage, self).extension(extension, option, output) + return super(HelpWebPage, self).extension( + extension, option, output) suggestedFileName = "" if info.suggestedFileNames:
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Tue Nov 05 22:23:38 2013 +0100 @@ -59,7 +59,8 @@ @param args arguments for the message (list) @return error code (string) """ - code = super(CodeStyleCheckerReport, self).error_args(line_number, offset, code, check, *args) + code = super(CodeStyleCheckerReport, self).error_args( + line_number, offset, code, check, *args) if code and (self.counters[code] == 1 or self.__repeat): if code in NamingStyleChecker.Codes: text = NamingStyleChecker.getMessage(code, *args) @@ -332,9 +333,10 @@ elif os.path.isdir(fn): files = [] extensions = set(Preferences.getPython("PythonExtensions") + - Preferences.getPython("Python3Extensions")) + Preferences.getPython("Python3Extensions")) for ext in extensions: - files.extend(Utilities.direntries(fn, True, '*{0}'.format(ext), 0)) + files.extend(Utilities.direntries( + fn, True, '*{0}'.format(ext), 0)) else: files = [fn]
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Tue Nov 05 22:23:38 2013 +0100 @@ -147,7 +147,7 @@ elif os.path.isdir(fn): files = [] extensions = set(Preferences.getPython("PythonExtensions") + - Preferences.getPython("Python3Extensions")) + Preferences.getPython("Python3Extensions")) for ext in extensions: files.extend( Utilities.direntries(fn, True, '*{0}'.format(ext), 0)) @@ -189,11 +189,11 @@ ext = os.path.splitext(file)[1] if "FileType" in flags: isPy2 = flags["FileType"] in ["Python", "Python2"] - elif (Preferences.getProject("DeterminePyFromProject") and \ - self.__project.isOpen() and - self.__project.isProjectFile(file)): - isPy2 = self.__project.getProjectLanguage() in \ - ["Python", "Python2"] + elif (Preferences.getProject("DeterminePyFromProject") and + self.__project.isOpen() and + self.__project.isProjectFile(file)): + isPy2 = self.__project.getProjectLanguage() in \ + ["Python", "Python2"] else: isPy2 = flags.get("FileType") in ["Python", "Python2"] or \ ext in Preferences.getPython("PythonExtensions") @@ -202,15 +202,16 @@ Utilities.compile(file, source, isPy2) if nok: self.noResults = False - self.__createResultItem(fname, line, index, error, code.strip(), False) + self.__createResultItem( + fname, line, index, error, code.strip(), False) else: source = source.splitlines() for warning in warnings: self.noResults = False - scr_line = source[warning[2]-1].strip() + scr_line = source[warning[2] - 1].strip() self.__createResultItem( warning[1], warning[2], 0, - warning[3], scr_line, True) + warning[3], scr_line, True) progress += 1 self.checkProgress.setValue(progress)
--- a/Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py Tue Nov 05 22:23:38 2013 +0100 @@ -119,7 +119,7 @@ elif os.path.isdir(fn): files = [] extensions = set(Preferences.getPython("PythonExtensions") + - Preferences.getPython("Python3Extensions")) + Preferences.getPython("Python3Extensions")) for ext in extensions: files.extend( Utilities.direntries(fn, True, '*{0}'.format(ext), 0))
--- a/Plugins/VcsPlugins/vcsMercurial/TransplantExtension/ProjectHelper.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Plugins/VcsPlugins/vcsMercurial/TransplantExtension/ProjectHelper.py Tue Nov 05 22:23:38 2013 +0100 @@ -36,7 +36,8 @@ @param vcsObject reference to the vcs object @param projectObject reference to the project object """ - super(TransplantProjectHelper, self).setObjects(vcsObject, projectObject) + super(TransplantProjectHelper, self).setObjects( + vcsObject, projectObject) if self.vcs.version >= (2, 3): # transplant is deprecated as of Mercurial 2.3
--- a/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnCommitDialog.py Tue Nov 05 22:23:38 2013 +0100 @@ -36,7 +36,8 @@ @param changelists list of available change lists (list of strings) @param parent parent widget (QWidget) """ - super(SvnCommitDialog, self).__init__(parent, Qt.WindowFlags(Qt.Window)) + super(SvnCommitDialog, self).__init__( + parent, Qt.WindowFlags(Qt.Window)) self.setupUi(self) if pysvn.svn_version < (1, 5, 0) or pysvn.version < (1, 6, 0):
--- a/Plugins/VcsPlugins/vcsSubversion/SvnCommitDialog.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnCommitDialog.py Tue Nov 05 22:23:38 2013 +0100 @@ -34,7 +34,8 @@ @param vcs reference to the vcs object @param parent parent widget (QWidget) """ - super(SvnCommitDialog, self).__init__(parent, Qt.WindowFlags(Qt.Window)) + super(SvnCommitDialog, self).__init__( + parent, Qt.WindowFlags(Qt.Window)) self.setupUi(self) if vcs.version < (1, 5, 0):
--- a/Plugins/ViewManagerPlugins/Tabview/Tabview.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Plugins/ViewManagerPlugins/Tabview/Tabview.py Tue Nov 05 22:23:38 2013 +0100 @@ -224,8 +224,9 @@ self.emptyLabel = QLabel() self.emptyLabel.setPixmap(ericPic) self.emptyLabel.setAlignment(Qt.AlignVCenter | Qt.AlignHCenter) - super(TabWidget, self).addTab(self.emptyLabel, - UI.PixmapCache.getIcon("empty.png"), "") + super(TabWidget, self).addTab( + self.emptyLabel, + UI.PixmapCache.getIcon("empty.png"), "") def __initMenu(self): """ @@ -347,7 +348,8 @@ @param title title for the new tab (string) """ editor = assembly.getEditor() - super(TabWidget, self).addTab(assembly, UI.PixmapCache.getIcon("empty.png"), title) + super(TabWidget, self).addTab( + assembly, UI.PixmapCache.getIcon("empty.png"), title) if self.closeButton: self.closeButton.setEnabled(True) else: @@ -374,9 +376,10 @@ @return index of the inserted tab (integer) """ editor = assembly.getEditor() - newIndex = super(TabWidget, self).insertTab(index, assembly, - UI.PixmapCache.getIcon("empty.png"), - title) + newIndex = super(TabWidget, self).insertTab( + index, assembly, + UI.PixmapCache.getIcon("empty.png"), + title) if self.closeButton: self.closeButton.setEnabled(True) else:
--- a/Preferences/__init__.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Preferences/__init__.py Tue Nov 05 22:23:38 2013 +0100 @@ -1103,7 +1103,7 @@ QCoreApplication.setApplicationName(settingsNameGlobal) # Avoid nasty behavior of QSettings in combination with Py2 - Prefs.settings.value("UI/SingleApplicationMode") + Prefs.settings.value("UI/SingleApplicationMode") def syncPreferences(prefClass=Prefs): @@ -1262,7 +1262,8 @@ "Select Python{0} Interpreter").format(pyVersion), QCoreApplication.translate( "Preferences", - "Select the Python{0} interpreter to be used:").format(pyVersion), + "Select the Python{0} interpreter to be used:") + .format(pyVersion), interpreters, 0, False) if ok and selection != "": @@ -1474,7 +1475,8 @@ else: # use the defaults viewProfiles = prefClass.uiDefaults["ViewProfiles2"] - # Remove unused setting in Python 2. Otherwise Eric 5.3 would get problems + # Remove unused setting in Python 2. Otherwise Eric 5.3 + # would get problems if sys.version_info[0] == 2: prefClass.settings.remove("UI/ViewProfiles") return viewProfiles
--- a/Project/ProjectResourcesBrowser.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Project/ProjectResourcesBrowser.py Tue Nov 05 22:23:38 2013 +0100 @@ -631,7 +631,7 @@ if self.project.pdata["PROGLANGUAGE"][0] in \ ["Python", "Python2", "Python3"]: - if self.project.getProjectType() in ["Qt4", "Qt4C","E4Plugin"]: + if self.project.getProjectType() in ["Qt4", "Qt4C", "E4Plugin"]: self.rccCompiler = 'pyrcc4' if Utilities.isWindowsPlatform(): self.rccCompiler += '.exe'
--- a/QScintilla/Editor.py Sun Nov 03 16:23:07 2013 +0100 +++ b/QScintilla/Editor.py Tue Nov 05 22:23:38 2013 +0100 @@ -4940,13 +4940,12 @@ not self.autosaveManuallyDisabled and \ not self.isReadOnly() - def __autoSyntaxCheck(self): """ Private method to perform an automatic syntax check of the file. """ isPy2 = self.isPy2File() - if (isPy2 or self.isPy3File()) == False: + if (isPy2 or self.isPy3File()) is False: return if Preferences.getEditor("AutoCheckSyntax"): @@ -4955,8 +4954,9 @@ self.clearSyntaxError() self.clearFlakesWarnings() - syntaxError, _fn, errorline, errorindex, _code, _error, warnings = \ - Utilities.compile(self.fileName or "(Unnamed)", self.text(), isPy2) + syntaxError, _fn, errorline, errorindex, _code, _error, warnings =\ + Utilities.compile( + self.fileName or "(Unnamed)", self.text(), isPy2) if syntaxError: self.toggleSyntaxError(errorline, errorindex, True, _error) else: @@ -4964,7 +4964,6 @@ self.toggleFlakesWarning( warning[2], True, warning[3]) - def __initOnlineSyntaxCheck(self): """ Private slot to initialize the online syntax check.
--- a/UI/SplashScreen.py Sun Nov 03 16:23:07 2013 +0100 +++ b/UI/SplashScreen.py Tue Nov 05 22:23:38 2013 +0100 @@ -41,7 +41,8 @@ @param msg message to be shown (string) """ logging.debug(msg) - super(SplashScreen, self).showMessage(msg, self.labelAlignment, QColor(Qt.white)) + super(SplashScreen, self).showMessage( + msg, self.labelAlignment, QColor(Qt.white)) QApplication.processEvents() def clearMessage(self):
--- a/Utilities/SyntaxCheck.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Utilities/SyntaxCheck.py Tue Nov 05 22:23:38 2013 +0100 @@ -93,7 +93,8 @@ try: import ThirdParty.CharDet.chardet guess = ThirdParty.CharDet.chardet.detect(text) - if guess and guess['confidence'] > 0.95 and guess['encoding'] is not None: + if guess and guess['confidence'] > 0.95 \ + and guess['encoding'] is not None: codec = guess['encoding'].lower() return str(text, codec), '{0}-guessed'.format(codec) except (UnicodeError, LookupError, ImportError): @@ -165,7 +166,8 @@ def extractLineFlags(line, startComment="#", endComment=""): """ - Function to extract flags starting and ending with '__' from a line comment. + Function to extract flags starting and ending with '__' from a line + comment. @param line line to extract flags from (string) @keyparam startComment string identifying the start of the comment (string) @@ -184,7 +186,8 @@ return flags -def compile_and_check(file_, codestring="", checkFlakes=True, ignoreStarImportWarnings=False): +def compile_and_check(file_, codestring="", checkFlakes=True, + ignoreStarImportWarnings=False): """ Function to compile one Python source file to Python bytecode and to perform a pyflakes check. @@ -201,7 +204,6 @@ warnings (marker, file name, line number, message) The values are only valid, if the status is True. """ - try: import builtins except ImportError: @@ -237,7 +239,7 @@ error = "" lines = traceback.format_exception_only(SyntaxError, detail) match = re.match('\s*File "(.+)", line (\d+)', - lines[0].replace('<string>', '{0}'.format(file_))) + lines[0].replace('<string>', '{0}'.format(file_))) if match is not None: fn, line = match.group(1, 2) if lines[1].startswith('SyntaxError:'): @@ -288,12 +290,14 @@ warnings.messages.sort(key=lambda a: a.lineno) for warning in warnings.messages: if ignoreStarImportWarnings and \ - isinstance(warning, ImportStarUsed): - continue + isinstance(warning, ImportStarUsed): + continue _fn, lineno, message, msg_args = warning.getMessageData() - if "__IGNORE_WARNING__" not in extractLineFlags(lines[lineno - 1].strip()): - strings.append(["FLAKES_WARNING", _fn, lineno, message, msg_args]) + if "__IGNORE_WARNING__" not in extractLineFlags( + lines[lineno - 1].strip()): + strings.append([ + "FLAKES_WARNING", _fn, lineno, message, msg_args]) except SyntaxError as err: if err.text.strip(): msg = err.text.strip() @@ -317,13 +321,15 @@ else: filename = sys.argv[-1] checkFlakes = len(sys.argv) == 3 - ignoreStarImportWarnings = sys.argv[1] == "-fi" # Setting is ignored if checkFlakes is False + # Setting is ignored if checkFlakes is False + ignoreStarImportWarnings = sys.argv[1] == "-fi" try: codestring = readEncodedFile(filename)[0] syntaxerror, fname, line, index, code, error, warnings = \ - compile_and_check(filename, codestring, checkFlakes, ignoreStarImportWarnings) + compile_and_check(filename, codestring, checkFlakes, + ignoreStarImportWarnings) except IOError as msg: # fake a syntax error syntaxerror, fname, line, index, code, error, warnings = \
--- a/Utilities/__init__.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Utilities/__init__.py Tue Nov 05 22:23:38 2013 +0100 @@ -751,8 +751,8 @@ return False if (normcaseabspath(os.path.dirname(os.path.realpath(f1))) == - normcaseabspath(os.path.dirname(os.path.realpath(f2)))): - return True + normcaseabspath(os.path.dirname(os.path.realpath(f2)))): + return True return False @@ -1179,19 +1179,24 @@ from PyQt4.QtCore import QCoreApplication interpreter_name = 'Python' if isPy2 else 'Python3' - interpreter = Preferences.getDebugger(interpreter_name+"Interpreter") + interpreter = Preferences.getDebugger( + interpreter_name + "Interpreter") checkFlakes = Preferences.getFlakes("IncludeInSyntaxCheck") - ignoreStarImportWarnings = Preferences.getFlakes("IgnoreStarImportWarnings") + ignoreStarImportWarnings = Preferences.getFlakes( + "IgnoreStarImportWarnings") if samefilepath(interpreter, sys.executable): - ret = compile_and_check(file, codestring, checkFlakes, ignoreStarImportWarnings) + ret = compile_and_check( + file, codestring, checkFlakes, ignoreStarImportWarnings) else: #TODO: create temporary file if only a codestring is given - ret = compile_extern(file, isPy2, checkFlakes, ignoreStarImportWarnings) + ret = compile_extern( + file, isPy2, checkFlakes, ignoreStarImportWarnings) # Translate messages for warning in ret[6]: msg_args = warning.pop() - translated = QCoreApplication.translate('py3Flakes', warning[-1]).format(*msg_args) + translated = QCoreApplication.translate( + 'py3Flakes', warning[-1]).format(*msg_args) # Avoid leading "u" at Python2 unicode strings if translated.startswith("u'"): translated = translated[1:] @@ -1200,12 +1205,16 @@ return ret -def compile_extern(file, isPy2, checkFlakes=True, ignoreStarImportWarnings=False): +def compile_extern( + file, isPy2, checkFlakes=True, ignoreStarImportWarnings=False): """ Function to compile one Python source file to Python bytecode. @param file source filename (string) + @param isPy2 flag indicating if it's a Python 2 or 3 file (boolean) @keyparam checkFlakes flag indicating to do a pyflakes check (boolean) + @keyparam ignoreStarImportWarnings flag if star import warnings should be + suppressed (boolean) @return A tuple indicating status (True = an error was found), the file name, the line number, the index number, the code string, the error message and a list of tuples of pyflakes warnings indicating @@ -1215,12 +1224,13 @@ be empty, if a syntax error was detected by the syntax checker. """ interpreter_name = 'Python' if isPy2 else 'Python3' - interpreter = Preferences.getDebugger(interpreter_name+"Interpreter") + interpreter = Preferences.getDebugger(interpreter_name + "Interpreter") if interpreter == "" or not isinpath(interpreter): - return (True, file, 1, 0, "", - QCoreApplication.translate("Utilities", + return (True, file, 1, 0, "", + QCoreApplication.translate( + "Utilities", "{0} interpreter not configured.") - .format(interpreter_name), []) + .format(interpreter_name), []) syntaxChecker = os.path.join(getConfig('ericDir'), "Utilities", "SyntaxCheck.py") args = [syntaxChecker] @@ -1235,7 +1245,8 @@ proc.start(interpreter, args) finished = proc.waitForFinished(30000) if finished: - output = codecs.decode(proc.readAllStandardOutput(), + output = codecs.decode( + proc.readAllStandardOutput(), sys.getfilesystemencoding(), 'strict').splitlines() if output: @@ -1252,12 +1263,15 @@ warnings = [] while len(output) - index > 3: if output[index] == "FLAKES_ERROR": - return (True, output[index + 1], int(output[index + 2]), -1, - '', output[index + 3], []) + return (True, output[index + 1], + int(output[index + 2]), -1, + '', output[index + 3], []) else: msg_args = output[index + 4].split('#') - warnings.append([output[index], output[index + 1], - int(output[index + 2]), output[index + 3], msg_args]) + warnings.append([ + output[index], output[index + 1], + int(output[index + 2]), output[index + 3], + msg_args]) index += 5 return (False, None, None, None, None, None, warnings) @@ -1265,9 +1279,10 @@ return (False, "", -1, -1, "", "", []) return (True, file, 1, 0, "", - QCoreApplication.translate("Utilities", - "{0} interpreter did not finish within 30s.").format( - interpreter_name), []) + QCoreApplication.translate( + "Utilities", + "{0} interpreter did not finish within 30s.").format( + interpreter_name), []) ###############################################################################
--- a/Utilities/compatibility_fixes.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Utilities/compatibility_fixes.py Tue Nov 05 22:23:38 2013 +0100 @@ -5,6 +5,7 @@ """ Module implementing the open behavior of Python3 for use with Eric5. + The Eric5 used features are emulated only. The not emulated features should throw a NotImplementedError exception. """ @@ -15,7 +16,8 @@ import codecs -def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True): +def open(file, mode='r', buffering=-1, encoding=None, + errors=None, newline=None, closefd=True): """ Replacement for the build in open function. @@ -23,9 +25,12 @@ @keyparam mode access mode (string) @keyparam buffering size of the read buffer (string) @keyparam encoding character encoding for reading/ writing (string) - @keyparam errors behavior for the character encoding ('strict', 'explicit', ...) (string) + @keyparam errors behavior for the character encoding ('strict', + 'explicit', ...) (string) @keyparam newline controls how universal newlines works (string) - @keyparam closefd close underlying file descriptor if given as file parameter (boolean) + @keyparam closefd close underlying file descriptor if given as file + parameter (boolean) + @return Returns the new file object """ return File(file, mode, buffering, encoding, errors, newline, closefd) @@ -34,7 +39,8 @@ """ Facade for the original file class. """ - def __init__(self, filein, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True): + def __init__(self, filein, mode='r', buffering=-1, + encoding=None, errors=None, newline=None, closefd=True): """ Constructor, checks for unimplemented parameters. @@ -42,9 +48,12 @@ @keyparam mode access mode (string) @keyparam buffering size of the read buffer (string) @keyparam encoding character encoding for reading/ writing (string) - @keyparam errors behavior for the character encoding ('strict', 'explicit', ...) (string) + @keyparam errors behavior for the character encoding ('strict', + 'explicit', ...) (string) @keyparam newline controls how universal newlines works (string) - @keyparam closefd close underlying file descriptor if given as file parameter (boolean) + @keyparam closefd close underlying file descriptor if given as file + parameter (boolean) + @exception NotImplementedError for not implemented method parameters """ self.__encoding = encoding self.__newline = newline @@ -57,7 +66,7 @@ if 'b' not in mode: mode = mode + 'b' - if closefd == False: + if closefd is False: raise NotImplementedError if errors is None: @@ -103,7 +112,8 @@ if self.__encoding is None: return super(File, self).readlines(hint) else: - return [codecs.decode(txt, self.__encoding) for txt in super(File, self).readlines(hint)] + return [codecs.decode(txt, self.__encoding) + for txt in super(File, self).readlines(hint)] def write(self, txt): """
--- a/Utilities/py2flakes/messages.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Utilities/py2flakes/messages.py Tue Nov 05 22:23:38 2013 +0100 @@ -7,6 +7,10 @@ # This module is based on pyflakes for Python2 but was heavily hacked to # work within Eric5 and Qt (translatable messages) +""" +Module implementing the messages for py2flakes. +""" + def QT_TRANSLATE_NOOP(mod, txt): """ @@ -59,7 +63,8 @@ """ Class defining the "Unused Import" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', '{0!r} imported but unused.') def __init__(self, filename, lineno, name): @@ -78,7 +83,8 @@ """ Class defining the "Redefined While Unused" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Redefinition of unused {0!r} from line {1!r}.') def __init__(self, filename, lineno, name, orig_lineno): @@ -95,7 +101,11 @@ class RedefinedInListComp(Message): - message = QT_TRANSLATE_NOOP('py3Flakes', + """ + Class defining the list comprehension redefinition. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'List comprehension redefines {0!r} from line {1!r}.') def __init__(self, filename, lineno, name, orig_lineno): @@ -115,7 +125,8 @@ """ Class defining the "Import Shadowed By Loop Var" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Import {0!r} from line {1!r} shadowed by loop variable.') def __init__(self, filename, lineno, name, orig_lineno): @@ -135,7 +146,8 @@ """ Class defining the "Import Star Used" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', "'from {0} import *' used; unable to detect undefined names.") def __init__(self, filename, lineno, modname): @@ -172,7 +184,8 @@ """ Class defining the "Undefined Export" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Undefined name {0!r} in __all__.') def __init__(self, filename, lineno, name): @@ -191,9 +204,10 @@ """ Class defining the "Undefined Local Variable" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', - "Local variable {0!r} (defined in enclosing scope on line {1!r})" \ - " referenced before assignment.") + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + "Local variable {0!r} (defined in enclosing scope on line {1!r})" + " referenced before assignment.") def __init__(self, filename, lineno, name, orig_lineno): """ @@ -212,7 +226,8 @@ """ Class defining the "Duplicate Argument" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Duplicate argument {0!r} in function definition.') def __init__(self, filename, lineno, name): @@ -231,7 +246,8 @@ """ Class defining the "Redefined" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Redefinition of {0!r} from line {1!r}.') def __init__(self, filename, lineno, name, orig_lineno): @@ -251,7 +267,8 @@ """ Class defining the "Late Future Import" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Future import(s) {0!r} after other statements.') def __init__(self, filename, lineno, names): @@ -273,7 +290,8 @@ Indicates that a variable has been explicitly assigned to but not actually used. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Local variable {0!r} is assigned to but never used.') def __init__(self, filename, lineno, names): @@ -282,7 +300,7 @@ @param filename name of the file (string) @param lineno line number (integer) - @param name name of the unused variable (string) + @param names names of the unused variable (string) """ Message.__init__(self, filename, lineno) self.message_args = (names,)
--- a/Utilities/py3flakes/messages.py Sun Nov 03 16:23:07 2013 +0100 +++ b/Utilities/py3flakes/messages.py Tue Nov 05 22:23:38 2013 +0100 @@ -11,6 +11,7 @@ Module implementing the messages for py3flakes. """ + def QT_TRANSLATE_NOOP(mod, txt): """ Function to tell 'lupdate' which strings to keep for translation. @@ -164,7 +165,8 @@ """ Class defining the "Undefined Export" message. """ - message = QT_TRANSLATE_NOOP('py3Flakes', + message = QT_TRANSLATE_NOOP( + 'py3Flakes', 'Undefined name {0!r} in __all__.') def __init__(self, filename, lineno, name):
--- a/VCS/CommandOptionsDialog.py Sun Nov 03 16:23:07 2013 +0100 +++ b/VCS/CommandOptionsDialog.py Tue Nov 05 22:23:38 2013 +0100 @@ -27,7 +27,7 @@ @param vcs reference to the vcs object @param parent parent widget (QWidget) """ - super(vcsCommandOptionsDialog, self).__init__(parent) + super(VcsCommandOptionsDialog, self).__init__(parent) self.setupUi(self) if Utilities.isWindowsPlatform():
--- a/install.py Sun Nov 03 16:23:07 2013 +0100 +++ b/install.py Tue Nov 05 22:23:38 2013 +0100 @@ -843,7 +843,8 @@ # perform dependency checks if sys.version_info < (2, 6, 0): - print('Sorry, you must have Python 2.6.0 or higher or Python 3.1.0 or higher.') + print('Sorry, you must have Python 2.6.0 or higher or ' + 'Python 3.1.0 or higher.') exit(5) elif sys.version_info < (3, 1, 0) and sys.version_info[0] == 3: print('Sorry, you must have Python 3.1.0 or higher.') @@ -1083,7 +1084,8 @@ global sourceDir, configName, macAppBundleName, macPythonExe if sys.version_info < (2, 6, 0) or sys.version_info > (3, 9, 9): - print('Sorry, eric5 requires at least Python 2.6 or Python 3 for running.') + print('Sorry, eric5 requires at least Python 2.6 or ' + 'Python 3 for running.') exit(5) progName = os.path.basename(argv[0])