[QGIS Commit] r13684 - in trunk/qgis/python/plugins/GdalTools: . tools

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Jun 7 17:55:06 EDT 2010


Author: brushtyler
Date: 2010-06-07 17:55:03 -0400 (Mon, 07 Jun 2010)
New Revision: 13684

Modified:
   trunk/qgis/python/plugins/GdalTools/GdalTools.py
   trunk/qgis/python/plugins/GdalTools/tools/doAbout.py
Log:
import the modules without use the path


Modified: trunk/qgis/python/plugins/GdalTools/GdalTools.py
===================================================================
--- trunk/qgis/python/plugins/GdalTools/GdalTools.py	2010-06-07 19:59:53 UTC (rev 13683)
+++ trunk/qgis/python/plugins/GdalTools/GdalTools.py	2010-06-07 21:55:03 UTC (rev 13684)
@@ -29,20 +29,11 @@
 req_mods = { "osgeo": "osgeo [python-gdal]" }
 
 try:
-  # Set up current path, so that we know where to look for modules
-  import os.path, sys
-  currentPath = os.path.dirname( __file__ )
-  modulesPath = os.path.abspath( currentPath + '/tools' )
-  sys.path.append( modulesPath )
+  from tools import GdalTools_utils as Utils
 
-  import GdalTools_utils as Utils
-
-  import doBuildVRT, doContour, doRasterize, doPolygonize, doMerge, doSieve, doProximity, doNearBlack
-  import doWarp, doGrid, doTranslate, doClipper, doInfo, doProjection, doOverview, doRgbPct, doPctRgb
-  import doSettings, doAbout
-
-  sys.path.remove( modulesPath )
-
+  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 )
 except ImportError, e:
   error_str = str(e)
   error_mod = error_str.replace( "No module named ", "" )

Modified: trunk/qgis/python/plugins/GdalTools/tools/doAbout.py
===================================================================
--- trunk/qgis/python/plugins/GdalTools/tools/doAbout.py	2010-06-07 19:59:53 UTC (rev 13683)
+++ trunk/qgis/python/plugins/GdalTools/tools/doAbout.py	2010-06-07 21:55:03 UTC (rev 13684)
@@ -6,19 +6,8 @@
 from qgis.gui import *
 
 from ui_dialogAbout import Ui_GdalToolsAboutDialog as Ui_Dialog
+from GdalTools import version
 
-# Set up current path, so that we know where to look for version
-import os.path, sys
-currentPath = os.path.dirname( __file__ )
-pluginPath = os.path.abspath( currentPath + "/.." )
-sys.path.append( pluginPath )
-
-# prepended the module name, to avoid conflicts with other __init__ modules in search path
-from GdalTools.__init__ import version
-
-sys.path.remove( pluginPath )
-
-
 class GdalToolsAboutDialog(QDialog, Ui_Dialog):
 
   def __init__(self, iface):



More information about the QGIS-commit mailing list