[GRASS-SVN] r57581 - grass/trunk/temporal/t.remove
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 1 02:21:35 PDT 2013
Author: huhabla
Date: 2013-09-01 02:21:35 -0700 (Sun, 01 Sep 2013)
New Revision: 57581
Modified:
grass/trunk/temporal/t.remove/t.remove.py
Log:
More efficient use of pygrass Module class
Modified: grass/trunk/temporal/t.remove/t.remove.py
===================================================================
--- grass/trunk/temporal/t.remove/t.remove.py 2013-09-01 07:16:13 UTC (rev 57580)
+++ grass/trunk/temporal/t.remove/t.remove.py 2013-09-01 09:21:35 UTC (rev 57581)
@@ -59,7 +59,6 @@
############################################################################
-
def main():
# Get the options
@@ -106,6 +105,9 @@
statement = ""
+ # Create the pygrass Module object for g.remove
+ remove = pyg.Module("g.remove", quiet=True, run_=False)
+
for name in dataset_list:
name = name.strip()
sp = tgis.open_old_space_time_dataset(name, type, dbif)
@@ -125,14 +127,14 @@
# Delete every 100 maps
if count%100 == 0:
dbif.execute_transaction(map_statement)
- pyg.Module("g.remove", rast=name_list, quiet=True)
+ remove(rast=name_list, run_=True)
map_statement = ""
name_list = []
if map_statement:
dbif.execute_transaction(map_statement)
if name_list:
- pyg.Module("g.remove", rast=name_list, quiet=True)
+ remove(rast=name_list, run_=True)
statement += sp.delete(dbif=dbif, execute=False)
More information about the grass-commit
mailing list