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:
parent
45769b15b8
commit
fadba3c7b3
1 changed files with 6 additions and 3 deletions
|
@ -114,9 +114,12 @@ def get_installed_regions():
|
||||||
|
|
||||||
def read_vector_map_idx():
|
def read_vector_map_idx():
|
||||||
global previous_idx
|
global previous_idx
|
||||||
with open(vector_map_idx_dir + '/vector-map-idx.json','r') as idx:
|
try: # will fail first time
|
||||||
str = idx.read()
|
with open(vector_map_idx_dir + '/vector-map-idx.json','r') as idx:
|
||||||
previous_idx = json.loads(str)
|
str = idx.read()
|
||||||
|
previous_idx = json.loads(str)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def write_vector_map_idx(installed_maps):
|
def write_vector_map_idx(installed_maps):
|
||||||
map_dict ={}
|
map_dict ={}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue