diff --git a/python/grass/temporal/core.py b/python/grass/temporal/core.py index d3c1ec59524..07e360fce44 100644 --- a/python/grass/temporal/core.py +++ b/python/grass/temporal/core.py @@ -470,7 +470,7 @@ def stop_subprocesses(): atexit.register(stop_subprocesses) -def get_available_temporal_mapsets(): +def get_available_temporal_mapsets(only_current_mapset=False): """Return a list of of mapset names with temporal database driver and names that are accessible from the current mapset. @@ -480,7 +480,10 @@ def get_available_temporal_mapsets(): global c_library_interface global message_interface - mapsets = c_library_interface.available_mapsets() + if only_current_mapset: + mapsets = [get_current_mapset()] + else: + mapsets = c_library_interface.available_mapsets() tgis_mapsets = {} @@ -1066,8 +1069,8 @@ def _create_tgis_metadata_table(content, dbif=None): class SQLDatabaseInterfaceConnection(object): - def __init__(self): - self.tgis_mapsets = get_available_temporal_mapsets() + def __init__(self, only_current_mapset=False): + self.tgis_mapsets = get_available_temporal_mapsets(only_current_mapset) self.current_mapset = get_current_mapset() self.connections = {} self.connected = False