[Qgis-developer] Developing Init Python Scripts for Forms - Reloading?

Martin Dobias wonder.sk at gmail.com
Sat Jun 23 13:04:41 PDT 2012

Hi Andreas

On Wed, Jun 20, 2012 at 4:06 PM, Andreas Neumann <a.neumann at carto.net> wrote:
> Hi,
> I am developing a rather complex form init script. During development I
> would like to reload the code for testing/debugging. However, I always have
> to fully close and reopen QGIS until the code is refreshed.
> For plugins there is the plugin reloader. Is there similar refresh
> functionality for the form init scripts?

If your script is contained just in one script, then it should be
sufficient to use this statement in python console each time you need
to reload the init script:
>>> reload(my_module_name)

Before calling the reload first time, make sure to import the module
also to the python console:
>>> import my_module_name

Hope that helps. Reloading in case your script consists of multiple
files might be tricky and a better idea would be to restart qgis. In
future there could be a feature for automatic reloads, but that would
require dependency and module timestamp checking...


More information about the Qgis-developer mailing list