Skip to content
Permalink
Browse files

Always enable OTB settings modification

  • Loading branch information
vpoughon committed Feb 25, 2016
1 parent 02cd0f0 commit 716b17d216ca5370d987774800f269f721228ec4
@@ -86,16 +86,14 @@ def _loadAlgorithms(self):

def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
if OTBUtils.findOtbPath() is None:
ProcessingConfig.addSetting(Setting(self.getDescription(),
OTBUtils.OTB_FOLDER,
self.tr("OTB command line tools folder"), OTBUtils.otbPath(),
valuetype=Setting.FOLDER))
if OTBUtils.findOtbLibPath() is None:
ProcessingConfig.addSetting(Setting(self.getDescription(),
OTBUtils.OTB_LIB_FOLDER,
self.tr("OTB applications folder"), OTBUtils.otbLibPath(),
valuetype=Setting.FOLDER))
ProcessingConfig.addSetting(Setting(self.getDescription(),
OTBUtils.OTB_FOLDER,
self.tr("OTB command line tools folder"), OTBUtils.findOtbPath(),
valuetype=Setting.FOLDER))
ProcessingConfig.addSetting(Setting(self.getDescription(),
OTBUtils.OTB_LIB_FOLDER,
self.tr("OTB applications folder"), OTBUtils.findOtbLibPath(),
valuetype=Setting.FOLDER))
ProcessingConfig.addSetting(Setting(self.getDescription(),
OTBUtils.OTB_SRTM_FOLDER,
self.tr("SRTM tiles folder"), OTBUtils.otbSRTMPath(),
@@ -49,7 +49,7 @@


def findOtbPath():
folder = None
folder = ""
#try to configure the path automatically
if isMac():
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "bin")
@@ -72,14 +72,14 @@ def findOtbPath():


def otbPath():
folder = findOtbPath()
folder = ProcessingConfig.getSetting(OTB_FOLDER)
if folder is None:
folder = ProcessingConfig.getSetting(OTB_FOLDER)
folder = ""
return folder


def findOtbLibPath():
folder = None
folder = ""
#try to configure the path automatically
if isMac():
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "lib/otb/applications")
@@ -101,9 +101,9 @@ def findOtbLibPath():


def otbLibPath():
folder = findOtbLibPath()
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
if folder is None:
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
folder = ""
return folder


0 comments on commit 716b17d

Please sign in to comment.
You can’t perform that action at this time.