Exemplo n.º 1
0
    def popularShows(self):
        """
        Fetches data from IMDB to show a list of popular shows.
        """
        t = PageTemplate(rh=self, filename="addShows_popularShows.mako")
        try:
            popular_shows = imdb_popular.fetch_popular_shows()
            imdb_exception = None
        except Exception as error:
            logger.warning("Could not get popular shows: {0}".format(
                str(error)))
            logger.debug(traceback.format_exc())
            popular_shows = None
            imdb_exception = error

        return t.render(
            title=_("Popular Shows"),
            header=_("Popular Shows"),
            popular_shows=popular_shows,
            imdb_exception=imdb_exception,
            imdb_url=imdb_popular.imdb_url,
            topmenu="home",
            controller="addShows",
            action="popularShows",
        )
Exemplo n.º 2
0
    def popularShows(self):
        """
        Fetches data from IMDB to show a list of popular shows.
        """
        t = PageTemplate(rh=self, filename="addShows_popularShows.mako")
        e = None

        try:
            popular_shows = imdb_popular.fetch_popular_shows()
        except Exception as e:
            logger.warning("Could not get popular shows: {0}".format(str(e)))
            popular_shows = None

        return t.render(title=_("Popular Shows"),
                        header=_("Popular Shows"),
                        popular_shows=popular_shows,
                        imdb_exception=e,
                        topmenu="home",
                        controller="addShows",
                        action="popularShows")