Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions temporal/t.unregister/t.unregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

import grass.script as grass


# lazy imports at the end of the file

############################################################################
Expand All @@ -77,6 +76,13 @@ def main():
dbif = tgis.SQLDatabaseInterfaceConnection()
dbif.connect()

# modify a stds only if it is in the current mapset
# remove all connections to any other mapsets
# ugly hack !
currcon = {}
currcon[mapset] = dbif.connections[mapset]
dbif.connections = currcon
Comment thread
wenzeslaus marked this conversation as resolved.

# In case a space time dataset is specified
if input:
sp = tgis.open_old_stds(input, type, dbif)
Expand Down Expand Up @@ -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
Expand Down