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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 21 Mar 2011 20:03:13 +0100
changeset 954
a096fdc38f71
parent 953
7c42d54ba205
child 956
f3e1500da1df

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
--- a/Plugins/PluginPep8Checker.py	Sun Mar 20 18:18:12 2011 +0100
+++ b/Plugins/PluginPep8Checker.py	Mon Mar 21 20:03:13 2011 +0100
@@ -266,7 +266,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(
--- a/Plugins/PluginSyntaxChecker.py	Sun Mar 20 18:18:12 2011 +0100
+++ b/Plugins/PluginSyntaxChecker.py	Mon Mar 21 20:03:13 2011 +0100
@@ -245,7 +245,7 @@
         """
         editor = e5App().getObject("ViewManager").activeWindow()
         if editor is not None:
-            self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog()
-            self.__editorSyntaxCheckerDialog.show()
-            self.__editorSyntaxCheckerDialog.start(editor.getFileName(),
-                                                   editor.text())
+                self.__editorSyntaxCheckerDialog = SyntaxCheckerDialog()
+                self.__editorSyntaxCheckerDialog.show()
+                self.__editorSyntaxCheckerDialog.start(
+                    editor.getFileName() or "Unnamed.py", editor.text())
--- a/Plugins/PluginTabnanny.py	Sun Mar 20 18:18:12 2011 +0100
+++ b/Plugins/PluginTabnanny.py	Mon Mar 21 20:03:13 2011 +0100
@@ -248,9 +248,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())
--- a/QScintilla/Editor.py	Sun Mar 20 18:18:12 2011 +0100
+++ b/QScintilla/Editor.py	Mon Mar 21 20:03:13 2011 +0100
@@ -4227,7 +4227,7 @@
                             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