tango.pyaml.static_catalog#
Catalog backed by an explicit list of key-to-device mappings.
Classes
|
Catalog backed by a fixed list of key-to-device mappings. |
- class tango.pyaml.static_catalog.StaticCatalog(entries)#
Bases:
Catalog,DynamicValidationCatalog backed by a fixed list of key-to-device mappings.
All entries are validated at construction time: the list must be non-empty and every key must be unique. Resolution is an O(1) dictionary lookup; no Tango connection is required.
- Parameters:
entries (list of StaticCatalogEntry) – Explicit list of key-to-device mappings. Must contain at least one entry, and keys must be unique within the catalog.
- _entries#
Entries given at construction time, in configured order.
- Type:
list of StaticCatalogEntry
- _refs#
Lookup table built from
_entries, indexed by catalog key.- Type:
dict of str to DeviceAccess
- resolve(key, control_system=None)#
Return the device associated with
key.
- Raises:
pyaml.PyAMLException – If
entriesis empty or contains duplicate keys.
- resolve(key, control_system=None)#
Return the device associated with
key.- Parameters:
key (str) – Catalog key to resolve.
control_system (object, optional) – Optional backend context. Static catalogs do not need it, but the argument keeps the backend catalog API uniform.
- Returns:
DeviceAccess – The device access object registered under
key.- Raises:
pyaml.PyAMLException – If
keyis not present in the catalog.- Return type:
DeviceAccess