Init an API config - this MUST handle being called multiple times and only from the main-thread
(config: t.Optional[Config] = None)
| 33 | ################################################################################ |
| 34 | # MODULE LEVEL INTERFACE |
| 35 | def init(config: t.Optional[Config] = None) -> Config: |
| 36 | """ |
| 37 | Init an API config |
| 38 | - this MUST handle being called multiple times and only from the main-thread |
| 39 | """ |
| 40 | if globals().get("config") is not None: |
| 41 | log.debug("Reinitialising client config") |
| 42 | |
| 43 | if config: |
| 44 | set_config(config) |
| 45 | else: |
| 46 | config = Config() |
| 47 | |
| 48 | return config |
| 49 | |
| 50 | |
| 51 | def set_config(c: Optional[Config]): |
no test coverage detected