diff --git a/python/plugins/GdalTools/GdalTools.py b/python/plugins/GdalTools/GdalTools.py index 6784e9d9da97..86ed0b97b65f 100644 --- a/python/plugins/GdalTools/GdalTools.py +++ b/python/plugins/GdalTools/GdalTools.py @@ -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 ) - - 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 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 ) except ImportError, e: error_str = str(e) error_mod = error_str.replace( "No module named ", "" ) diff --git a/python/plugins/GdalTools/tools/doAbout.py b/python/plugins/GdalTools/tools/doAbout.py index f7cd60b8b9b7..8fefb1a18192 100644 --- a/python/plugins/GdalTools/tools/doAbout.py +++ b/python/plugins/GdalTools/tools/doAbout.py @@ -6,18 +6,7 @@ from qgis.gui import * from ui_dialogAbout import Ui_GdalToolsAboutDialog as Ui_Dialog - -# 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 ) - +from GdalTools import version class GdalToolsAboutDialog(QDialog, Ui_Dialog):