From eefbe06d595e9dc3289e542d4e42c1edfbf2fa5a Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 5 Oct 2012 19:53:15 +0530 Subject: [PATCH] implement route headway in sms --- smsBEST/mumbai/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/smsBEST/mumbai/app.py b/smsBEST/mumbai/app.py index 0a2734e..9f7f86e 100644 --- a/smsBEST/mumbai/app.py +++ b/smsBEST/mumbai/app.py @@ -83,8 +83,12 @@ class App(AppBase): origin_name, dest_name = origin['display_name'], dest['display_name'] origin_area, dest_area = PUNCT.sub('', origin['area']), PUNCT.sub('', dest['area']) url = "http://chalobest.in" + detail['route']['url'] - response = "%s: %s (%s) to %s (%s) %s" % ( - ",".join(routes), origin_name, origin_area, dest_name, dest_area, url) + if detail.headway: + headway = "Frequency: " + detail.headway + " mins" + else: + headway = "Route currently not running." + response = "%s: %s (%s) to %s (%s). %s. %s" % ( + ",".join(routes), origin_name, origin_area, dest_name, dest_area, headway, url) elif msg.text.find(" to ") != -1: