Skip to content

Commit

Permalink
temporal dbif for current mapset only
Browse files Browse the repository at this point in the history
  • Loading branch information
metzm committed Jun 20, 2022
1 parent 2af9d79 commit 53baae9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions python/grass/temporal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 = {}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 53baae9

Please sign in to comment.