[Qgis-developer] Re: GdalTools versions

Giuseppe Sucameli brush.tyler at gmail.com
Tue Jun 8 11:25:05 EDT 2010


Hi Martin,

now the modules import is done by the following lines:
*from tools import GdalTools_utils as Utils
from tools import ( doBuildVRT, doContour, doRasterize, doPolygonize,
doMerge, doSieve, doProximity, doNearBlack )
from tools import ( doWarp, doGrid, doTranslate, doClipper, doInfo,
doProjection, doOverview, doRgbPct, doPctRgb )
from tools import ( doSettings, doAbout )*

and GdalTools works fine until I reload it.
In fact, If I reload it I get this error:

 Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/qgis/utils.py", line 150, in
startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/usr/local/share/qgis/python/plugins/GdalTools/__init__.py", line
30, in classFactory
    from GdalTools import GdalTools
  File "/usr/lib/python2.6/dist-packages/qgis/utils.py", line 291, in
_import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/local/share/qgis/python/plugins/GdalTools/GdalTools.py", line
42, in
    raise ImportError( error_str )
ImportError: cannot import name doBuildVRT


I tried to change all the import lines, using i.e.

*import tools.doBuildVRT as doBuildVRT
*

but nothing.


How can I resolve it? I guess this error it's not related with GdalTools...


Cheers.

On Tue, Jun 8, 2010 at 1:26 PM, Borys Jurgiel <borysiasty at aster.pl> wrote:

> Dnia wtorek, 8 czerwca 2010 o 13:07:53 Giuseppe Sucameli napisał(a):
> > Hi Borys,
> >
> > On Mon, Jun 7, 2010 at 10:39 PM, Borys Jurgiel <borysiasty at aster.pl>
> wrote:
> > > if QGis.QGIS_VERSION[2] < 5:
> > >  [set paths and install the local translator]
> >
> > I'm not sure the code above works always.
> > When the QGis'll become 2.0 that condition still works? AFAIK it won't.
> >
> > Regards.
>
> Right, it seems the API changes won't be so huge to block all the 1.x
> plugins
> by default, so they can be prepared for 2.0. So you can use:
>
> Gis.QGIS_VERSION[0:3] < '1.5'
>
> (sorry for previous mistake, it returns a string, not an int)
>
>


-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100608/88e3b4de/attachment-0001.html


More information about the Qgis-developer mailing list