Adjustments to future imports for Python 2 compatibility. 6_1_x

Fri, 13 Nov 2015 22:52:26 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Fri, 13 Nov 2015 22:52:26 +0100
branch
6_1_x
changeset 4557
893c9f26a178
parent 4551
31115c8c20fc
child 4558
069c28a30ad1

Adjustments to future imports for Python 2 compatibility.
(grafted from 861e1741985c9818dfd45f5ffc73a51cf4e9bda8)

Debugger/DebugClientCapabilities.py file | annotate | diff | comparison | revisions
DocumentationTools/Config.py file | annotate | diff | comparison | revisions
DocumentationTools/__init__.py file | annotate | diff | comparison | revisions
E5Network/E5RFC6266.py file | annotate | diff | comparison | revisions
E5XML/Config.py file | annotate | diff | comparison | revisions
Helpviewer/HelpInspector.py file | annotate | diff | comparison | revisions
Helpviewer/Sync/SyncGlobals.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/McCabeChecker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/mccabe.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/pep8.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgClient.py file | annotate | diff | comparison | revisions
Project/ProjectBrowserFlags.py file | annotate | diff | comparison | revisions
ThirdParty/Send2Trash/send2trash/__init__.py file | annotate | diff | comparison | revisions
ThirdParty/Send2Trash/send2trash/compat.py file | annotate | diff | comparison | revisions
ThirdParty/Send2Trash/send2trash/plat_gio.py file | annotate | diff | comparison | revisions
UI/Config.py file | annotate | diff | comparison | revisions
Utilities/PySideImporter.py file | annotate | diff | comparison | revisions
--- a/Debugger/DebugClientCapabilities.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Debugger/DebugClientCapabilities.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module defining the debug clients capabilities.
 """
 
-from __future__ import unicode_literals
-
 HasDebugger = 0x0001
 HasInterpreter = 0x0002
 HasProfiler = 0x0004
@@ -19,3 +17,6 @@
 
 HasAll = HasDebugger | HasInterpreter | HasProfiler | \
     HasCoverage | HasCompleter | HasUnittest | HasShell
+
+#
+# eflag: noqa = M702
--- a/DocumentationTools/Config.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/DocumentationTools/Config.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module defining different default values for the documentation tools package.
 """
 
-from __future__ import unicode_literals
-
 # the default colors for the eric6 documentation generator
 eric6docDefaultColors = {
     'BodyColor': '#000000',
@@ -34,3 +32,6 @@
     'LinkColor': 'link-color',
 
 }
+
+#
+# eflag: noqa = M702
--- a/DocumentationTools/__init__.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/DocumentationTools/__init__.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,10 +7,11 @@
 Package implementing the source code documentation tools.
 """
 
-from __future__ import unicode_literals
-
 supportedExtensionsDictForApis = {
     "Python2": [".py2", ".pyw2", ".ptl"],
     "Python3": [".py", ".pyw", ".py3", ".pyw3"],
     "Ruby": [".rb"]
 }
+
+#
+# eflag: noqa = M702
--- a/E5Network/E5RFC6266.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/E5Network/E5RFC6266.py	Fri Nov 13 22:52:26 2015 +0100
@@ -39,7 +39,7 @@
             """
             if key in self:
                 raise DuplicateParamError(key)
-            super().__setitem__(key, value)
+            super(UniqueNamespace, self).__setitem__(key, value)
 
     # RFC 2616
     separator_chars = "()<>@,;:\\\"/[]?={} \t"      # __IGNORE_WARNING__
@@ -88,7 +88,7 @@
         grammar = re.compile(r'"({0}|{1})+"'.format(quoted_pair_re, qdtext_re))
 
         def __str__(self):
-            s = super().__str__()
+            s = super(QuotedString, self).__str__()
             s = s[1:-1]  # remove quotes
             s = re.sub(r'\\(.)', r'\1', s)  # drop backslashes
             return s
@@ -142,7 +142,7 @@
         regex = re.compile(token_re + r'\*')
 
         def __str__(self):
-            return super().__str__().lower()
+            return super(ExtToken, self).__str__().lower()
 
     class NoExtToken(peg.Symbol):
         """
@@ -151,7 +151,7 @@
         regex = re.compile(token_re + r'(?<!\*)')
 
         def __str__(self):
-            return super().__str__().lower()
+            return super(NoExtToken, self).__str__().lower()
 
     class DispositionParm(str):
         """
--- a/E5XML/Config.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/E5XML/Config.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module implementing some common configuration stuf for the XML package.
 """
 
-from __future__ import unicode_literals
-
 # version number of the multi project file
 multiProjectFileFormatVersion = "5.1"
 
@@ -38,3 +36,6 @@
 
 # version number of the highlighting styles file
 highlightingStylesFileFormatVersion = "4.3"
+
+#
+# eflag: noqa = M702
--- a/Helpviewer/HelpInspector.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Helpviewer/HelpInspector.py	Fri Nov 13 22:52:26 2015 +0100
@@ -38,7 +38,7 @@
         @type QCloseEvent
         """
         Preferences.setGeometry("HelpInspectorGeometry", self.saveGeometry())
-        super().closeEvent(evt)
+        super(HelpInspector, self).closeEvent(evt)
 
     def __reloadGeometry(self):
         """
--- a/Helpviewer/Sync/SyncGlobals.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Helpviewer/Sync/SyncGlobals.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module implementing some global definitions.
 """
 
-from __future__ import unicode_literals
-
 # Page IDs for the sync wizard
 PageData = 0
 PageEncryption = 1
@@ -21,3 +19,6 @@
 SyncTypeNone = -1
 SyncTypeFtp = 0
 SyncTypeDirectory = 1
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module implementing the code style checker.
 """
 
-from __future__ import unicode_literals
-
 import sys
 import multiprocessing
 
@@ -308,3 +306,6 @@
                 result[-1] = errMsg
 
     return stats, results
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py	Fri Nov 13 22:52:26 2015 +0100
@@ -12,8 +12,6 @@
 # pep257.py (version 0.2.4).
 #
 
-from __future__ import unicode_literals
-
 try:
     # Python 2
     from StringIO import StringIO       # __IGNORE_EXCEPTION__
@@ -1282,3 +1280,6 @@
                 if firstWord != 'public':
                     self.__error(docstringContext.start() + lineNumber, 0,
                                  "D232", 'public')
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/CodeStyleChecker/McCabeChecker.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/McCabeChecker.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module implementing a checker for code complexity.
 """
 
-from __future__ import unicode_literals
-
 import sys
 import ast
 
@@ -124,3 +122,6 @@
             if graph.complexity() > self.__maxComplexity:
                 self.__error(graph.lineno, 0, "C101",
                              graph.entity, graph.complexity())
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/MiscellaneousChecker.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module implementing a checker for miscellaneous checks.
 """
 
-from __future__ import unicode_literals
-
 import sys
 import ast
 import re
@@ -618,3 +616,6 @@
                     self.__isBaseString(node.args[0])):
                 self.calls[node.args[0]] = (node, True)
         super(TextVisitor, self).generic_visit(node)
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module implementing a checker for naming conventions.
 """
 
-from __future__ import unicode_literals
-
 import collections
 import ast
 import re
@@ -444,3 +442,6 @@
                 yield self.__error(node, "N813")
             elif self.UppercaseRegexp.match(name.asname):
                 yield self.__error(node, "N814")
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/CodeStyleChecker/mccabe.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/mccabe.py	Fri Nov 13 22:52:26 2015 +0100
@@ -213,3 +213,6 @@
         self.dispatch_list(node.body)
     
     visitAsyncWith = visitWith
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/CodeStyleChecker/pep8.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/pep8.py	Fri Nov 13 22:52:26 2015 +0100
@@ -1986,3 +1986,6 @@
 
 if __name__ == '__main__':
     _main()
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Fri Nov 13 22:52:26 2015 +0100
@@ -8,8 +8,6 @@
 Module implementing the syntax check for Python 2/3.
 """
 
-from __future__ import unicode_literals
-
 import ast
 import re
 import sys
@@ -293,3 +291,6 @@
         results.append((filename, err.lineno, 0, "FLAKES_ERROR", msg, []))
     
     return [{'warnings': results}]
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Package containg pyflakes adapted for Qt.
 """
 
-from __future__ import unicode_literals
-
 """ License
 Copyright 2005-2011 Divmod, Inc.
 Copyright 2013-2014 Florent Xicluna
@@ -169,3 +167,6 @@
 """
 
 __version__ = '1.0.0'
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py	Fri Nov 13 22:52:26 2015 +0100
@@ -932,3 +932,6 @@
         if isinstance(node.name, str):
             self.handleNodeStore(node)
         self.handleChildren(node)
+
+#
+# eflag: noqa = M702
--- a/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py	Fri Nov 13 22:52:26 2015 +0100
@@ -11,8 +11,6 @@
 Module providing the class Message and its subclasses.
 """
 
-from __future__ import unicode_literals
-
 
 class Message(object):
     """
@@ -309,3 +307,6 @@
     """
     message_id = 'F15'
     message = '\'return\' outside function'
+
+#
+# eflag: noqa = M702
--- a/Plugins/VcsPlugins/vcsMercurial/HgClient.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgClient.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module implementing an interface to the Mercurial command server.
 """
 
-from __future__ import unicode_literals
-
 try:
     str = unicode
 except NameError:
@@ -391,3 +389,6 @@
         @return flag indicating the execution of a command (boolean)
         """
         return self.__commandRunning
+
+#
+# eflag: noqa = M702
--- a/Project/ProjectBrowserFlags.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Project/ProjectBrowserFlags.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module defining the project browser flags.
 """
 
-from __future__ import unicode_literals
-
 SourcesBrowserFlag = 1
 FormsBrowserFlag = 2
 ResourcesBrowserFlag = 4
@@ -21,3 +19,6 @@
     TranslationsBrowserFlag | \
     InterfacesBrowserFlag | \
     OthersBrowserFlag
+
+#
+# eflag: noqa = M702
--- a/ThirdParty/Send2Trash/send2trash/__init__.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/ThirdParty/Send2Trash/send2trash/__init__.py	Fri Nov 13 22:52:26 2015 +0100
@@ -4,6 +4,8 @@
 # which should be included with this package. The terms are also available at 
 # http://www.hardcoded.net/licenses/bsd_license
 
+from __future__ import unicode_literals
+
 import sys
 
 if sys.platform == 'darwin':
--- a/ThirdParty/Send2Trash/send2trash/compat.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/ThirdParty/Send2Trash/send2trash/compat.py	Fri Nov 13 22:52:26 2015 +0100
@@ -4,6 +4,8 @@
 # which should be included with this package. The terms are also available at 
 # http://www.hardcoded.net/licenses/bsd_license
 
+from __future__ import unicode_literals
+
 import sys
 if sys.version < '3':
     text_type = unicode
--- a/ThirdParty/Send2Trash/send2trash/plat_gio.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/ThirdParty/Send2Trash/send2trash/plat_gio.py	Fri Nov 13 22:52:26 2015 +0100
@@ -4,6 +4,8 @@
 # which should be included with this package. The terms are also available at 
 # http://www.hardcoded.net/licenses/bsd_license
 
+from __future__ import unicode_literals
+
 from gi.repository import GObject, Gio
 
 def send2trash(path):
--- a/UI/Config.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/UI/Config.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,9 @@
 Module defining common data to be used by all windows..
 """
 
-from __future__ import unicode_literals
-
 from PyQt5.QtCore import QSize
 
 ToolBarIconSize = QSize(20, 18)
+
+#
+# eflag: noqa = M702
--- a/Utilities/PySideImporter.py	Sat Nov 07 15:54:09 2015 +0100
+++ b/Utilities/PySideImporter.py	Fri Nov 13 22:52:26 2015 +0100
@@ -7,8 +7,6 @@
 Module to check for the presence of PySide by importing it.
 """
 
-from __future__ import unicode_literals
-
 import sys
 
 if __name__ == "__main__":
@@ -21,4 +19,4 @@
     sys.exit(ret)
     
 #
-# eflag: FileType = Python2
+# eflag: noqa = M702

eric ide

mercurial