37
37
from processing .parameters .ParameterBoolean import ParameterBoolean
38
38
from processing .parameters .ParameterSelection import ParameterSelection
39
39
from processing .outputs .OutputVector import OutputVector
40
- from processing .tools import dataobjects , vector
40
+ from processing .tools import dataobjects , vector , system
41
41
42
42
from processing .algs .ui .FieldsCalculatorDialog import FieldsCalculatorDialog
43
43
@@ -85,6 +85,10 @@ def processAlgorithm(self, progress):
85
85
86
86
output = self .getOutputFromName (self .OUTPUT_LAYER )
87
87
88
+ if output .value == '' :
89
+ ext = output .getDefaultFileExtension (self )
90
+ output .value = system .getTempFilenameInTempFolder (output .name + '.' + ext )
91
+
88
92
provider = layer .dataProvider ()
89
93
fields = layer .pendingFields ()
90
94
if newField :
@@ -143,7 +147,6 @@ def processAlgorithm(self, progress):
143
147
'An error occured while evaluating the calculation '
144
148
'string:\n ' + error )
145
149
146
-
147
150
def checkParameterValuesBeforeExecuting (self ):
148
151
newField = self .getParameterValue (self .NEW_FIELD )
149
152
fieldName = self .getParameterValue (self .FIELD_NAME )
@@ -156,6 +159,5 @@ def checkParameterValuesBeforeExecuting(self):
156
159
raise GeoAlgorithmExecutionException ('Output is not set. '
157
160
'Please specify valid filename' )
158
161
159
-
160
162
def getCustomParametersDialog (self ):
161
163
return FieldsCalculatorDialog (self )
0 commit comments