def wrap(data, request): near = "here" if near_parameter: near = data.get(near_parameter, "here") data[parameter] = get_place(data.get(parameter), request, near=near, limit=limit) return func(data, request)
def wrap(data, request): if "place" not in data or data["place"] == "here": timezone = get_timezone_at_place(get_location("here", request)) return StaticResponse('The time is currently <time>%s</time>' % get_time_in_zone(timezone)) else: place = get_place(data["place"], request) if place is None: return StaticResponse("Sorry, I don't know where that is. :(") timezone = get_timezone_at_place(place.coords()) return StaticResponse("The time in <em>%s</em> is <time>%s</time>" % (place.name, get_time_in_zone(timezone)))