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 |