コード例 #1
0
    def get(self, agency_tag, route_tag):  # pylint: disable=arguments-differ

        if not agency_tag:
            error_response1 = exceptions.MissingArgumentValue(
                'Missing argument agency')
            self.build_response(error_response1)
            return

        if not route_tag:
            error_response2 = exceptions.MissingArgumentValue(
                'Missing argument route tag')
            self.build_response(error_response2)
            return

        last_time = self.get_query_argument(api.QUERY_LAST_TIME, None)
        if not last_time:
            error_response3 = exceptions.MissingArgumentValue(
                'Missing argument {0}'.format(api.QUERY_LAST_TIME))
            self.build_response(error_response3)
            return

        agency_obj = agency.Agency(agency_tag, self.application_settings)

        route_messages = yield agency_obj.get_route_vehicles(
            agency_tag, route_tag, last_time)

        self.build_response(route_messages)
コード例 #2
0
    def get(self, agency_tag, route_tag):  # pylint: disable=arguments-differ

        if not agency_tag:
            error_response = exceptions.MissingArgumentValue(
                'Missing argument agency')
            self.build_response(error_response)
            return

        if not route_tag:
            error_response = exceptions.MissingArgumentValue(
                'Missing argument route tag')
            self.build_response(error_response)
            return

        agency_obj = agency.Agency(agency_tag, self.application_settings)

        schedule = yield agency_obj.get_route_schedule(agency_tag, route_tag)

        self.build_response(schedule)