[Qgis-developer] A common set of functions for QGIS plugins

Alessandro Pasotti apasotti at gmail.com
Mon Nov 2 05:06:18 PST 2015


2015-11-02 13:52 GMT+01:00 Victor Olaya <volayaf at gmail.com>:

> Hi all,
>
> We have discussed sometimes in here about the need of having some
> common functions for plugin developers, to avoid all plugins having to
> reimplement those functions, sometimes not in the most correct way. It
> will also bring some homogeneity to plugins, which I think it is a
> good thing.
>
>
Hello Victor,

this is a brilliant idea!


> With the changes that will be coming to QGIS soon, I think this is a
> good idea to work on, and I have started a small project here to
> create a set of Python modules with those common functions.
>
> https://github.com/volaya/qgiscommons
>
> Not much yet, but I plan to work on that and make it grow during this
> week. With the Hackfest coming, I think it is a good time to ask other
> devs to contribute...
>
> May plan of action is as follows:
>
> - Work on implementing a comprehensive set of functions and classes,
> hopefully with the help of other devs
>
> - Adapt Processing to use it and replace the current set of utilities
> that Processing (like many plugins) has.
>
> - Create a QEP to elevate this set of functions and classes to the
> qgis.utils module, so it has more visibility and it becomes a part of
> QGIS core.
>
> Following this, I believe the next steps that we could take could be:
>
> - Documenting this clearly in the PyCookbook, so all devs are aware of
> this.
>
>
Yes, and also the other way round, the cookbook may already contain many
useful snippets for common patterns that could go into utils functions.



> - Enforcing the use of common functions and classes, and even request
> it before a plugin is accepted for publishing
>
>
I see this a bit more complicated, unless we don't want to review the code
of each plugin by hand, I cannot think of a way to catch the pieces of code
that DO NOT use the common utils.


>
> Since we will be transitioning to Qt5/Python3, this set of common
> functions sounds also like a good place to add all kinds of utilities
> that might help this migration for existing plugins.
>
> Let me know your thoughts
>
> Even if you cannot contribute the code of a function to the repo, feel
> free to open an issue recommending functions that you consider should
> be in there. I will be working on this and will implement all those
> ideas if they sound interesting and useful for other people
>
>

Thank you for bringing this project to the attention of the list.


-- 
Alessandro Pasotti
w3:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151102/17bf7732/attachment.html>


More information about the Qgis-developer mailing list