@@ -85,7 +85,8 @@ def defineCharacteristics(self):
85
85
self .addParameter (ParameterString (self .PK ,
86
86
self .tr ('Primary key' ), 'id' , optional = True ))
87
87
self .addParameter (ParameterTableField (self .PRIMARY_KEY ,
88
- self .tr ('Primary key (existing field, used if the above option is left empty)' ), self .INPUT_LAYER , optional = True ))
88
+ self .tr ('Primary key (existing field, used if the above option is left empty)' ),
89
+ self .INPUT_LAYER , optional = True ))
89
90
self .addParameter (ParameterString (self .WHERE ,
90
91
self .tr ('Select features using a SQL "WHERE" statement (Ex: column="value")' ),
91
92
'' , optional = True ))
@@ -148,12 +149,12 @@ def processAlgorithm(self, progress):
148
149
arguments .append ('port=' )
149
150
arguments .append (port )
150
151
if len (dbname ) > 0 :
151
- arguments .append ('dbname=' + dbname )
152
+ arguments .append ('dbname=' + dbname )
152
153
if len (password ) > 0 :
153
- arguments .append ('password=' + password )
154
- arguments .append ('user=' + user + '"' )
154
+ arguments .append ('password=' + password )
155
+ arguments .append ('user=' + user + '"' )
155
156
arguments .append (ogrLayer )
156
- arguments .append ('-nlt NONE' )
157
+ arguments .append ('-nlt NONE' )
157
158
arguments .append (self .ogrLayerName (inLayer ))
158
159
if launder :
159
160
arguments .append (launderstring )
@@ -167,7 +168,7 @@ def processAlgorithm(self, progress):
167
168
arguments .append (schemastring )
168
169
if len (pk ) > 0 :
169
170
arguments .append (pkstring )
170
- elif primary_key != None :
171
+ elif primary_key is not None :
171
172
arguments .append ("-lco FID=" + primary_key )
172
173
if len (table ) > 0 :
173
174
arguments .append ('-nln' )
@@ -179,7 +180,7 @@ def processAlgorithm(self, progress):
179
180
if len (gt ) > 0 :
180
181
arguments .append ('-gt' )
181
182
arguments .append (gt )
182
- if precision is False :
183
+ if not precision :
183
184
arguments .append ('-lco PRECISION=NO' )
184
185
if len (options ) > 0 :
185
186
arguments .append (options )
@@ -191,4 +192,4 @@ def processAlgorithm(self, progress):
191
192
else :
192
193
commands = ['ogr2ogr' , GdalUtils .escapeAndJoin (arguments )]
193
194
194
- GdalUtils .runGdal (commands , progress )
195
+ GdalUtils .runGdal (commands , progress )
0 commit comments