configuration
PROCESS I/O library configuration API.
Designed to be used by utility developers when creating configuration mechanisms for their tool.
ConfigurationParser
Abstract parser class. Must be subclassed to be used.
The parser should always put read-in data in the data property.
Source code in process/core/io/configuration.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
data
deletable
property
writable
data_validate(value)
Check that value corresponds to a specific data format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
|
required |
Source code in process/core/io/configuration.py
43 44 45 46 47 48 49 50 51 52 | |
JsonConfigParser
Bases: ConfigurationParser
JSON configuration parser.
Source code in process/core/io/configuration.py
55 56 57 58 59 60 61 62 63 64 65 | |
data = config_file_data
instance-attribute
Config
Generic configuration for PROCESS tools. Read-only.
Source code in process/core/io/configuration.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
config_file = config_file
instance-attribute
config_data = self._lowercase(parser.data)
instance-attribute
get(*config_keys, default=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*config_keys
|
|
()
|
|
default
|
(Default value = None) |
None
|
Returns:
| Type | Description |
|---|---|
type
|
For nested configs, sequential items in config_keys can be used. For example, if the configuration is: {"a": "b", "c": {1: "hello", 2: {"x": "alpha", "z": "beta"}}} you can access the value of "z" by calling get("c", 2, "z"). |
Source code in process/core/io/configuration.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |