[Qgis-developer] Python plugins style guide

Luiz Motta motta.luiz at gmail.com
Sat Dec 25 22:52:31 EST 2010


The choice about your style depend how you use the tecnology.

At moment, i am migrating for consume of Qt Framework, then, i prefer use
the classes of Qt than Python with the same funcionality, of course, the
code style is closer of QGIS developers.

It is good we has one guide, or one manual of good practices , to plugin in
Python,  facilitating the construction of several persons plugin.

My opinion is use the PyQt4 style, it is more close of QGIS developers.
It is more easy migrate to C++  candidate's  plugins to core

Regards,
Luiz

2010/12/25 Stefan Keller <sfkeller at gmail.com>

> My recommendation is:
>
> 1. Be consistent using whatever style.
> 2. I would prefer Python style (PEP), since Python is read by Python
> programmers and has it's own block style.
>
> Yours, S.
>
> 2010/12/26 Ricardo Filipe Soares Garcia da <ricardo.garcia.silva at gmail.com
> >:
> > Hi list
> >
> > I have been working with Luiz Motta in the 'Custom db query' plugin
> > and we came about the dilemma of how to best format our Python code.
> >
> > Looking around the QGIS wiki, we found the developers manual [1] and
> > read through the coding guidelines, but the rules defined in it are
> > for C++ programming and for QGIS core. We couldn't find anything
> > related to Python and plugins.
> >
> > Has this been debated in the past? Is there a recommended style for
> > formatting Python code in QGIS plugins?
> > I usually follow the recommendation in the PEP8 [2], the official
> > style guide for Python. But Luiz argues (a valid point I guess) that
> > if we were to follow the C++ standard it would be more consistent with
> > the rest of the code.
> >
> > I guess we are in a state where I have my opinion, he has his own, and
> > we'd like to reach a consensus by surveying your thoughts on this
> > subject. Also it seems like a good idea to raise this issue now, with
> > the upcoming possibility of having multiple people collaborating on
> > plugins.
> >
> > Thanks
> >
> > [1] - http://www.qgis.org/wiki/Developers_Manual
> > [2] - http://www.python.org/dev/peps/pep-0008/
> >
> > --
> > ___________________________ ___ __
> > Ricardo Garcia Silva
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> >
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20101226/19a54201/attachment.html


More information about the Qgis-developer mailing list