Cloned DMOJ
This commit is contained in:
parent
f623974b58
commit
49dc9ff10c
513 changed files with 132349 additions and 39 deletions
16
judge/management/commands/camo.py
Normal file
16
judge/management/commands/camo.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from judge.utils.camo import client as camo_client
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'obtains the camo url for the specified url'
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('url', help='url to use camo on')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
if camo_client is None:
|
||||
raise CommandError('Camo not available')
|
||||
|
||||
print(camo_client.image_url(options['url']))
|
Loading…
Add table
Add a link
Reference in a new issue