Skip to content

Commit 34336e1

Browse files
committedApr 26, 2016
[processing] fix path handling (fix #14432)
(cherry picked from commit e873540) Conflicts: python/plugins/processing/algs/otb/OTBUtils.py
1 parent e657f61 commit 34336e1

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed
 

‎python/plugins/processing/algs/grass/GrassUtils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def grassPath():
8686
if not isWindows() and not isMac():
8787
return ''
8888

89-
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER)
89+
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER) or ''
9090
if not os.path.exists(folder):
9191
folder = None
9292
if folder is None:
@@ -107,7 +107,7 @@ def grassPath():
107107

108108
@staticmethod
109109
def grassWinShell():
110-
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_WIN_SHELL)
110+
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_WIN_SHELL) or ''
111111
if not os.path.exists(folder):
112112
folder = None
113113
if folder is None:

‎python/plugins/processing/algs/grass7/Grass7Utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def grassPath():
8383
if not isWindows() and not isMac():
8484
return ''
8585

86-
folder = ProcessingConfig.getSetting(Grass7Utils.GRASS_FOLDER)
86+
folder = ProcessingConfig.getSetting(Grass7Utils.GRASS_FOLDER) or ''
8787
if not os.path.exists(folder):
8888
folder = None
8989
if folder is None:

‎python/plugins/processing/algs/otb/OTBUtils.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,15 @@ def findOtbLibPath():
101101

102102

103103
def otbLibPath():
104-
folder = findOtbLibPath()
105-
if folder is None:
106-
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
107-
return folder
104+
return ProcessingConfig.getSetting(OTB_LIB_FOLDER) or ''
108105

109106

110107
def otbSRTMPath():
111-
folder = ProcessingConfig.getSetting(OTB_SRTM_FOLDER)
112-
if folder is None:
113-
folder = ""
114-
return folder
108+
return ProcessingConfig.getSetting(OTB_SRTM_FOLDER) or ''
115109

116110

117111
def otbGeoidPath():
118-
filepath = ProcessingConfig.getSetting(OTB_GEOID_FILE)
119-
if filepath is None:
120-
filepath = ""
121-
return filepath
112+
return ProcessingConfig.getSetting(OTB_GEOID_FILE) or ''
122113

123114

124115
def otbDescriptionPath():

0 commit comments

Comments
 (0)
Please sign in to comment.