浏览代码

db.droptable: fix pep8

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61891 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 10 年之前
父节点
当前提交
f865c7927e
共有 1 个文件被更改,包括 14 次插入13 次删除
  1. 14 13
      scripts/db.droptable/db.droptable.py

+ 14 - 13
scripts/db.droptable/db.droptable.py

@@ -52,7 +52,7 @@ def main():
 
     if not options['driver'] or not options['database']:
         # check if DB parameters are set, and if not set them.
-        grass.run_command('db.connect', flags = 'c')
+        grass.run_command('db.connect', flags='c')
 
     kv = grass.db_connection()
     if options['database']:
@@ -66,32 +66,33 @@ def main():
     # schema needed for PG?
 
     if force:
-	grass.message(_("Forcing ..."))
+        grass.message(_("Forcing ..."))
 
     # check if table exists
     if not grass.db_table_exist(table):
-	grass.fatal(_("Table <%s> not found in database <%s>") % \
-                        (table, database))
+        grass.fatal(_("Table <%s> not found in database <%s>") %
+                    (table, database))
 
     # check if table is used somewhere (connected to vector map)
     used = grass.db.db_table_in_vector(table)
     if len(used) > 0:
-	grass.warning(_("Deleting table <%s> which is attached to following map(s):") % table)
-	for vect in used:
-	    grass.warning("%s" % vect)
+        grass.warning(_("Deleting table <%s> which is attached to following map(s):") % table)
+        for vect in used:
+            grass.warning("%s" % vect)
 
     if not force:
-	grass.message(_("The table <%s> would be deleted.") % table)
-	grass.message("")
-	grass.message(_("You must use the force flag to actually remove it. Exiting."))
-	sys.exit(0)
+        grass.message(_("The table <%s> would be deleted.") % table)
+        grass.message("")
+        grass.message(_("You must use the force flag to actually remove it. Exiting."))
+        sys.exit(0)
 
-    p = grass.feed_command('db.execute', input = '-', database = database, driver = driver)
+    p = grass.feed_command('db.execute', input='-', database=database,
+                           driver=driver)
     p.stdin.write("DROP TABLE " + table)
     p.stdin.close()
     p.wait()
     if p.returncode != 0:
-  	grass.fatal(_("Cannot continue (problem deleting table)."))
+        grass.fatal(_("Cannot continue (problem deleting table)."))
 
 if __name__ == "__main__":
     options, flags = grass.parser()