Mon, 21 Mar 2011 20:03:13 +0100
Fixed a few issues with the various checkers related to checking an unsaved file.
--- 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 \