Skip to content

Commit 14ddd13

Browse files
committed
Code tidying.
1 parent 2050c2a commit 14ddd13

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

mapserver/server/flatmap.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@
6868

6969
PATHWAYS_CACHE = 'pathways.json'
7070

71-
def pathways_metadata(map_uuid: str) -> dict[str, Any]:
72-
#======================================================
71+
def pathways(map_uuid: str) -> dict[str, Any]:
72+
#=============================================
7373
pathways_file = pathlib.Path(settings['FLATMAP_ROOT']) / map_uuid / PATHWAYS_CACHE
7474
try:
7575
with open(pathways_file) as fp:
7676
return json.load(fp)
7777
except Exception:
7878
pass
79-
metadata = json_map_metadata(map_uuid, 'pathways')
79+
pathways = json_map_metadata(map_uuid, 'pathways')
8080
with open(pathways_file, 'w') as fp:
81-
json.dump(metadata, fp)
82-
return metadata
81+
json.dump(pathways, fp)
82+
return pathways
8383

8484
#===============================================================================
8585
#===============================================================================
@@ -252,7 +252,7 @@ async def flatmap_metadata(map_uuid: str) -> dict:
252252
@get('flatmap/{map_uuid:str}/pathways')
253253
async def flatmap_pathways(map_uuid: str) -> dict:
254254
try:
255-
return pathways_metadata(map_uuid)
255+
return pathways(map_uuid)
256256
except IOError as err:
257257
raise exceptions.NotFoundException(detail=str(err))
258258

@@ -262,10 +262,10 @@ async def flatmap_pathways(map_uuid: str) -> dict:
262262
async def flatmap_connectivity(map_uuid: str, path_id: str) -> dict:
263263
path_id = path_id[1:] # Remove leading '/''
264264
try:
265-
pathways = pathways_metadata(map_uuid)
265+
path_data = pathways(map_uuid)
266266
except IOError as err:
267267
raise exceptions.NotFoundException(detail=str(err))
268-
paths = pathways.get('paths', {})
268+
paths = path_data.get('paths', {})
269269
if not path_id.startswith('ilxtr:') or path_id not in paths:
270270
raise exceptions.NotFoundException(detail=f'Unknown path: {path_id}')
271271
path = paths[path_id]

0 commit comments

Comments
 (0)