def __init__(self, testing=False): """ Constructor for the WhensMyBus class """ WhensMyTransport.__init__(self, 'whensmybus', testing) self.parser = WMTBusParser() self.geodata = BusStopLocations()
def __init__(self, instance_name, testing=False): WhensMyTransport.__init__(self, instance_name, testing) self.allow_blank_tweets = True # Default route we request if none is specified. Also double as the official "name" of the network if instance_name == 'whensmydlr': self.default_requested_route = 'DLR' else: self.default_requested_route = 'Tube' self.parser = WMTTrainParser() self.geodata = RailStationLocations() # Create lookup dict for line names self.line_lookup = dict([(name, name) for (_code, name) in LINE_NAMES.keys()]) for ((_code, name), alternatives) in LINE_NAMES.items(): self.line_lookup.update(dict([(alternative, name) for alternative in alternatives]))