Skip to content

Commit

Permalink
formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Feb 24, 2015
1 parent 24811af commit be07f23
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py
Expand Up @@ -85,7 +85,8 @@ def defineCharacteristics(self):
self.addParameter(ParameterString(self.PK, self.addParameter(ParameterString(self.PK,
self.tr('Primary key'), 'id', optional=True)) self.tr('Primary key'), 'id', optional=True))
self.addParameter(ParameterTableField(self.PRIMARY_KEY, self.addParameter(ParameterTableField(self.PRIMARY_KEY,
self.tr('Primary key (existing field, used if the above option is left empty)'), self.INPUT_LAYER, optional=True)) self.tr('Primary key (existing field, used if the above option is left empty)'),
self.INPUT_LAYER, optional=True))
self.addParameter(ParameterString(self.WHERE, self.addParameter(ParameterString(self.WHERE,
self.tr('Select features using a SQL "WHERE" statement (Ex: column="value")'), self.tr('Select features using a SQL "WHERE" statement (Ex: column="value")'),
'', optional=True)) '', optional=True))
Expand Down Expand Up @@ -148,12 +149,12 @@ def processAlgorithm(self, progress):
arguments.append('port=') arguments.append('port=')
arguments.append(port) arguments.append(port)
if len(dbname) > 0: if len(dbname) > 0:
arguments.append('dbname='+dbname) arguments.append('dbname=' + dbname)
if len(password) > 0: if len(password) > 0:
arguments.append('password='+password) arguments.append('password=' + password)
arguments.append('user='+user+'"') arguments.append('user=' + user + '"')
arguments.append(ogrLayer) arguments.append(ogrLayer)
arguments.append('-nlt NONE') arguments.append('-nlt NONE')
arguments.append(self.ogrLayerName(inLayer)) arguments.append(self.ogrLayerName(inLayer))
if launder: if launder:
arguments.append(launderstring) arguments.append(launderstring)
Expand All @@ -167,7 +168,7 @@ def processAlgorithm(self, progress):
arguments.append(schemastring) arguments.append(schemastring)
if len(pk) > 0: if len(pk) > 0:
arguments.append(pkstring) arguments.append(pkstring)
elif primary_key != None: elif primary_key is not None:
arguments.append("-lco FID="+primary_key) arguments.append("-lco FID="+primary_key)
if len(table) > 0: if len(table) > 0:
arguments.append('-nln') arguments.append('-nln')
Expand All @@ -179,7 +180,7 @@ def processAlgorithm(self, progress):
if len(gt) > 0: if len(gt) > 0:
arguments.append('-gt') arguments.append('-gt')
arguments.append(gt) arguments.append(gt)
if precision is False: if not precision:
arguments.append('-lco PRECISION=NO') arguments.append('-lco PRECISION=NO')
if len(options) > 0: if len(options) > 0:
arguments.append(options) arguments.append(options)
Expand All @@ -191,4 +192,4 @@ def processAlgorithm(self, progress):
else: else:
commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)] commands = ['ogr2ogr', GdalUtils.escapeAndJoin(arguments)]


GdalUtils.runGdal(commands, progress) GdalUtils.runGdal(commands, progress)

0 comments on commit be07f23

Please sign in to comment.