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? Thanks for any hints, Andreas -- -- Andreas Neumann Böschacherstrasse 10A 8624 Grüt (Gossau ZH) Switzerland _______________________________________________ Qgis-developer mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/qgis-developer |
Did the same as you a while ago and couldn't find a solution :( Marco Bernasocchi (mobile) On Jun 20, 2012 4:07 PM, "Andreas Neumann" <[hidden email]> wrote:
Hi, _______________________________________________ Qgis-developer mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/qgis-developer |
In reply to this post by Andreas Neumann-4
Hi Andreas
On Wed, Jun 20, 2012 at 4:06 PM, Andreas Neumann <[hidden email]> 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 _______________________________________________ Qgis-developer mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/qgis-developer |
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 <[hidden email]> 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 _______________________________________________ Qgis-developer mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/qgis-developer |
Hi Andreas,
On Sun, Jun 24, 2012 at 3:05 AM, Andreas Neumann <[hidden email]> wrote: > Hi Martin, > > Thanks - this helps a lot. Yes - most of the scripts are just in one class. > Just a quick note that I have finished support for browsing, editing, and reloading of custom feature forms and their init scripts, from within QGIS, in my plugin, Plugin Editor [0]. I hope to do an early release next week (Mac-, Linux-only). I would appreciate any testing of editing/reloading of custom feature forms init scripts, especially complex ones like you mention, Andreas. I don't generally use them and need to do more testing. *Does anyone have a project file with data, and a lot of forms and init scripts that they could share?* Currently the reloading method used is the same as what Martin suggested. I will be trying to integrate a customized reloader.py module, with dependency tracking, etc. [1] with this function as well. [0] http://dl.dropbox.com/u/4058089/qgis/feature-forms_8b.png [1] http://osgeo-org.1560.n6.nabble.com/Changes-to-python-utils-py-td4977090.html > > Am 23.06.2012 22:04, schrieb Martin Dobias: >> Hi Andreas >> >> On Wed, Jun 20, 2012 at 4:06 PM, Andreas Neumann <[hidden email]> 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 Regards, Larry Shaffer Dakota Cartography Black Hills, South Dakota _______________________________________________ Qgis-developer mailing list [hidden email] http://lists.osgeo.org/mailman/listinfo/qgis-developer |
Free forum by Nabble | Edit this page |