7 if region_name in regions: |
7 if region_name in regions: |
8 return float(regions[region_name]['priority']) |
8 return float(regions[region_name]['priority']) |
9 else: |
9 else: |
10 return 0 |
10 return 0 |
11 |
11 |
12 def simplify_name(region_name): |
12 def simplify_name(region_name, replace = False): |
13 region = regions.get(region_name) |
13 region = regions.get(region_name) |
14 if region: |
14 if region: |
|
15 if replace and 'replacement' in region and region['replacement'] != region_name: |
|
16 return simplify_name(region['replacement']) |
15 return region.get('short_name', region_name) |
17 return region.get('short_name', region_name) |
16 else: |
18 else: |
17 return region_name |
19 return region_name |
18 |
20 |
19 def greatly_simplify_name(region_name): |
21 def greatly_simplify_name(region_name): |