1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

handle first time when idx file does not exist

This commit is contained in:
Tim Moody 2019-05-13 14:23:14 -04:00
parent 45769b15b8
commit fadba3c7b3

View file

@ -114,9 +114,12 @@ def get_installed_regions():
def read_vector_map_idx():
global previous_idx
with open(vector_map_idx_dir + '/vector-map-idx.json','r') as idx:
str = idx.read()
previous_idx = json.loads(str)
try: # will fail first time
with open(vector_map_idx_dir + '/vector-map-idx.json','r') as idx:
str = idx.read()
previous_idx = json.loads(str)
except:
pass
def write_vector_map_idx(installed_maps):
map_dict ={}