globalconfig
Module dealing with the lifecycle of the global RootConfig
object
check_can_modify(cfg)
Check if this root config object can be modified.
As specified, the global root config object can only be modified by the thread that first created it.
Source code in gamma/config/globalconfig.py
get_config(initialize=True)
Get the global config root object, loading if needed and initialize
is True
.
This global object is cached and safe to call multiple times, from multiple threads.
Source code in gamma/config/globalconfig.py
reset_config(force=False)
Clear the global store and cache.
This is not meant to be used extensively by applications, but can be useful for writing tests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
force |
bool
|
if True, will reset the global store regardless of the current thread/process. |
False
|
Source code in gamma/config/globalconfig.py
set_config(cfg)
Forces a root config.
Call reset_config
.
NOTE: This is not meant to be used regularly by applications, but can be useful when writing tests.