Compare commits
2 commits
dbf740e55e
...
8de757eff1
| Author | SHA1 | Date | |
|---|---|---|---|
| 8de757eff1 | |||
| ebd23c9e52 |
2 changed files with 12 additions and 6 deletions
|
|
@ -20,14 +20,19 @@ class Command(BaseCommand):
|
|||
"""
|
||||
help = 'import annotations from srt or vtt'
|
||||
args = 'username item layername filename.srt'
|
||||
option_list = BaseCommand.option_list + (
|
||||
)
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('username', help='username')
|
||||
parser.add_argument('item', help='item')
|
||||
parser.add_argument('layername', help='layer')
|
||||
parser.add_argument('filename', help='filename.srt')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
if len(args) != 4:
|
||||
print(self.usage('import_srt'))
|
||||
return
|
||||
username, public_id, layer_id, filename = args
|
||||
username = options['username']
|
||||
public_id = options['item']
|
||||
layer_id = options['layer']
|
||||
filename = options['filename']
|
||||
|
||||
user = User.objects.get(username=username)
|
||||
item = Item.objects.get(public_id=public_id)
|
||||
layer = list(filter(lambda l: l['id'] == layer_id, settings.CONFIG['layers']))[0]
|
||||
|
|
|
|||
|
|
@ -9,3 +9,4 @@ html5lib
|
|||
requests==2.9.1
|
||||
tornado==4.1
|
||||
geoip2==2.2.0
|
||||
youtube-dl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue