Get object from string
(string, reload=False)
| 22 | |
| 23 | |
| 24 | def get_obj_from_str(string, reload=False): |
| 25 | """ |
| 26 | Get object from string |
| 27 | """ |
| 28 | |
| 29 | module, cls = string.rsplit(".", 1) |
| 30 | if reload: |
| 31 | module_imp = importlib.import_module(module) |
| 32 | importlib.reload(module_imp) |
| 33 | return getattr(importlib.import_module(module, package=None), cls) |
| 34 | |
| 35 | |
| 36 | def instantiate_from_config(config): |
no outgoing calls
no test coverage detected