|
|
@ -78,16 +78,15 @@ class DeviceLibrary:
|
|
|
|
def __repr__(self) -> str:
|
|
|
|
def __repr__(self) -> str:
|
|
|
|
return '<DeviceLibrary with keys ' + repr(list(self.generators.keys())) + '>'
|
|
|
|
return '<DeviceLibrary with keys ' + repr(list(self.generators.keys())) + '>'
|
|
|
|
|
|
|
|
|
|
|
|
def set_const(self, key: str, const: 'Device') -> None:
|
|
|
|
def set_const(self, const: 'Device') -> None:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Convenience function to avoid having to manually wrap
|
|
|
|
Convenience function to avoid having to manually wrap
|
|
|
|
constant values into callables.
|
|
|
|
already-generated Device objects into callables.
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
Args:
|
|
|
|
key: Lookup key, usually the device name
|
|
|
|
const: Pre-generated device object
|
|
|
|
const: Device object to return
|
|
|
|
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
self.generators[key] = lambda: const
|
|
|
|
self.generators[const.pattern.name] = lambda: const
|
|
|
|
|
|
|
|
|
|
|
|
def add(self: L, other: L) -> L:
|
|
|
|
def add(self: L, other: L) -> L:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|