Hi Martin, <br><br>GdalTools was based on the fTools structure. <br>So I think that every change we&#39;re doing on GdalTools should <br>be done on fTools too. Have we to inform Carson Farmer?<br><br><div class="gmail_quote">

On Tue, Jun 8, 2010 at 9:32 PM, Martin Dobias <span dir="ltr">&lt;<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi Giuseppe<br>
<br>
2010/6/8 Giuseppe Sucameli &lt;<a href="mailto:brush.tyler@gmail.com">brush.tyler@gmail.com</a>&gt;:<br>
<div class="im">&gt; Hi Martin,<br>
&gt;<br>
&gt; now the modules import is done by the following lines:<br>
&gt; from tools import GdalTools_utils as Utils<br>
&gt; from tools import ( doBuildVRT, doContour, doRasterize, doPolygonize,<br>
&gt; doMerge, doSieve, doProximity, doNearBlack )<br>
&gt; from tools import ( doWarp, doGrid, doTranslate, doClipper, doInfo,<br>
&gt; doProjection, doOverview, doRgbPct, doPctRgb )<br>
&gt; from tools import ( doSettings, doAbout )<br>
&gt;<br>
&gt; and GdalTools works fine until I reload it.<br>
&gt; In fact, If I reload it I get this error:<br>
</div>&gt; [...]<br>
<br>
This is an error caused by the unloader of plugins - I&#39;ve found out<br>
that it fails to record the modules that are imported with syntax<br>
&quot;from X import Y&quot; and that results in some inconsistencies. I&#39;m going<br>
to fix that soon.<br>
<br>
On a different note, I have a performance hint for GdalTools:<br>
It&#39;s not necessary to import all the do* modules at the startup. They<br>
are necessary only when they&#39;re triggered from the menu, so the import<br>
can be postponed to the point when they&#39;re needed and some time from<br>
the qgis startup can be saved. I see you load all the modules to check<br>
whether there aren&#39;t any missing dependencies. This could be actually<br>
done even easier:<br>
<br>
try:<br>
  import osgeo.ogr<br>
  import osgeo.gdal<br>
except ImportError:<br>
  # tell user about missing python-gdal<br></blockquote><div> </div><div>Yes, we could load every do* module when required (on trigger) and <br>on startup try to import only the required modules.<br>I&#39;m going to change it.<br>

<br>Cheers.<br><br></div></div>-- <br>Giuseppe Sucameli<br>