Skip to content

Commit

Permalink
[processing] fix path handling (fix #14432)
Browse files Browse the repository at this point in the history
(cherry picked from commit e873540)

Conflicts:
	python/plugins/processing/algs/otb/OTBUtils.py
  • Loading branch information
alexbruy committed Apr 26, 2016
1 parent e657f61 commit 34336e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/grass/GrassUtils.py
Expand Up @@ -86,7 +86,7 @@ def grassPath():
if not isWindows() and not isMac():
return ''

folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER)
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER) or ''
if not os.path.exists(folder):
folder = None
if folder is None:
Expand All @@ -107,7 +107,7 @@ def grassPath():

@staticmethod
def grassWinShell():
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_WIN_SHELL)
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_WIN_SHELL) or ''
if not os.path.exists(folder):
folder = None
if folder is None:
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/Grass7Utils.py
Expand Up @@ -83,7 +83,7 @@ def grassPath():
if not isWindows() and not isMac():
return ''

folder = ProcessingConfig.getSetting(Grass7Utils.GRASS_FOLDER)
folder = ProcessingConfig.getSetting(Grass7Utils.GRASS_FOLDER) or ''
if not os.path.exists(folder):
folder = None
if folder is None:
Expand Down
15 changes: 3 additions & 12 deletions python/plugins/processing/algs/otb/OTBUtils.py
Expand Up @@ -101,24 +101,15 @@ def findOtbLibPath():


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


def otbSRTMPath():
folder = ProcessingConfig.getSetting(OTB_SRTM_FOLDER)
if folder is None:
folder = ""
return folder
return ProcessingConfig.getSetting(OTB_SRTM_FOLDER) or ''


def otbGeoidPath():
filepath = ProcessingConfig.getSetting(OTB_GEOID_FILE)
if filepath is None:
filepath = ""
return filepath
return ProcessingConfig.getSetting(OTB_GEOID_FILE) or ''


def otbDescriptionPath():
Expand Down

0 comments on commit 34336e1

Please sign in to comment.