[wingide-users] PyLint on Save
Marcus.CM
marcus at internetnowasp.net
Sat Aug 9 23:42:23 MDT 2008
Hi,
I manage to get PyLint to be executed everytime i save the module if the
modules are already open when the extension_ide scripts are loaded.
But the problem is if i open a module (.py) and press save, then i will
get an error "tried to execute an unavailable command
.internal.gui.save". I find that if i reload the scripts everytime i open
a module then i wont get this problem and the extension works as
expected. If i open a module from my project without asking Wing to
reloadscripts, then i will get this error.
Any hints?
Marcus.
Wingware Support wrote:
> Marcus.CM wrote:
>> I found some snippets of discussion on this. I would want Pylint to
>> be executed whenever a module is saved. This would iron out some
>> typos and undefined / name bugs
>> that so frequently occurs when renaming / changing lines of codes.
>> How can i do this, i am totally unfamiliar with the IDE extensions
>> scripting and i have tried things like "import pylintpanel" but it
>> cant find the module path :-)
>>
>> Any direction?
>
> You would want to do something like the disabled example at the end
> of scripts/editor_extensions.py, although you would probably want to
> connect to the save-point signal instead of presave. You don't need
> to import pylintpanel, but instead would do this to kick off the
> update:
>
> wingapi.gApplication.ExecuteCommand('pylint-execute')
>
> See the manual to learn more about scripting Wing, and refer to the
> wingapi.py file in your Wing installation for the API.
>
More information about the wingide-users
mailing list