[Qgis-developer] py plugin updates, consensus __init__.py

Borys Jurgiel lists at borysjurgiel.pl
Tue Jun 11 12:29:15 PDT 2013


Dnia wtorek, 11 czerwca 2013 o 21:08:05 Richard Duivenvoorde napisał(a):
> Hi Devs,
> 
> seeking for some consensus about the content of __init__.py
> 
> am I correct that we cannot do without the __init__.py as this adds the
> classFactory(iface) member to the 'pluginmodule'-class?
> 
> (I tried to add the method to my main class, but that did not work)

QGIS needs a fixed location where to look for the classFactory(), so 
__init__.py is the most obvious solution. Otherwise we would need to require 
other py file with a fixed name, what wouldn't change much.

> But then should we not delete ALL other member defs from the __init__.py?
> For clarity, and just to have just one place to define that metadata.

Exactly, __init__.py shouldn't duplicate any data from metadata.txt, so 
usually may contain just classFactory() only. 


More information about the Qgis-developer mailing list