diff --git a/roles/osm-vector-maps/templates/iiab-update-map b/roles/osm-vector-maps/templates/iiab-update-map index 837bc9e85..278352cfd 100755 --- a/roles/osm-vector-maps/templates/iiab-update-map +++ b/roles/osm-vector-maps/templates/iiab-update-map @@ -54,7 +54,6 @@ def main(): # For installed regions, check that a menu def exists, and it's on home page for fname in installed_maps: region = extract_region_from_filename(fname) - print('checking for %s region'%region) if region == 'maplist': # it is the splash page, display only if no others menu_ref = 'en-map_test' item = { "perma_ref" : "en-map_test" } @@ -128,6 +127,7 @@ def write_vector_map_idx(installed_maps): region = extract_region_from_filename(fname) if map == 'maplist': continue # not a real region map_dict = map_catalog['regions'].get(region,'') + print('check for %s in %s'%(region,map_dict)) if map_dict == '': continue # Create the idx file in format required bo js-menu system @@ -192,11 +192,13 @@ def fetch_menu_json_value(key): return data.get(key,'') def extract_region_from_filename(fname): - nibble = re.search(r"^.._osm_..._(.*)_[0-9]{4}",fname) - if not nibble: + # find the index of the date + nibble = re.search(r"\d{4}-\d{2}-\d{2}",fname) + if nibble: + fname = fname[:nibble.start()-1] + return fname + else: return("maplist") - resp = nibble.group(1) - return(resp) if __name__ == '__main__': if console_installed: