Bugfixes to work under Python3 and unicode issues for Python2 fixed. BgService

Fri, 17 Jan 2014 23:38:29 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Fri, 17 Jan 2014 23:38:29 +0100
branch
BgService
changeset 3228
f489068e51e8
parent 3209
c5432abceb25
child 3241
957673fc463a

Bugfixes to work under Python3 and unicode issues for Python2 fixed.

Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Wed Jan 15 22:55:52 2014 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py	Fri Jan 17 23:38:29 2014 +0100
@@ -7,8 +7,6 @@
 Module implementing the code style checker.
 """
 
-from __future__ import unicode_literals
-
 import sys
 
 import pep8
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Wed Jan 15 22:55:52 2014 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Fri Jan 17 23:38:29 2014 +0100
@@ -25,10 +25,6 @@
 import Utilities
 
 from . import pep8
-#from .NamingStyleChecker import NamingStyleChecker
-#
-## register the name checker
-#pep8.register_check(NamingStyleChecker, NamingStyleChecker.Codes)
 
 
 class CodeStyleCheckerDialog(QDialog, Ui_CodeStyleCheckerDialog):
@@ -776,7 +772,7 @@
         self.__options[5] = True
         self.__options[6] = self.lineLengthSpinBox.value()
         
-        self.files = fixesDict.keys()
+        self.files = list(fixesDict.keys())
         # now go through all the files
         self.progress = 0
         self.files.sort()
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py	Wed Jan 15 22:55:52 2014 +0100
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py	Fri Jan 17 23:38:29 2014 +0100
@@ -18,7 +18,12 @@
 import sys
 import tokenize
 
-import pep8
+# CodeStyleCheckerDialog tries to import FixableCodeStyleIssues what fail under
+# Python3. So ignore it.
+try:
+    import pep8
+except ImportError:
+    pass
 
 # Tell 'lupdate' which strings to keep for translation.
 QT_TRANSLATE_NOOP = lambda mod, txt: txt
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Wed Jan 15 22:55:52 2014 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py	Fri Jan 17 23:38:29 2014 +0100
@@ -7,8 +7,6 @@
 """
 Module implementing the syntax check for Python 2/3.
 """
-from __future__ import unicode_literals
-
 import re
 import sys
 import traceback

eric ide

mercurial