Skip to content
Snippets Groups Projects
Commit 9e80658c authored by birk's avatar birk
Browse files

optimized start parameters

parent 54b45e10
Branches
No related tags found
No related merge requests found
......@@ -16,16 +16,16 @@ from system.machine import Machine
@click.command()
@click.option('--programs', default='programs.json', help='JSON file with programs')
@click.option('--randomize', default=True, help='Randomize order of programs')
@click.option('--followups', default=True, help='Add followup programs')
@click.option('--devmode', default=False, help='Mode for development with shorter durations')
@click.option('--randomize/--no-random', default=True, help='Randomize order of programs')
@click.option('--followups/--no-followups', default=True, help='Avoid followup programs')
@click.option('--prodmode/--devmode', default=True, help='Mode for development with shorter durations')
class Main(object):
def __init__(self, programs, randomize, followups, devmode):
def __init__(self, programs, randomize, followups, prodmode):
self._randomize = randomize
self._followups = followups
self._config = Config()
self._config.set_server(api_server)
self._config.set_dev_mode(devmode)
self._config.set_dev_mode(not prodmode)
self._config.set_api_auth((api_user, api_pass))
self._config.set_meta_data_white_list(['madek_core:authors', 'madek_core:description', 'madek_core:title', 'media_content:title',
'media_content:date_created', 'madek_core:keywords', 'media_set:title',
......@@ -89,7 +89,7 @@ class Main(object):
program = self._programs[self._program_index]
print('***** load_program {} *****'.format(program._name))
loop = self._api.start_session()
future = asyncio.ensure_future(program.load(True))
future = asyncio.ensure_future(program.load(False))
loop.run_until_complete(future)
self._api.complete_session()
if program.valid:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment