From f9cc696463dacc3df27369f1df0e0c9e71b48434 Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 18 Sep 2012 17:31:44 +0530 Subject: [PATCH] MAX_MSG_LEN --- smsBEST/mumbai/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smsBEST/mumbai/app.py b/smsBEST/mumbai/app.py index d3c87c7..33d7e25 100644 --- a/smsBEST/mumbai/app.py +++ b/smsBEST/mumbai/app.py @@ -105,7 +105,11 @@ class App(AppBase): msg.respond("Sorry, no direct buses found between %s and %s" % (from_matches['name'], to_matches['name'],)) return routesFound = ", ".join(intersection) - msg.respond("%s to %s: %s" % (from_matches['name'], to_matches['name'], routesFound,)) + response = "%s to %s: %s" % (from_matches['name'], to_matches['name'], routesFound,) + if len(response) > MAX_MSG_LEN: + response = response[0:MAX_MSG_LEN] + msg.respond(response) + #msg.respond("%s to %s: %s" % (from_matches['name'], to_matches['name'], routesFound,)) return