pyrolab.configure.UniqueOrAutoKeyLoader#
- class UniqueOrAutoKeyLoader(stream)[source]#
Bases:
CLoaderA loader specific for PyroLab configuration files.
If the “auto” keyword is found, along with an optional number for name length, the name will be dynamically generated.
Warning
The YAML
loadfunction can run arbitrary code on your machine. Only load trusted or untampered files! If in doubt, examine the file first. It’s a short text file, and should not be hard to vet.Examples
>>> from yaml import load >>> from pyrolab.configure import UniqueOrAutoKeyLoader >>> with open("config.yaml", "r") as f: ... data = load(f, Loader=UniqueOrAutoKeyLoader) ... print(data)
Methods
check_state_key(key)Block special attributes/methods from being set in a newly created object, to prevent user-controlled methods from being called during deserialization
add_constructor
add_implicit_resolver
add_multi_constructor
add_path_resolver
ascend_resolver
check_data
check_event
check_node
check_resolver_prefix
check_token
construct_document
construct_mapping
construct_object
construct_pairs
construct_python_bytes
construct_python_complex
construct_python_long
construct_python_module
construct_python_name
construct_python_object
construct_python_object_apply
construct_python_object_new
construct_python_str
construct_python_tuple
construct_python_unicode
construct_scalar
construct_sequence
construct_undefined
construct_yaml_binary
construct_yaml_bool
construct_yaml_float
construct_yaml_int
construct_yaml_map
construct_yaml_null
construct_yaml_object
construct_yaml_omap
construct_yaml_pairs
construct_yaml_seq
construct_yaml_set
construct_yaml_str
construct_yaml_timestamp
descend_resolver
dispose
find_python_module
find_python_name
flatten_mapping
get_data
get_event
get_node
get_single_data
get_single_node
get_state_keys_blacklist_regexp
get_token
make_python_instance
peek_event
peek_token
raw_parse
raw_scan
resolve
set_python_instance_state