diff --git a/gui/wxpython/gui_core/forms.py b/gui/wxpython/gui_core/forms.py index 14d87728057..f52090678a8 100644 --- a/gui/wxpython/gui_core/forms.py +++ b/gui/wxpython/gui_core/forms.py @@ -2408,9 +2408,15 @@ def OnCheckItem(index=None, flag=None, event=None): pSqlWhere.append(p) # collect ids - pColumnIds = [p["wxId"] for p in pColumn] - pLayerIds = [p["wxId"] for p in pLayer] - pSqlWhereIds = [p["wxId"] for p in pSqlWhere] + pColumnIds = [] + for p in pColumn: + pColumnIds += p["wxId"] + pLayerIds = [] + for p in pLayer: + pLayerIds += p["wxId"] + pSqlWhereIds = [] + for p in pSqlWhere: + pSqlWhereIds += p["wxId"] # set wxId-bindings if pMap: diff --git a/python/grass/grassdb/checks.py b/python/grass/grassdb/checks.py index 052addac248..a458ad71432 100644 --- a/python/grass/grassdb/checks.py +++ b/python/grass/grassdb/checks.py @@ -20,7 +20,6 @@ import grass.grassdb.config as cfg import grass.script as gs from grass.script import gisenv -from itertools import starmap def mapset_exists(path: str | os.PathLike[str], location=None, mapset=None) -> bool: @@ -525,7 +524,10 @@ def get_reasons_locations_not_removable(locations): Returns messages as list if there were any failed checks, otherwise empty list. """ - return list(starmap(get_reasons_location_not_removable, locations)) + messages = [] + for grassdb, location in locations: + messages += get_reasons_location_not_removable(grassdb, location) + return messages def get_reasons_location_not_removable(grassdb, location): @@ -556,7 +558,9 @@ def get_reasons_location_not_removable(grassdb, location): ) # Append to the list of tuples - mapsets = [(grassdb, location, g_mapset) for g_mapset in g_mapsets] + mapsets = [] + for g_mapset in g_mapsets: + mapsets.append((grassdb, location, g_mapset)) # Concentenate both checks messages += get_reasons_mapsets_not_removable(mapsets, check_permanent=False) @@ -585,7 +589,9 @@ def get_reasons_grassdb_not_removable(grassdb): g_locations = get_list_of_locations(grassdb) # Append to the list of tuples - locations = [(grassdb, g_location) for g_location in g_locations] + locations = [] + for g_location in g_locations: + locations.append((grassdb, g_location)) return get_reasons_locations_not_removable(locations) @@ -596,11 +602,12 @@ def get_list_of_locations(dbase): :return: list of locations (sorted) """ - locations = [ - os.path.basename(location) - for location in glob.glob(os.path.join(dbase, "*")) - if os.path.join(location, "PERMANENT") in glob.glob(os.path.join(location, "*")) - ] + locations = [] + for location in glob.glob(os.path.join(dbase, "*")): + if os.path.join(location, "PERMANENT") in glob.glob( + os.path.join(location, "*") + ): + locations.append(os.path.basename(location)) locations.sort(key=lambda x: x.lower())