Fix the syntaxcheck if only one file is tested. Fix seldom bug if last line has unicode characters in it. Py2 comp.

Tue, 19 Nov 2013 22:36:36 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Tue, 19 Nov 2013 22:36:36 +0100
branch
Py2 comp.
changeset 3099
d5dcda74d839
parent 3088
7f1e291875d9
child 3127
e47a9d5954e8

Fix the syntaxcheck if only one file is tested. Fix seldom bug if last line has unicode characters in it.

Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py file | annotate | diff | comparison | revisions
Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Sat Nov 16 19:58:22 2013 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Tue Nov 19 22:36:36 2013 +0100
@@ -156,8 +156,8 @@
         else:
             files = [fn]
         
-        if codestring == '' and len(files) > 0:
-            self.checkProgress.setMaximum(len(files))
+        if codestring or len(files) > 0:
+            self.checkProgress.setMaximum(max(1, len(files)))
             QApplication.processEvents()
             
             # now go through all the files
--- a/Utilities/__init__.py	Sat Nov 16 19:58:22 2013 +0100
+++ b/Utilities/__init__.py	Tue Nov 19 22:36:36 2013 +0100
@@ -463,8 +463,9 @@
     else:
         lines = text
     for line in reversed(lines):
-        index = line.find("eflag:")
-        if index == -1:
+        try:
+            index = line.index("eflag:")
+        except ValueError:
             # no flag found, don't look any further
             break
         

eric ide

mercurial