busroute.py

changeset 91
209f5930d038
parent 88
3b86597c5a88
child 92
16a5c37e4e67
--- a/busroute.py	Thu Apr 19 14:44:54 2018 +0300
+++ b/busroute.py	Fri Apr 20 13:50:02 2018 +0300
@@ -16,6 +16,18 @@
 	else:
 		return region_name
 
+def greatly_simplify_name(region_name):
+	region = regions.get(region_name)
+	if region:
+		if 'greater_-replacement' in region:
+			return simplify_name(region['greater_replacement'])
+		elif 'replacement' in region:
+			return simplify_name(region['replacement'])
+		else:
+			return simplify_name(region_name)
+	else:
+		return region_name
+
 def reduce_schedule(route, trip_length, whole = False, format = 'medium'):
 	length = ((trip_length / 600) * 3 + len(route) * 2) / 5
 	have_already = set()

mercurial