[GRASS-SVN] r51248 - in grass/trunk/temporal: t.info t.remove
t.support t.topology t.unregister tr.aggregate
tr.aggregate.ds tr.export tr.extract tr.mapcalc tr.out.vtk
tr.series tr.to.rast3 tr.univar tr3.extract tv.observe.strds
tv.what.strds
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Apr 4 05:24:56 EDT 2012
Author: huhabla
Date: 2012-04-04 02:24:56 -0700 (Wed, 04 Apr 2012)
New Revision: 51248
Modified:
grass/trunk/temporal/t.info/t.info.py
grass/trunk/temporal/t.remove/t.remove.py
grass/trunk/temporal/t.support/t.support.py
grass/trunk/temporal/t.topology/t.topology.py
grass/trunk/temporal/t.unregister/t.unregister.py
grass/trunk/temporal/tr.aggregate.ds/tr.aggregate.ds.py
grass/trunk/temporal/tr.aggregate/tr.aggregate.py
grass/trunk/temporal/tr.export/tr.export.py
grass/trunk/temporal/tr.extract/tr.extract.py
grass/trunk/temporal/tr.mapcalc/tr.mapcalc.py
grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py
grass/trunk/temporal/tr.series/tr.series.py
grass/trunk/temporal/tr.to.rast3/tr.to.rast3.py
grass/trunk/temporal/tr.univar/tr.univar.py
grass/trunk/temporal/tr3.extract/tr3.extract.py
grass/trunk/temporal/tv.observe.strds/tv.observe.strds.py
grass/trunk/temporal/tv.what.strds/tv.what.strds.py
Log:
Unified error message when space time dataset is not found
Modified: grass/trunk/temporal/t.info/t.info.py
===================================================================
--- grass/trunk/temporal/t.info/t.info.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/t.info/t.info.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -84,7 +84,7 @@
sp = tgis.dataset_factory(type, id)
if sp.is_in_db() == False:
- grass.fatal(_("Dataset <%s> not found in temporal database") % name)
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select()
Modified: grass/trunk/temporal/t.remove/t.remove.py
===================================================================
--- grass/trunk/temporal/t.remove/t.remove.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/t.remove/t.remove.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -105,22 +105,13 @@
if sp.is_in_db(dbif) == False:
dbif.close()
- grass.fatal(_("%s dataset <%s> not found in temporal database") % (sp.get_type(), name))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
statement += sp.delete(dbif=dbif, execute=False)
# Execute the collected SQL statenents
- sql_script = ""
- sql_script += "BEGIN TRANSACTION;\n"
- sql_script += statement
- sql_script += "END TRANSACTION;"
- # print sql_script
+ tgis.execute_transaction(statement, dbif)
- if tgis.dbmi.__name__ == "sqlite3":
- dbif.cursor.executescript(statement)
- else:
- dbif.cursor.execute(statement)
-
dbif.close()
if __name__ == "__main__":
Modified: grass/trunk/temporal/t.support/t.support.py
===================================================================
--- grass/trunk/temporal/t.support/t.support.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/t.support/t.support.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -89,7 +89,8 @@
else:
id = name + "@" + mapset
- dbif, connect = tgis.init_dbif(None)
+ dbif = tgis.sql_database_interface()
+ dbif.connect()
sp = tgis.dataset_factory(type, id)
Modified: grass/trunk/temporal/t.topology/t.topology.py
===================================================================
--- grass/trunk/temporal/t.topology/t.topology.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/t.topology/t.topology.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -60,7 +60,7 @@
sp = tgis.dataset_factory(type, id)
if sp.is_in_db() == False:
- grass.fatal("Dataset <" + name + "> not found in temporal database")
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
# Insert content from db
sp.select()
Modified: grass/trunk/temporal/t.unregister/t.unregister.py
===================================================================
--- grass/trunk/temporal/t.unregister/t.unregister.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/t.unregister/t.unregister.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -63,7 +63,8 @@
mapset = grass.gisenv()["MAPSET"]
- dbif, connect = tgis.init_dbif(None)
+ dbif = tgis.sql_database_interface()
+ dbif.connect()
# In case a space time dataset is specified
if name:
Modified: grass/trunk/temporal/tr.aggregate/tr.aggregate.py
===================================================================
--- grass/trunk/temporal/tr.aggregate/tr.aggregate.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.aggregate/tr.aggregate.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -108,7 +108,7 @@
if sp.is_in_db() == False:
dbif.close()
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select(dbif)
Modified: grass/trunk/temporal/tr.aggregate.ds/tr.aggregate.ds.py
===================================================================
--- grass/trunk/temporal/tr.aggregate.ds/tr.aggregate.ds.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.aggregate.ds/tr.aggregate.ds.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -95,7 +95,7 @@
if sp.is_in_db() == False:
dbif.close()
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select(dbif)
Modified: grass/trunk/temporal/tr.export/tr.export.py
===================================================================
--- grass/trunk/temporal/tr.export/tr.export.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.export/tr.export.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -88,7 +88,7 @@
sp = tgis.space_time_raster_dataset(id)
if sp.is_in_db() == False:
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
# Save current working directory path
old_cwd = os.getcwd()
Modified: grass/trunk/temporal/tr.extract/tr.extract.py
===================================================================
--- grass/trunk/temporal/tr.extract/tr.extract.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.extract/tr.extract.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -84,7 +84,7 @@
sp = tgis.space_time_raster_dataset(id)
if sp.is_in_db() == False:
- grass.fatal(_("Space time arster dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
if expression and not base:
grass.fatal(_("Please specify base="))
Modified: grass/trunk/temporal/tr.mapcalc/tr.mapcalc.py
===================================================================
--- grass/trunk/temporal/tr.mapcalc/tr.mapcalc.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.mapcalc/tr.mapcalc.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -105,7 +105,7 @@
if first_input.is_in_db(dbif) == False:
dbif.close()
- grass.fatal(_("Space time raster dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
# Fill the object with data from the temporal database
first_input.select(dbif)
Modified: grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py
===================================================================
--- grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -103,7 +103,7 @@
sp = tgis.space_time_raster_dataset(id)
if sp.is_in_db() == False:
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select()
Modified: grass/trunk/temporal/tr.series/tr.series.py
===================================================================
--- grass/trunk/temporal/tr.series/tr.series.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.series/tr.series.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -81,7 +81,7 @@
sp = tgis.space_time_raster_dataset(id)
if sp.is_in_db() == False:
- grass.fatal(_("Space time raster dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select()
Modified: grass/trunk/temporal/tr.to.rast3/tr.to.rast3.py
===================================================================
--- grass/trunk/temporal/tr.to.rast3/tr.to.rast3.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.to.rast3/tr.to.rast3.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -52,7 +52,7 @@
sp = tgis.space_time_raster_dataset(id)
if sp.is_in_db() == False:
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select()
Modified: grass/trunk/temporal/tr.univar/tr.univar.py
===================================================================
--- grass/trunk/temporal/tr.univar/tr.univar.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr.univar/tr.univar.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -76,7 +76,7 @@
if sp.is_in_db(dbif) == False:
dbif.close()
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select(dbif)
Modified: grass/trunk/temporal/tr3.extract/tr3.extract.py
===================================================================
--- grass/trunk/temporal/tr3.extract/tr3.extract.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tr3.extract/tr3.extract.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -81,7 +81,7 @@
sp = tgis.space_time_raster3d_dataset(id)
if sp.is_in_db() == False:
- grass.fatal(_("Space time raster3d dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
dbif = tgis.sql_database_interface()
dbif.connect()
Modified: grass/trunk/temporal/tv.observe.strds/tv.observe.strds.py
===================================================================
--- grass/trunk/temporal/tv.observe.strds/tv.observe.strds.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tv.observe.strds/tv.observe.strds.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -90,7 +90,7 @@
if strds_sp.is_in_db() == False:
dbif.close()
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
strds_sp.select(dbif)
Modified: grass/trunk/temporal/tv.what.strds/tv.what.strds.py
===================================================================
--- grass/trunk/temporal/tv.what.strds/tv.what.strds.py 2012-04-04 08:55:14 UTC (rev 51247)
+++ grass/trunk/temporal/tv.what.strds/tv.what.strds.py 2012-04-04 09:24:56 UTC (rev 51248)
@@ -82,7 +82,7 @@
if sp.is_in_db() == False:
dbif.close()
- grass.fatal(_("Dataset <%s> not found in temporal database") % (id))
+ grass.fatal(_("Space time %s dataset <%s> not found") % (sp.get_new_map_instance(None).get_type(), id))
sp.select(dbif)
More information about the grass-commit
mailing list