From d0a74878261a65fe14b32f92a0e2807806b0d527 Mon Sep 17 00:00:00 2001 From: anikaweinmann Date: Fri, 17 Jun 2022 11:45:54 +0200 Subject: [PATCH 1/2] add support to unregister maps form other mapsets --- temporal/t.unregister/t.unregister.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/temporal/t.unregister/t.unregister.py b/temporal/t.unregister/t.unregister.py index f10632af779..b95cfee1665 100755 --- a/temporal/t.unregister/t.unregister.py +++ b/temporal/t.unregister/t.unregister.py @@ -50,7 +50,6 @@ import grass.script as grass - # lazy imports at the end of the file ############################################################################ @@ -77,6 +76,13 @@ def main(): dbif = tgis.SQLDatabaseInterfaceConnection() dbif.connect() + # create new stds only in the current mapset + # remove all connections to any other mapsets + # ugly hack ! + currcon = {} + currcon[mapset] = dbif.connections[mapset] + dbif.connections = currcon + # In case a space time dataset is specified if input: sp = tgis.open_old_stds(input, type, dbif) @@ -129,7 +135,7 @@ def main(): map = tgis.dataset_factory(type, mapid) # Unregister map if in database - if map.is_in_db(dbif): + if map.is_in_db(dbif, mapset=mapset): # Unregister from a single dataset if input: # Collect SQL statements From 9a9a2b69cd87a2b09d263fc49772c157c76dbf9d Mon Sep 17 00:00:00 2001 From: Anika Weinmann <37300249+anikaweinmann@users.noreply.github.com> Date: Fri, 17 Jun 2022 15:46:29 +0200 Subject: [PATCH 2/2] Update temporal/t.unregister/t.unregister.py Co-authored-by: Markus Metz <33666869+metzm@users.noreply.github.com> --- temporal/t.unregister/t.unregister.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporal/t.unregister/t.unregister.py b/temporal/t.unregister/t.unregister.py index b95cfee1665..ec61dfb3129 100755 --- a/temporal/t.unregister/t.unregister.py +++ b/temporal/t.unregister/t.unregister.py @@ -76,7 +76,7 @@ def main(): dbif = tgis.SQLDatabaseInterfaceConnection() dbif.connect() - # create new stds only in the current mapset + # modify a stds only if it is in the current mapset # remove all connections to any other mapsets # ugly hack ! currcon = {}