//python/private:builders_util.bzl
Utilities for builders.
- kwargs_getter(kwargs,key)
Create a function to get
keyfromkwargs.
- kwargs_getter_mandatory(kwargs)
Creates a
kwargs_getterfor themandatorykey.- Args:
kwargs–undocumented
- kwargs_set_default_dict(kwargs,key)
Normalizes None/missing to list.
- kwargs_set_default_ignore_none(kwargs,key,default)
Normalize None/missing to
default.
- kwargs_set_default_list(kwargs,key)
Normalizes None/missing to list.
- kwargs_set_default_mandatory(kwargs)
Sets
Falseas themandatoryarg default.- Args:
kwargs–undocumented
- kwargs_setter(kwargs,key)
Create a function to set
keyinkwargs.
- kwargs_setter_mandatory(kwargs)
Creates a
kwargs_setterfor themandatorykey.- Args:
kwargs–undocumented
- list_add_unique(add_to,others,convert=None)
Bulk add values to a list if not already present.
- normalize_transition_in_out_value(arg_name,value)
Normalize a transition input/output value to a canonical label string.
- normalize_transition_in_out_values(arg_name,values)
Normalize transition inputs/outputs to canonical label strings.
- to_label_maybe(value)
Converts
valueto aLabel, maybe.The “maybe” qualification is because invalid values for
Label()are returned as-is (e.g. None, or special values that might beused with e.g. thedefaultattribute arg).