xoa.cf.SGLocator.patch_attrs
- SGLocator.patch_attrs(attrs, patch, loc=None, standardize=True, replace=False)[source]
Patch a dict of attribute with another dict taking care of loc
- Parameters:
attrs (dict) – Dictionary of attributes to patch
patch (dict) – Patch to apply
loc ({None, "any"}, letter, {False, ""}) – If None, location is left unchanged; if a letter, it is set; else, it is removed.
standardize (bool) – If True, standardize
root
andloc
values.replace (bool) – Replace existing attributes?
- Returns:
dict – A new dictionary of attributes
See also