[GRASS-SVN] r61891 - grass/trunk/scripts/db.droptable

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 13 09:11:34 PDT 2014


Author: lucadelu
Date: 2014-09-13 09:11:34 -0700 (Sat, 13 Sep 2014)
New Revision: 61891

Modified:
   grass/trunk/scripts/db.droptable/db.droptable.py
Log:
db.droptable: fix pep8

Modified: grass/trunk/scripts/db.droptable/db.droptable.py
===================================================================
--- grass/trunk/scripts/db.droptable/db.droptable.py	2014-09-13 14:24:39 UTC (rev 61890)
+++ grass/trunk/scripts/db.droptable/db.droptable.py	2014-09-13 16:11:34 UTC (rev 61891)
@@ -52,7 +52,7 @@
 
     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 @@
     # 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()



More information about the grass-commit mailing list