busroute.py

changeset 94
e27c18f080d1
parent 92
16a5c37e4e67
child 98
c07a77c8a070
--- a/busroute.py	Thu Apr 26 16:12:23 2018 +0300
+++ b/busroute.py	Tue May 01 13:21:00 2018 +0300
@@ -9,9 +9,11 @@
 	else:
 		return 0
 
-def simplify_name(region_name):
+def simplify_name(region_name, replace = False):
 	region = regions.get(region_name)
 	if region:
+		if replace and 'replacement' in region and region['replacement'] != region_name:
+			return simplify_name(region['replacement'])
 		return region.get('short_name', region_name)
 	else:
 		return region_name

mercurial