[Qgis-developer] Python support in project file

Victor Olaya volayaf at gmail.com
Wed May 23 12:35:07 PDT 2012


Giuseppe

This is awesome from the point of view of SEXTANTE. One of the biggest
problems in SEXTANTE for gvSIG is that, if you have saved your results
as temporary files, the project will keep a link to them, but they
will be deleted once you exit the program. This problem appears also
in QGIS, but it woould be solved if I could add a script to be
executed when saving a project, so it can check that layers are not
temporary (and if they are, save them to a permanent location).

Even, the algorithms used to generate a given layer could be stored in
the project file, so if a layer is missing, it could be recomputed if
the input ones are available.

Looking forward to knowing more about it and starting working on those
features. If there is anything I can do to help you, tell me and I
will see what I can do.

Regards

Victor

2012/5/23 Giuseppe Sucameli <brush.tyler at gmail.com>:
> Hi all,
>
> I started to work on adding python support in project files (see [1]).
>
> I've added a new tab "Project routines" to the project properties dialog
> where the user can define 3 different python routines:
>
> one is executed when the project is loaded,
> the next one when the project is saved,
> and the last one when the project is closed (saved or not).
>
> I'm also adding a safe-check, it asks to the user if enabling them.
>
> I've few questions:
>
> 1. In [1] Martin wrote: """The routines should be able to access QGIS
> application with the use of the interface in the same way how plugins do""".
> I'm wondering if those routines must be functions with a specific signature
> or they could just access the QGis interface using the qgis.utils.iface
> since I'll use the QgsPythonRunner to run them.
>
> 2. In a loaded project with trusted scripts (the user has trusted them)
> if the user changes their definitions from project properties dialog
> 2.a. should the new routines become active immediately when the user
> clicks on the apply button in the project properies dialog,
> 2.b. or should become active when he saves the project (the new
> projectSaved script has to be called just after the project is saved),
> 2.c. or should I keep the previous ones until the project is reloaded?
>
> 3. should I call them project-embedded-scripts or routines??? :)
>
> Opinions are welcome.
> Cheers.
>
> [1] http://hub.qgis.org/wiki/quantum-gis/Google_Summer_of_Code_2012#Python-Support-in-Project-Files
>
> --
> Giuseppe Sucameli
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list