Esempio n. 1
0
    def handle_xml(self, feed):
        episode_list = feed.find("Episodelist")
        show_name = get_str(feed, "name")

        if episode_list is not None:
            show_obj = Show.get_by_title(show_name)

            for season in episode_list:
                for episode in season:
                    self._parse_episode(episode, season, show_obj)
            show_obj.fully_populate()
Esempio n. 2
0
    def handle_xml(self, show):
        show_title = get_str(show, "showname")


        classification = get_str(show, "classification")

        show_obj = Show.get_by_title(show_title)
        try:
            show_obj.classification = classification
        except BadValueError:
            logging.critical("!!! classification {}".format(classification))
        if classification not in CLASSIFICATION_ONLY:
            show_obj.fully_populate()
            return



        show_obj.country = get_str(show, "origin_country")


        try:
            show_obj.status = get_str(show, "status")
        except BadValueError:
            logging.critical("!!! stats {}".format(get_str(show, "status")))

        show_obj.summary = get_str(show, "summary") or ""

        show_obj.networks = [network.text for network in show.findall("network")]
        show_obj.genres = [genre.text for genre in show.find("genres")]

        seasons_number = get_int(show, "seasons")
        show_obj.runtime = get_int(show, "runtime")
        show_obj.started_date = get_date(show, "startdate")
        show_obj.ended_date = get_date(show, "ended")

        show_obj.put()
        taskqueue.add(url=webapp.uri_for(name_prefix+"episodes_list_task"),
            params={'showid': self.showid})