Exemple #1
0
    def _build_attr(self, attraction):
        print(attraction.contenttype.text)
        if attraction.contenttype.text == 'USSShow':
            document = Show()
            document.setName(attraction.find('name').text)
            if 'ashx' in attraction.showtime.text:
                return

            showtimes = self.get_showtimes(attraction.showtime.text)
            for show in showtimes:
                try:
                    time_obj = dateutil.parser.parse(show)
                    document.addTime(time_obj)
                except:
                    pass
            self.addShow(document)

        if attraction.contenttype.text == 'Ride':
            document = Ride()
            document.setName(attraction.find('name').text)
            document.setRide()
            if 'Guests' in attraction.queuetime.text:
                document.setTime(0)
            else:
                document.setTime(attraction.queuetime.text)

            if attraction.availability.text == 'True':
                document.setOpen()
            else:
                document.setClosed()

            self.addRide(document)
Exemple #2
0
    def _build_show(self, show, names):
        try:
            name = names[show['text']]
        except:
            name = show['text']

        attraction = Show()
        attraction.setName(name)

        showtimes = show['schedule'].replace('/', ' ').split()
        for show in showtimes:
            time_obj = dateutil.parser.parse(show)
            attraction.setTime(time_obj)

        self.addShow(attraction)
    def _build_show(self, show, names):
        try:
            name = names[show['text']]
        except:
            print unicode(show['text'])
            name = show['text']

        attraction = Show()
        attraction.setName(name)

        showtimes = show['schedule'].replace('/', ' ').split()
        for show in showtimes:
            time_obj = dateutil.parser.parse(show)
            attraction.setTime(time_obj)

        self.addShow(attraction)