@@ -116,7 +116,7 @@ def getParameterFromString(s, context=''):
116
116
if len (params ) > 2 :
117
117
try :
118
118
params [2 ] = [int (p ) for p in params [2 ].split (';' )]
119
- except :
119
+ except ValueError :
120
120
params [2 ] = [getattr (QgsProcessing , p .split ("." )[1 ]) for p in params [2 ].split (';' )]
121
121
if len (params ) > 4 :
122
122
params [4 ] = True if params [4 ].lower () == 'true' else False
@@ -125,7 +125,7 @@ def getParameterFromString(s, context=''):
125
125
params [3 ] = True if params [3 ].lower () == 'true' else False
126
126
try :
127
127
params [4 ] = [int (p ) for p in params [4 ].split (';' )]
128
- except :
128
+ except ValueError :
129
129
params [4 ] = [getattr (QgsProcessing , p .split ("." )[1 ]) for p in params [4 ].split (';' )]
130
130
elif clazz == QgsProcessingParameterBoolean :
131
131
if len (params ) > 2 :
@@ -141,7 +141,7 @@ def getParameterFromString(s, context=''):
141
141
if len (params ) > 4 :
142
142
try :
143
143
params [4 ] = [int (p ) for p in params [4 ].split (';' )]
144
- except :
144
+ except ValueError :
145
145
params [4 ] = [getattr (QgsWkbTypes , p .split ("." )[1 ]) for p in params [4 ].split (';' )]
146
146
if len (params ) > 5 :
147
147
params [5 ] = True if params [5 ].lower () == 'true' else False
@@ -152,7 +152,7 @@ def getParameterFromString(s, context=''):
152
152
if len (params ) > 2 :
153
153
try :
154
154
params [2 ] = int (params [2 ])
155
- except :
155
+ except ValueError :
156
156
params [2 ] = getattr (QgsProcessingParameterNumber , params [2 ].split ("." )[1 ])
157
157
if len (params ) > 4 :
158
158
params [4 ] = True if params [4 ].lower () == 'true' else False
@@ -179,15 +179,15 @@ def getParameterFromString(s, context=''):
179
179
if len (params ) > 2 :
180
180
try :
181
181
params [2 ] = [int (p ) for p in params [2 ].split (';' )]
182
- except :
182
+ except ValueError :
183
183
params [2 ] = [getattr (QgsProcessing , p .split ("." )[1 ]) for p in params [2 ].split (';' )]
184
184
if len (params ) > 4 :
185
185
params [4 ] = True if params [4 ].lower () == 'true' else False
186
186
elif clazz == QgsProcessingParameterMultipleLayers :
187
187
if len (params ) > 2 :
188
188
try :
189
189
params [2 ] = int (params [2 ])
190
- except :
190
+ except ValueError :
191
191
params [2 ] = getattr (QgsProcessing , params [2 ].split ("." )[1 ])
192
192
if len (params ) > 4 :
193
193
params [4 ] = True if params [4 ].lower () == 'true' else False
@@ -204,7 +204,7 @@ def getParameterFromString(s, context=''):
204
204
if len (params ) > 4 :
205
205
try :
206
206
params [4 ] = int (params [4 ])
207
- except :
207
+ except ValueError :
208
208
params [4 ] = getattr (QgsProcessingParameterField , params [4 ].split ("." )[1 ])
209
209
if len (params ) > 5 :
210
210
params [5 ] = True if params [5 ].lower () == 'true' else False
@@ -216,15 +216,15 @@ def getParameterFromString(s, context=''):
216
216
if len (params ) > 2 :
217
217
try :
218
218
params [2 ] = int (params [2 ])
219
- except :
219
+ except ValueError :
220
220
params [2 ] = getattr (QgsProcessingParameterFile , params [2 ].split ("." )[1 ])
221
221
if len (params ) > 5 :
222
222
params [5 ] = True if params [5 ].lower () == 'true' else False
223
223
elif clazz == QgsProcessingParameterNumber :
224
224
if len (params ) > 2 :
225
225
try :
226
226
params [2 ] = int (params [2 ])
227
- except :
227
+ except ValueError :
228
228
params [2 ] = getattr (QgsProcessingParameterNumber , params [2 ].split ("." )[1 ])
229
229
if len (params ) > 3 :
230
230
params [3 ] = float (params [3 ].strip ()) if params [3 ] is not None else None
@@ -263,7 +263,7 @@ def getParameterFromString(s, context=''):
263
263
if len (params ) > 2 :
264
264
try :
265
265
params [2 ] = int (params [2 ])
266
- except :
266
+ except ValueError :
267
267
params [2 ] = getattr (QgsProcessing , params [2 ].split ("." )[1 ])
268
268
if len (params ) > 4 :
269
269
params [4 ] = True if params [4 ].lower () == 'true' else False
0 commit comments