def handle(self, *args, **options):
        # Create the planet directory if it is missing
        os.makedirs(settings.PLANET_DIR, exist_ok=True)

        fname = options['add']
        update = options['update']
        download = options['download']
        drop = options['drop']
        local = options['local']

        if local:
            init_local(update=update)
            return

        if drop:
            dropall()

        if fname:
            auth.add_blogs(fname)

        if download:
            auth.download_blogs()

        if update:
            auth.update_entries(update)
Exemple #2
0
    def handle(self, *args, **options):
        # Create the planet directory if it is missing
        os.makedirs(settings.PLANET_DIR, exist_ok=True)

        add_fname = options['add']
        if add_fname:
            auth.add_blogs(add_fname)

        if options['download']:
            auth.download_blogs()

        count = options['update']
        if count:
            auth.update_entries(count)
    def handle(self, *args, **options):
        # Create the planet directory if it is missing
        os.makedirs(settings.PLANET_DIR, exist_ok=True)

        if options['fake']:
            fake()

        fname = options['add']
        if fname:
            fname = os.path.abspath(os.path.join(settings.PLANET_DIR, fname))
            auth.add_blogs(fname)

        if options['download']:
            fname = os.path.abspath(
                os.path.join(settings.PLANET_DIR, 'example-feeds.txt'))
            auth.add_blogs(fname)
            auth.download_blogs()

        count = options['update']
        if count:
            auth.update_entries(count)