[Qgis-developer] Re: GdalTools versions

Martin Dobias wonder.sk at gmail.com
Mon Jun 7 08:13:48 EDT 2010


2010/6/7 Giuseppe Sucameli <brush.tyler at gmail.com>:
> I guess it's better if I send to you also the complete path list,
>
> maybe it can be useful :)
>
> ['/usr/local/share/qgis/python', '/home/brushtyler/.qgis/python',
> '/home/brushtyler/.qgis/python/plugins',
> '/usr/local/share/qgis/python/plugins', '/usr/lib/python2.6',
> '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk',
> '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload',
> '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL',
> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
> '/usr/lib/python2.6/dist-packages/gtk-2.0',
> '/usr/lib/pymodules/python2.6/gtk-2.0',
> '/usr/local/lib/python2.6/dist-packages',
> u'/home/brushtyler/.qgis//python/plugins',
> '/usr/local/share/qgis/python/plugins/fTools/tools',
> '/usr/local/share/qgis/python/plugins/GdalTools/tools',
> '/usr/local/share/qgis/python/plugins/GdalTools']

Two notes here:
- the path u'/home/brushtyler/.qgis//python/plugins' (nearly at the
bottom) is being added redundantly within updateAvailablePlugins(). I
should probably move all plugin paths logic to QgsApplication to make
it more robust (and give preference to plugins from QGIS_PLUGINPATH
over local and global plugins).

- the last paths have been added by GdalTools (and fTools). I think
this generally is a bad idea and it should be avoided completely. If
there are any files in distinct plugins with the same file names, they
will interfere each other, leading to python errors happening only
under a specific set of loaded plugins. Second, I believe the python
plugins within QGIS source code are used as examples by other plugin
developers, so such practice of altering sys.path to include plugin
subdirs may lead to even more plugins exploiting that.

Cheers
Martin


More information about the Qgis-developer mailing list