avid.actions.genericCLIAction.generate_cli_call

avid.actions.genericCLIAction.generate_cli_call(exec_url, artefact_args, additional_args=None, arg_positions=None, artefact_url_extraction_delegate=None)

Helper that generates the cli call string for a given set of artefact selection arguments and normal arguments. :param exec_url: The argument for the cli itself. :param artefact_args: Dictionary of artefact selections as values. The key is the flag (without “-” or “–”; they will be added automatically depending on the size of the key; one character keys will completed with “-”, others with “–“). If the selection contains more then one artefact all artefact urls will be added as single arguments after the flag. :param additional_args: Dictionary with all additional arguments (except the artefact inputs and outputs) that should be passed to the cli. The key is the argument/flag name (without “-” or “–”; they will be added automatically depending on the size of the key; one character keys will completed with “-”, others with “–“). If the value is not None it will be also added after the argument. If the value of an additional argument is an list each list element will be added as escaped value. :param arg_positions: list that contains the keys of all arguments (from artefact_args and additional_args) that are not flag based but positional arguments. Those arguments will be added in the order of the list before the positional arguments. :param artefact_url_extraction_delegate: Delegate that can be used to change the way how urls are extracted from artefacts that are provided for the argument or to over a way to manipulate them before generating the cli call string. The default implementation (extract_artefact_arg_urls_default) does just return the URL of the artefact. The signature of the delegate is delegate(arg_name, arg_value). Arg_value is expected to be a list of artefacts. The return is expected to be a list of URL strings (or None for artefacts that should not return a URL).