[Qgis-developer] Re: GdalTools versions

Giuseppe Sucameli brush.tyler at gmail.com
Tue Jun 8 16:13:22 EDT 2010


Hi Martin,

GdalTools was based on the fTools structure.
So I think that every change we're doing on GdalTools should
be done on fTools too. Have we to inform Carson Farmer?

On Tue, Jun 8, 2010 at 9:32 PM, Martin Dobias <wonder.sk at gmail.com> wrote:

> Hi Giuseppe
>
> 2010/6/8 Giuseppe Sucameli <brush.tyler at gmail.com>:
> > 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:
> > [...]
>
> This is an error caused by the unloader of plugins - I've found out
> that it fails to record the modules that are imported with syntax
> "from X import Y" and that results in some inconsistencies. I'm going
> to fix that soon.
>
> On a different note, I have a performance hint for GdalTools:
> It's not necessary to import all the do* modules at the startup. They
> are necessary only when they're triggered from the menu, so the import
> can be postponed to the point when they're needed and some time from
> the qgis startup can be saved. I see you load all the modules to check
> whether there aren't any missing dependencies. This could be actually
> done even easier:
>
> try:
>  import osgeo.ogr
>  import osgeo.gdal
> except ImportError:
>  # tell user about missing python-gdal
>

Yes, we could load every do* module when required (on trigger) and
on startup try to import only the required modules.
I'm going to change it.

Cheers.

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


More information about the Qgis-developer mailing list