[wingide-users] Some more scripting questions
support at wingware.com
Sat Jul 1 18:26:11 EDT 2006
On Sat, 1 Jul 2006, Markus Meyer wrote:
> While working on the PyLint integration, some more scripting questions
> came up:
> * When I restart the IDE, the script's toolbox is gone. This happens
> also for the "Templates" toolbox. How can I make it persistent?
This is a bug. I have a fix but it needs more testing before we
try to base a patch on it. At worst, it'll be fixed in 2.1.1.
> * I'd like to always save the file before PyLint is run. But when I add
> "GetActiveEditor().ExecuteCommand("save")" right before executing
> PyLint, PyLint returns an error. It seems that the "save" command is
> somehow executing asynchronously. How can I make sure that it is
> completed before calling PyLint? Is there a more elegant way to this?
Sorry, this isn't very clear and the error reporting is
non-existent but you want to call this on the application object
Although there's a 'save-buffer' command on the editor it looks
like the current API isn't set up to call that properly (for
somewhat obscure reasons).
> * Alternatively, I'd like to add an option to run PyLint everytime the
> user has saved a file explicitely. Say, the user presses "Ctrl+S" to
> save the file (I do this all the time after major changes), the
> "execute-pylint" command should automatically be executed. Is this possible?
You could connect to the 'save-point' signal on the document
object. See scripts/editor_extentions.py for an example of
connecting to 'presave'; the code you need would be similar. It's
a bit weak because 'undo' after changes gets you back to a save
point also but it should work well enough for this case.
We'll try to fix the various nits this has uncovered in the API.
Wing IDE for Python
Advancing Software Development
More information about the wingide-users