[Qgis-developer] Python plugin reloader

Martin Dobias wonder.sk at gmail.com
Tue Jan 26 05:38:38 EST 2010


On Sun, Jan 24, 2010 at 11:40 AM, Borys Jurgiel <borysiasty at aster.pl> wrote:
> Hi Pythonists,
> I've just uploaded to my repo an extremely simple plugin to reload any plugin
> we're working on. It has just two actions:
>
> * one for reloading previously chosen plugin (with the F5 keyboard shortcut)
> * one for selecting the plugin to reload (Shift-F5)

Nice work, Borys!

May I suggest you a small change - to allow devs change the default shortcuts:
Instead of
  self.action1.setShortcut(QKeySequence("F5"))
do
  iface.registerMainWindowAction(action, "F5")

And in unload() method of plugin additionally call
iface.unregisterMainWindowAction(action)
This functionality exists from v1.2 so you might need to check whether
these methods exist.

... so now we just need an integrated debugger ;-) Being able to
inspect variables, set breakpoints, step through python code and look
at context of exception in a nice GUI would make dreams of many
developers true. In meanwhile we can use pdb.

Bye
Martin


More information about the Qgis-developer mailing list