コード例 #1
0
    def handle(self, *args, **options):

        queue = self.get_podcasts(*args, **options)

        max_podcasts = options.get("max")
        if max_podcasts:
            queue = islice(queue, 0, max_podcasts)

        if options.get("list"):
            for podcast in queue:
                logger.info("Podcast %s", podcast)

        else:
            logger.info("Updating podcasts...")

            updater = PodcastUpdater()
            for podcast in updater.update_queue(queue):
                logger.info("Updated podcast %s", podcast)
コード例 #2
0
ファイル: feed-downloader.py プロジェクト: 4johndoe/mygpo
    def handle(self, *args, **options):

        queue = self.get_podcasts(*args, **options)

        max_podcasts = options.get('max')
        if max_podcasts:
            queue = islice(queue, 0, max_podcasts)

        if options.get('list'):
            for podcast in queue:
                logger.info('Podcast %s', podcast)

        else:
            logger.info('Updating podcasts...')

            updater = PodcastUpdater()
            for podcast in updater.update_queue(queue):
                logger.info('Updated podcast %s', podcast)
コード例 #3
0
ファイル: tasks.py プロジェクト: 4johndoe/mygpo
def update_podcasts(podcast_urls):
    """ Task to update a podcast """
    from mygpo.data.feeddownloader import PodcastUpdater
    updater = PodcastUpdater()
    podcasts = updater.update_queue(podcast_urls)
    return list(podcasts)
コード例 #4
0
ファイル: tasks.py プロジェクト: fk-lx/mygpo
def update_podcasts(podcast_urls):
    """ Task to update a podcast """
    updater = PodcastUpdater()
    podcasts = updater.update_queue(podcast_urls)
    return list(podcasts)