remove optparse

This commit is contained in:
j 2016-02-19 18:19:01 +00:00
commit 2fe857d4fd
10 changed files with 34 additions and 49 deletions

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from optparse import make_option
from django.core.management.base import BaseCommand

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from optparse import make_option
from django.core.management.base import BaseCommand
@ -14,12 +13,13 @@ class Command(BaseCommand):
"""
help = 'extract derivatives, run this to recreate all derivatives. i.e after adding new resolutions'
args = ''
option_list = BaseCommand.option_list + (
make_option('--rebuild', action='store_true', dest='rebuild',
def add_arguments(self, parser):
parser.add_argument('--rebuild', action='store_true', dest='rebuild',
default=False, help='reencode all derivatives again'),
make_option('--forground', action='store_true', dest='forground',
parser.add_argument('--forground', action='store_true', dest='forground',
default=False, help='dont dispatch encoding to celery but run in forground'),
)
def handle(self, **options):
for s in models.Stream.objects.filter(source=None):
if options['forground']: