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

Andreas Neumann a.neumann at carto.net
Sun Jun 24 02:05:13 PDT 2012


Hi Martin,

Thanks - this helps a lot. Yes - most of the scripts are just in one class.

Your hint saves me quite some time!

Thank you,
Andreas

Am 23.06.2012 22:04, schrieb Martin Dobias:
> 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...
> 
> Martin



More information about the Qgis-developer mailing list