Exemplo n.º 1
0
def _coerce_flags_data(data):
    if isinstance(data, list):
        return data
    elif isinstance(data, dict):
        return flag_util.flag_assigns(data)
    else:
        _error("invalid flags value %r" % data)
Exemplo n.º 2
0
def _default_run_label(flag_vals):
    """Returns a default run label for a map of flag values.

    The default label is a string containing flag assign as NAME=VALUE.
    """
    non_null = {name: val for name, val in flag_vals.items() if val is not None}
    return " ".join(
        flag_util.flag_assigns(non_null, truncate_floats=True, shorten_paths=True)
    )
Exemplo n.º 3
0
def _step_flag_args(step):
    return flag_util.flag_assigns(step.flags)
Exemplo n.º 4
0
def _resources_desc(resources):
    from guild import flag_util

    return " ".join(flag_util.flag_assigns(resources))
Exemplo n.º 5
0
def flags_desc(flags, truncate_floats=False, delim=", "):
    formatted = flag_util.flag_assigns(flags, truncate_floats)
    return delim.join(formatted)