(info_add, obj, name_fmt, attributes, *, formatter=None)
| 46 | |
| 47 | |
| 48 | def copy_attributes(info_add, obj, name_fmt, attributes, *, formatter=None): |
| 49 | for attr in attributes: |
| 50 | value = getattr(obj, attr, None) |
| 51 | if value is None: |
| 52 | continue |
| 53 | name = name_fmt % attr |
| 54 | if formatter is not None: |
| 55 | value = formatter(attr, value) |
| 56 | info_add(name, value) |
| 57 | |
| 58 | |
| 59 | def copy_attr(info_add, name, mod, attr_name): |
no outgoing calls
no test coverage detected
searching dependent graphs…