Fixed a few issues with the various checkers related to checking an unsaved file. 5_1_x

Mon, 21 Mar 2011 20:03:40 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 21 Mar 2011 20:03:40 +0100
branch
5_1_x
changeset 955
377efd9104a7
parent 951
08ecc72adb94
child 957
ff469c60f5fe

Fixed a few issues with the various checkers related to checking an unsaved file.

Plugins/PluginPep8Checker.py file | annotate | diff | comparison | revisions
Plugins/PluginSyntaxChecker.py file | annotate | diff | comparison | revisions
Plugins/PluginTabnanny.py file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
diff -r 08ecc72adb94 -r 377efd9104a7 Plugins/PluginPep8Checker.py
--- a/Plugins/PluginPep8Checker.py	Sat Mar 19 16:08:57 2011 +0100
+++ b/Plugins/PluginPep8Checker.py	Mon Mar 21 20:03:40 2011 +0100
@@ -265,7 +265,7 @@
         """
         editor = e5App().getObject("ViewManager").activeWindow()
         if editor is not None:
-            if editor.checkDirty():
+            if editor.checkDirty() and editor.getFileName() is not None:
                 self.__editorPep8CheckerDialog = Pep8Dialog()
                 self.__editorPep8CheckerDialog.show()
                 self.__editorPep8CheckerDialog.start(
diff -r 08ecc72adb94 -r 377efd9104a7 Plugins/PluginSyntaxChecker.py
--- a/Plugins/PluginSyntaxChecker.py	Sat Mar 19 16:08:57 2011 +0100
+++ b/Plugins/PluginSyntaxChecker.py	Mon Mar 21 20:03:40 2011 +0100
@@ -244,7 +244,8 @@
         """
         editor = e5App().getObject("ViewManager").activeWindow()
         if editor is not None:
-            self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog()
-            self.__editorSyntaxCheckerDialog.show()
-            self.__editorSyntaxCheckerDialog.start(editor.getFileName(), 
-                                                   editor.text())
+            if editor.checkDirty():
+                self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog()
+                self.__editorSyntaxCheckerDialog.show()
+                self.__editorSyntaxCheckerDialog.start(
+                    editor.getFileName() or "Unnamed.py", editor.text())
diff -r 08ecc72adb94 -r 377efd9104a7 Plugins/PluginTabnanny.py
--- a/Plugins/PluginTabnanny.py	Sat Mar 19 16:08:57 2011 +0100
+++ b/Plugins/PluginTabnanny.py	Mon Mar 21 20:03:40 2011 +0100
@@ -247,9 +247,7 @@
         """
         editor = e5App().getObject("ViewManager").activeWindow()
         if editor is not None:
-            if not editor.checkDirty():
-                return
-            
-            self.__editorTabnannyDialog = TabnannyDialog()
-            self.__editorTabnannyDialog.show()
-            self.__editorTabnannyDialog.start(editor.getFileName())
+            if editor.checkDirty() and editor.getFileName() is not None:
+                self.__editorTabnannyDialog = TabnannyDialog()
+                self.__editorTabnannyDialog.show()
+                self.__editorTabnannyDialog.start(editor.getFileName())
diff -r 08ecc72adb94 -r 377efd9104a7 QScintilla/Editor.py
--- a/QScintilla/Editor.py	Sat Mar 19 16:08:57 2011 +0100
+++ b/QScintilla/Editor.py	Mon Mar 21 20:03:40 2011 +0100
@@ -4228,7 +4228,7 @@
                             Preferences.getFlakes("IgnoreStarImportWarnings")
                         try:
                             txt = self.text().replace("\r\n", "\n").replace("\r", "\n")
-                            warnings = Checker(txt, self.fileName)
+                            warnings = Checker(txt, self.fileName or "(Unnamed)")
                             warnings.messages.sort(key = lambda a: a.lineno)
                             for warning in warnings.messages:
                                 if ignoreStarImportWarnings and \

eric ide

mercurial