Esempio n. 1
0
def _coerce_flags_data(data):
    if isinstance(data, list):
        return data
    elif isinstance(data, dict):
        return flag_util.format_flags(data)
    else:
        _error("invalid flags value %r" % data)
Esempio n. 2
0
def _default_run_label(flag_vals):
    non_null = {
        name: val
        for name, val in flag_vals.items() if val is not None
    }
    return " ".join(
        flag_util.format_flags(non_null,
                               truncate_floats=True,
                               shorten_paths=True))
Esempio n. 3
0
def flags_desc(flags, truncate_floats=False, delim=", "):
    formatted = flag_util.format_flags(flags, truncate_floats)
    return delim.join(formatted)
Esempio n. 4
0
def _step_flag_args(step):
    return flag_util.format_flags(step.flags)
Esempio n. 5
0
def _default_run_label(flag_vals):
    return " ".join(flag_util.format_flags(flag_vals, truncate_floats=True))