<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-11-02 13:52 GMT+01:00 Victor Olaya <span dir="ltr"><<a href="mailto:volayaf@gmail.com" target="_blank">volayaf@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
We have discussed sometimes in here about the need of having some<br>
common functions for plugin developers, to avoid all plugins having to<br>
reimplement those functions, sometimes not in the most correct way. It<br>
will also bring some homogeneity to plugins, which I think it is a<br>
good thing.<br>
<br></blockquote><div><br></div><div>Hello Victor,<br><br></div><div>this is a brilliant idea!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
With the changes that will be coming to QGIS soon, I think this is a<br>
good idea to work on, and I have started a small project here to<br>
create a set of Python modules with those common functions.<br>
<br>
<a href="https://github.com/volaya/qgiscommons" rel="noreferrer" target="_blank">https://github.com/volaya/qgiscommons</a><br>
<br>
Not much yet, but I plan to work on that and make it grow during this<br>
week. With the Hackfest coming, I think it is a good time to ask other<br>
devs to contribute...<br>
<br>
May plan of action is as follows:<br>
<br>
- Work on implementing a comprehensive set of functions and classes,<br>
hopefully with the help of other devs<br>
<br>
- Adapt Processing to use it and replace the current set of utilities<br>
that Processing (like many plugins) has.<br>
<br>
- Create a QEP to elevate this set of functions and classes to the<br>
qgis.utils module, so it has more visibility and it becomes a part of<br>
QGIS core.<br>
<br>
Following this, I believe the next steps that we could take could be:<br>
<br>
- Documenting this clearly in the PyCookbook, so all devs are aware of this.<br>
<br></blockquote><div><br></div><div>Yes, and also the other way round, the cookbook may already contain many useful snippets for common patterns that could go into utils functions.<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- Enforcing the use of common functions and classes, and even request<br>
it before a plugin is accepted for publishing<br>
<br></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Since we will be transitioning to Qt5/Python3, this set of common<br>
functions sounds also like a good place to add all kinds of utilities<br>
that might help this migration for existing plugins.<br>
<br>
Let me know your thoughts<br>
<br>
Even if you cannot contribute the code of a function to the repo, feel<br>
free to open an issue recommending functions that you consider should<br>
be in there. I will be working on this and will implement all those<br>
ideas if they sound interesting and useful for other people<br>
<br></blockquote></div><br><br></div><div class="gmail_extra">Thank you for bringing this project to the attention of the list.<br><br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">Alessandro Pasotti<br>w3:   <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div>
</div></div>