Sfoglia il codice sorgente

v.db.addtable: fix wrong formatting code and condition (merge from trunk, https://trac.osgeo.org/grass/changeset/66022)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@66357 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 anni fa
parent
commit
332824cec1
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      scripts/v.db.addtable/v.db.addtable.py

+ 2 - 2
scripts/v.db.addtable/v.db.addtable.py

@@ -125,8 +125,8 @@ def main():
             grass.fatal(_("Unable to create table <%s>") % table)
 
     # connect the map to the DB:
-    if schema is not '':
-        table = '%s.%s' (schema, table)
+    if schema:
+        table = '{schema}.{table}'.format(schema=schema, table=table)
     grass.run_command('v.db.connect', quiet = True,
                       map = map_name, database = database, driver = driver,
                       layer = layer, table = table, key = key)