busroute.py

changeset 91
209f5930d038
parent 88
3b86597c5a88
child 92
16a5c37e4e67
equal deleted inserted replaced
90:36efdea68d03 91:209f5930d038
11 11
12 def simplify_name(region_name): 12 def simplify_name(region_name):
13 region = regions.get(region_name) 13 region = regions.get(region_name)
14 if region: 14 if region:
15 return region.get('short_name', region_name) 15 return region.get('short_name', region_name)
16 else:
17 return region_name
18
19 def greatly_simplify_name(region_name):
20 region = regions.get(region_name)
21 if region:
22 if 'greater_-replacement' in region:
23 return simplify_name(region['greater_replacement'])
24 elif 'replacement' in region:
25 return simplify_name(region['replacement'])
26 else:
27 return simplify_name(region_name)
16 else: 28 else:
17 return region_name 29 return region_name
18 30
19 def reduce_schedule(route, trip_length, whole = False, format = 'medium'): 31 def reduce_schedule(route, trip_length, whole = False, format = 'medium'):
20 length = ((trip_length / 600) * 3 + len(route) * 2) / 5 32 length = ((trip_length / 600) * 3 + len(route) * 2) / 5

mercurial