MCPcopy Create free account
hub / github.com/datapane/datapane / init

Function init

python-client/src/datapane/client/config.py:35–48  ·  view source on GitHub ↗

Init an API config - this MUST handle being called multiple times and only from the main-thread

(config: t.Optional[Config] = None)

Source from the content-addressed store, hash-verified

33################################################################################
34# MODULE LEVEL INTERFACE
35def 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
51def set_config(c: Optional[Config]):

Callers 1

__init__.pyFile · 0.85

Calls 3

set_configFunction · 0.85
ConfigClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected