busroute.py

changeset 94
e27c18f080d1
parent 92
16a5c37e4e67
child 98
c07a77c8a070
equal deleted inserted replaced
93:53ee9e945673 94:e27c18f080d1
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):

mercurial