Exemplo n.º 1
0
                    print >> sys.stderr, 'Error loading path', name, e

            for route_node in tree.getroot().findall('Route'):
                route_id = route_node.get('id', Route.new_id())
                gtfs_id = route_node.get('gtfs_id', None)
                agency_id = route_node.findtext('agency_id')
                short_name = route_node.findtext('short_name')
                long_name = route_node.findtext('long_name')
                description = route_node.findtext('description')
                route_type = route_node.findtext('route_node')
                url = route_node.findtext('url')
                color = route_node.findtext('color')
                text_color = route_node.findtext('text_color')

                agency_id = int(agency_id)
                r = Route(agency = Agency.get(agency_id),
                          short_name = short_name, long_name = long_name,
                          description = description, route_type = route_type,
                          url = url, color = color, text_color = text_color)
                r.route_id = int(route_id)
                r.gtfs_id = gtfs_id

            for trip_route_node in tree.getroot().findall('TripRoute'):
                trip_route_id = trip_route_node.get('id', TripRoute.new_id())
                gtfs_id = trip_route_node.get('gtfs_id', None)
                name = trip_route_node.findtext('name')
                route_id = trip_route_node.findtext('route_id')
                calendar_id = trip_route_node.findtext('calendar_id')
                headsign = trip_route_node.findtext('headsign')
                direction = trip_route_node.findtext('direction')
                path_id = trip_route_node.findtext('path_id')