Commit ad86dc0 1 parent 140a01f commit ad86dc0 Copy full SHA for ad86dc0
File tree 1 file changed +13
-1
lines changed
python/plugins/processing/algs/taudem
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def taudemDescriptionPath():
102
102
def executeTauDEM (command , progress ):
103
103
loglines = []
104
104
loglines .append (TauDEMUtils .tr ('TauDEM execution console output' ))
105
- command = escapeAndJoin (command )
105
+ command = TauDEMUtils . escapeAndJoin (command )
106
106
fused_command = '' .join (['"%s" ' % c for c in command ])
107
107
progress .setInfo (TauDEMUtils .tr ('TauDEM command:' ))
108
108
progress .setCommand (fused_command .replace ('" "' , ' ' ).strip ('"' ))
@@ -124,3 +124,15 @@ def tr(string, context=''):
124
124
if context == '' :
125
125
context = 'TauDEMUtils'
126
126
return QCoreApplication .translate (context , string )
127
+
128
+ @staticmethod
129
+ def escapeAndJoin (strList ):
130
+ joined = ''
131
+ for s in strList :
132
+ if s [0 ] != '-' and ' ' in s :
133
+ escaped = '"' + s .replace ('\\ ' , '\\ \\ ' ).replace ('"' , '\\ "' ) \
134
+ + '"'
135
+ else :
136
+ escaped = s
137
+ joined += escaped + ' '
138
+ return joined .strip ()
You can’t perform that action at this time.
0 commit comments