load config from file
This commit is contained in:
parent
188daf94f4
commit
e12936ec0f
2 changed files with 9 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ User=pandora
|
||||||
Group=pandora
|
Group=pandora
|
||||||
Nice=19
|
Nice=19
|
||||||
WorkingDirectory=/srv/pandora/pandora
|
WorkingDirectory=/srv/pandora/pandora
|
||||||
ExecStart=/srv/pandora/pandora/manage.py infinity
|
ExecStart=/srv/pandora/pandora/manage.py infinity --config /etc/infinity.json
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
def add_arguments(self, parser):
|
def add_arguments(self, parser):
|
||||||
parser.add_argument('--prefix', action='store', dest='prefix', default="/srv/t_for_time", help='prefix to build clips in')
|
parser.add_argument('--prefix', action='store', dest='prefix', default="/srv/t_for_time", help='prefix to build clips in')
|
||||||
|
parser.add_argument('--config', action='store', dest='config', default=None, help='config')
|
||||||
parser.add_argument('--duration', action='store', dest='duration', default="3600", help='target duration of all fragments in seconds')
|
parser.add_argument('--duration', action='store', dest='duration', default="3600", help='target duration of all fragments in seconds')
|
||||||
parser.add_argument('--single-file', action='store_true', dest='single_file', default=False, help='render to single video')
|
parser.add_argument('--single-file', action='store_true', dest='single_file', default=False, help='render to single video')
|
||||||
parser.add_argument('--keep-audio', action='store_true', dest='keep_audio', default=False, help='keep independent audio tracks')
|
parser.add_argument('--keep-audio', action='store_true', dest='keep_audio', default=False, help='keep independent audio tracks')
|
||||||
|
|
@ -20,4 +21,11 @@ class Command(BaseCommand):
|
||||||
parser.add_argument('--debug', action='store_true', dest='debug', default=False, help='output more info')
|
parser.add_argument('--debug', action='store_true', dest='debug', default=False, help='output more info')
|
||||||
|
|
||||||
def handle(self, **options):
|
def handle(self, **options):
|
||||||
|
if options.get("config"):
|
||||||
|
if os.path.exists(options["config"]):
|
||||||
|
with open(options["config"]) as fd:
|
||||||
|
config = json.load(fd)
|
||||||
|
options.update(config)
|
||||||
|
else:
|
||||||
|
print("unable to load config %s" % options["config"])
|
||||||
render_infinity(options)
|
render_infinity(options)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue