labgrid package¶
Subpackages¶
- labgrid.autoinstall package
- labgrid.driver package
- Subpackages
- labgrid.driver.power package
- Submodules
- labgrid.driver.power.apc module
- labgrid.driver.power.digipower module
- labgrid.driver.power.gude module
- labgrid.driver.power.gude24 module
- labgrid.driver.power.gude8031 module
- labgrid.driver.power.gude8316 module
- labgrid.driver.power.netio module
- labgrid.driver.power.netio_kshell module
- labgrid.driver.power.sentry module
- labgrid.driver.power.simplerest module
- labgrid.driver.usbtmc package
- labgrid.driver.power package
- Submodules
- labgrid.driver.bareboxdriver module
- labgrid.driver.commandmixin module
- labgrid.driver.common module
- labgrid.driver.consoleexpectmixin module
- labgrid.driver.deditecrelaisdriver module
- labgrid.driver.dockerdriver module
- labgrid.driver.exception module
- labgrid.driver.externalconsoledriver module
- labgrid.driver.fake module
- labgrid.driver.fastbootdriver module
- labgrid.driver.filedigitaloutput module
- labgrid.driver.flashromdriver module
- labgrid.driver.gpiodriver module
- labgrid.driver.lxaiobusdriver module
- labgrid.driver.modbusdriver module
- labgrid.driver.onewiredriver module
- labgrid.driver.openocddriver module
- labgrid.driver.powerdriver module
- labgrid.driver.pyvisadriver module
- labgrid.driver.qemudriver module
- labgrid.driver.quartushpsdriver module
- labgrid.driver.resetdriver module
- labgrid.driver.serialdigitaloutput module
- labgrid.driver.serialdriver module
- labgrid.driver.shelldriver module
- labgrid.driver.sigrokdriver module
- labgrid.driver.smallubootdriver module
- labgrid.driver.sshdriver module
- labgrid.driver.ubootdriver module
- labgrid.driver.usbloader module
- labgrid.driver.usbsdmuxdriver module
- labgrid.driver.usbsdwiredriver module
- labgrid.driver.usbstoragedriver module
- labgrid.driver.usbtmcdriver module
- labgrid.driver.usbvideodriver module
- labgrid.driver.xenadriver module
- Subpackages
- labgrid.protocol package
- Submodules
- labgrid.protocol.bootstrapprotocol module
- labgrid.protocol.commandprotocol module
- labgrid.protocol.consoleprotocol module
- labgrid.protocol.digitaloutputprotocol module
- labgrid.protocol.filesystemprotocol module
- labgrid.protocol.filetransferprotocol module
- labgrid.protocol.infoprotocol module
- labgrid.protocol.linuxbootprotocol module
- labgrid.protocol.mmioprotocol module
- labgrid.protocol.powerprotocol module
- labgrid.protocol.resetprotocol module
- labgrid.provider package
- labgrid.pytestplugin package
- labgrid.remote package
- labgrid.resource package
- Submodules
- labgrid.resource.base module
- labgrid.resource.common module
- labgrid.resource.docker module
- labgrid.resource.ethernetport module
- labgrid.resource.flashrom module
- labgrid.resource.lxaiobus module
- labgrid.resource.modbus module
- labgrid.resource.networkservice module
- labgrid.resource.onewireport module
- labgrid.resource.power module
- labgrid.resource.pyvisa module
- labgrid.resource.remote module
- labgrid.resource.serialport module
- labgrid.resource.sigrok module
- labgrid.resource.suggest module
- labgrid.resource.udev module
- labgrid.resource.xenamanager module
- labgrid.resource.ykushpowerport module
- labgrid.strategy package
- labgrid.util package
- Subpackages
- Submodules
- labgrid.util.agent module
- labgrid.util.agentwrapper module
- labgrid.util.atomic module
- labgrid.util.dict module
- labgrid.util.exceptions module
- labgrid.util.expect module
- labgrid.util.helper module
- labgrid.util.managedfile module
- labgrid.util.marker module
- labgrid.util.proxy module
- labgrid.util.qmp module
- labgrid.util.ssh module
- labgrid.util.timeout module
- labgrid.util.yaml module
Submodules¶
labgrid.binding module¶
-
exception
labgrid.binding.
StateError
(msg)[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
-
__init__
(msg) → None¶ Method generated by attrs for class StateError.
-
__module__
= 'labgrid.binding'¶
-
__repr__
()¶ Method generated by attrs for class StateError.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
exception
labgrid.binding.
BindingError
(msg)[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
-
__init__
(msg) → None¶ Method generated by attrs for class BindingError.
-
__module__
= 'labgrid.binding'¶
-
__repr__
()¶ Method generated by attrs for class BindingError.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
labgrid.binding.
BindingState
[source]¶ Bases:
enum.Enum
An enumeration.
-
error
= -1¶
-
idle
= 0¶
-
bound
= 1¶
-
active
= 2¶
-
__module__
= 'labgrid.binding'¶
-
-
class
labgrid.binding.
BindingMixin
(target, name)[source]¶ Bases:
object
Handles the binding and activation of drivers and their supplying resources and drivers.
One client can be bound to many suppliers, and one supplier can be bound by many clients.
Conflicting access to one supplier can be avoided by deactivating conflicting clients before activation (using the resolve_conflicts callback).
-
bindings
= {}¶
-
property
display_name
¶
-
resolve_conflicts
(client)[source]¶ Called by the Target to allow this object to deactivate conflicting clients.
-
class
NamedBinding
(value)[source]¶ Bases:
object
Marks a binding (or binding set) as requiring an explicit name.
-
__dict__
= mappingproxy({'__module__': 'labgrid.binding', '__doc__': '\n Marks a binding (or binding set) as requiring an explicit name.\n ', '__init__': <function BindingMixin.NamedBinding.__init__>, '__repr__': <function BindingMixin.NamedBinding.__repr__>, '__dict__': <attribute '__dict__' of 'NamedBinding' objects>, '__weakref__': <attribute '__weakref__' of 'NamedBinding' objects>})¶
-
__module__
= 'labgrid.binding'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
__attrs_attrs__
= (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.binding', '__doc__': '\n Handles the binding and activation of drivers and their supplying resources\n and drivers.\n\n One client can be bound to many suppliers, and one supplier can be bound by\n many clients.\n\n Conflicting access to one supplier can be avoided by deactivating\n conflicting clients before activation (using the resolve_conflicts\n callback).\n ', 'bindings': {}, '__attrs_post_init__': <function BindingMixin.__attrs_post_init__>, 'display_name': <property object>, 'on_supplier_bound': <function BindingMixin.on_supplier_bound>, 'on_client_bound': <function BindingMixin.on_client_bound>, 'on_activate': <function BindingMixin.on_activate>, 'on_deactivate': <function BindingMixin.on_deactivate>, 'resolve_conflicts': <function BindingMixin.resolve_conflicts>, 'check_active': <classmethod object>, 'NamedBinding': <class 'labgrid.binding.BindingMixin.NamedBinding'>, '__dict__': <attribute '__dict__' of 'BindingMixin' objects>, '__weakref__': <attribute '__weakref__' of 'BindingMixin' objects>, '__attrs_attrs__': (Attribute(name='target', default=NOTHING, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='name', default=NOTHING, validator=<optional validator for <instance_of validator for type <class 'str'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='state', default=<BindingState.idle: 0>, validator=None, repr=True, eq=True, order=True, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None)), '__repr__': <function BindingMixin.__repr__>, '__init__': <function BindingMixin.__init__>})¶
-
__init__
(target, name) → None¶ Method generated by attrs for class BindingMixin.
-
__module__
= 'labgrid.binding'¶
-
__repr__
()¶ Method generated by attrs for class BindingMixin.
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.config module¶
Config convenience class
This class encapsulates access functions to the environment configuration
-
class
labgrid.config.
Config
(filename)[source]¶ Bases:
object
-
resolve_path
(path)[source]¶ Resolve an absolute path
- Parameters
path (str) – path to resolve
- Returns
the absolute path
- Return type
str
-
resolve_path_str_or_list
(path)[source]¶ Resolves a single path or multiple paths. Always returns a list (containing a single or multiple resolved paths).
- Parameters
path (str, list) – path(s) to resolve
- Returns
absolute path(s
- Return type
list
- Raises
TypeError – if input is neither str nor list
-
get_tool
(tool)[source]¶ Retrieve an entry from the tools subkey
- Parameters
tool (str) – the tool to retrieve the path for
- Returns
path to the requested tools
- Return type
str
-
get_image_path
(kind)[source]¶ Retrieve an entry from the images subkey
- Parameters
kind (str) – the kind of the image to retrieve the path for
- Returns
path to the image
- Return type
str
- Raises
KeyError – if the requested image can not be found in the configuration
-
get_path
(kind)[source]¶ Retrieve an entry from the paths subkey
- Parameters
kind (str) – the type of path to retrieve the path for
- Returns
path to the path
- Return type
str
- Raises
KeyError – if the requested image can not be found in the configuration
-
get_option
(name, default=None)[source]¶ Retrieve an entry from the options subkey
- Parameters
name (str) – name of the option
default (str) – A default parameter in case the option can not be found
- Returns
value of the option or default parameter
- Return type
str
- Raises
KeyError – if the requested image can not be found in the configuration
-
set_option
(name, value)[source]¶ Set an entry in the options subkey
- Parameters
name (str) – name of the option
value (str) – the new value
-
get_target_option
(target, name, default=None)[source]¶ - Retrieve an entry from the options subkey under the specified target
subkey
- Parameters
target (str) – name of the target
name (str) – name of the option
default (str) – A default parameter in case the option can not be found
- Returns
value of the option or default parameter
- Return type
str
- Raises
KeyError – if the requested key can not be found in the configuration, or if the target can not be found in the configuration.
-
set_target_option
(target, name, value)[source]¶ Set an entry in the options subkey under the specified target subkey
- Parameters
target (str) – name of the target
name (str) – name of the option
value (str) – the new value
- Raises
KeyError – if the requested target can not be found in the configuration
-
get_imports
()[source]¶ Helper function that returns the list of all imports
- Returns
List of files which should be imported
- Return type
List
-
get_paths
()[source]¶ Helper function that returns the subdict of all paths
- Returns
Dictionary containing all path definitions
- Return type
Dict
-
get_images
()[source]¶ Helper function that returns the subdict of all images
- Returns
Dictionary containing all image definitions
- Return type
Dict
-
__attrs_attrs__
= (Attribute(name='filename', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.config', '__attrs_post_init__': <function Config.__attrs_post_init__>, 'resolve_path': <function Config.resolve_path>, 'resolve_path_str_or_list': <function Config.resolve_path_str_or_list>, 'get_tool': <function Config.get_tool>, 'get_image_path': <function Config.get_image_path>, 'get_path': <function Config.get_path>, 'get_option': <function Config.get_option>, 'set_option': <function Config.set_option>, 'get_target_option': <function Config.get_target_option>, 'set_target_option': <function Config.set_target_option>, 'get_targets': <function Config.get_targets>, 'get_imports': <function Config.get_imports>, 'get_paths': <function Config.get_paths>, 'get_images': <function Config.get_images>, 'get_features': <function Config.get_features>, '__dict__': <attribute '__dict__' of 'Config' objects>, '__weakref__': <attribute '__weakref__' of 'Config' objects>, '__doc__': None, '__attrs_attrs__': (Attribute(name='filename', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),), '__repr__': <function Config.__repr__>, '__init__': <function Config.__init__>})¶
-
__init__
(filename) → None¶ Method generated by attrs for class Config.
-
__module__
= 'labgrid.config'¶
-
__repr__
()¶ Method generated by attrs for class Config.
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.consoleloggingreporter module¶
-
class
labgrid.consoleloggingreporter.
ConsoleLoggingReporter
(logpath)[source]¶ Bases:
object
ConsoleLoggingReporter - Reporter that writes console log files
- Parameters
logpath (str) – path to store the logfiles in
-
instance
= None¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.consoleloggingreporter', '__doc__': 'ConsoleLoggingReporter - Reporter that writes console log files\n\n Args:\n logpath (str): path to store the logfiles in\n ', 'instance': None, 'start': <classmethod object>, 'stop': <classmethod object>, '__init__': <function ConsoleLoggingReporter.__init__>, '_stop': <function ConsoleLoggingReporter._stop>, 'get_logfile': <function ConsoleLoggingReporter.get_logfile>, 'notify': <function ConsoleLoggingReporter.notify>, '__dict__': <attribute '__dict__' of 'ConsoleLoggingReporter' objects>, '__weakref__': <attribute '__weakref__' of 'ConsoleLoggingReporter' objects>})¶
-
__module__
= 'labgrid.consoleloggingreporter'¶
-
__weakref__
¶ list of weak references to the object (if defined)
labgrid.environment module¶
-
class
labgrid.environment.
Environment
(config_file='config.yaml', interact=<built-in function input>)[source]¶ Bases:
object
An environment encapsulates targets.
-
get_target
(role: str = 'main') → labgrid.target.Target[source]¶ Returns the specified target or None if not found.
Each target is initialized as needed.
-
__attrs_attrs__
= (Attribute(name='config_file', default='config.yaml', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='interact', default=<built-in function input>, validator=None, repr=False, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.environment', '__doc__': 'An environment encapsulates targets.', '__attrs_post_init__': <function Environment.__attrs_post_init__>, 'get_target': <function Environment.get_target>, 'get_features': <function Environment.get_features>, 'get_target_features': <function Environment.get_target_features>, 'cleanup': <function Environment.cleanup>, '__dict__': <attribute '__dict__' of 'Environment' objects>, '__weakref__': <attribute '__weakref__' of 'Environment' objects>, '__attrs_attrs__': (Attribute(name='config_file', default='config.yaml', validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='interact', default=<built-in function input>, validator=None, repr=False, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None)), '__repr__': <function Environment.__repr__>, '__init__': <function Environment.__init__>})¶
-
__init__
(config_file='config.yaml', interact=<built-in function input>) → None¶ Method generated by attrs for class Environment.
-
__module__
= 'labgrid.environment'¶
-
__repr__
()¶ Method generated by attrs for class Environment.
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.exceptions module¶
-
exception
labgrid.exceptions.
NoConfigFoundError
(msg)[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
-
__init__
(msg) → None¶ Method generated by attrs for class NoConfigFoundError.
-
__module__
= 'labgrid.exceptions'¶
-
__repr__
()¶ Method generated by attrs for class NoConfigFoundError.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
exception
labgrid.exceptions.
NoSupplierFoundError
(msg, filter=None)[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='filter', default=None, validator=<optional validator for <instance_of validator for type <class 'set'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))¶
-
__init__
(msg, filter=None) → None¶ Method generated by attrs for class NoSupplierFoundError.
-
__module__
= 'labgrid.exceptions'¶
-
__repr__
()¶ Method generated by attrs for class NoSupplierFoundError.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
exception
labgrid.exceptions.
InvalidConfigError
(msg)[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
-
__init__
(msg) → None¶ Method generated by attrs for class InvalidConfigError.
-
__module__
= 'labgrid.exceptions'¶
-
__repr__
()¶ Method generated by attrs for class InvalidConfigError.
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
exception
labgrid.exceptions.
NoDriverFoundError
(msg, filter=None)[source]¶ Bases:
labgrid.exceptions.NoSupplierFoundError
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='filter', default=None, validator=<optional validator for <instance_of validator for type <class 'set'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))¶
-
__init__
(msg, filter=None) → None¶ Method generated by attrs for class NoDriverFoundError.
-
__module__
= 'labgrid.exceptions'¶
-
__repr__
()¶ Method generated by attrs for class NoDriverFoundError.
-
-
exception
labgrid.exceptions.
NoResourceFoundError
(msg, filter=None)[source]¶ Bases:
labgrid.exceptions.NoSupplierFoundError
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None), Attribute(name='filter', default=None, validator=<optional validator for <instance_of validator for type <class 'set'>> or None>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=True, on_setattr=None))¶
-
__init__
(msg, filter=None) → None¶ Method generated by attrs for class NoResourceFoundError.
-
__module__
= 'labgrid.exceptions'¶
-
__repr__
()¶ Method generated by attrs for class NoResourceFoundError.
-
-
exception
labgrid.exceptions.
RegistrationError
(msg)[source]¶ Bases:
Exception
-
__attrs_attrs__
= (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
-
__init__
(msg) → None¶ Method generated by attrs for class RegistrationError.
-
__module__
= 'labgrid.exceptions'¶
-
__repr__
()¶ Method generated by attrs for class RegistrationError.
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.factory module¶
-
class
labgrid.factory.
TargetFactory
[source]¶ Bases:
object
-
reg_resource
(cls)[source]¶ Register a resource with the factory.
Returns the class to allow using it as a decorator.
-
reg_driver
(cls)[source]¶ Register a driver with the factory.
Returns the class to allow using it as a decorator.
-
__dict__
= mappingproxy({'__module__': 'labgrid.factory', '__init__': <function TargetFactory.__init__>, 'reg_resource': <function TargetFactory.reg_resource>, 'reg_driver': <function TargetFactory.reg_driver>, '_convert_to_named_list': <staticmethod object>, 'normalize_config': <staticmethod object>, 'make_resource': <function TargetFactory.make_resource>, 'make_driver': <function TargetFactory.make_driver>, 'make_target': <function TargetFactory.make_target>, 'class_from_string': <function TargetFactory.class_from_string>, '_insert_into_all': <function TargetFactory._insert_into_all>, '__dict__': <attribute '__dict__' of 'TargetFactory' objects>, '__weakref__': <attribute '__weakref__' of 'TargetFactory' objects>, '__doc__': None})¶
-
__module__
= 'labgrid.factory'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
labgrid.factory.
target_factory
= <labgrid.factory.TargetFactory object>¶ Global TargetFactory instance
This instance is used to register Resource and Driver classes so that Targets can be created automatically from YAML files.
labgrid.step module¶
-
class
labgrid.step.
Steps
[source]¶ Bases:
object
-
__dict__
= mappingproxy({'__module__': 'labgrid.step', '__init__': <function Steps.__init__>, 'get_current': <function Steps.get_current>, 'get_new': <function Steps.get_new>, 'push': <function Steps.push>, 'pop': <function Steps.pop>, 'subscribe': <function Steps.subscribe>, 'unsubscribe': <function Steps.unsubscribe>, 'notify': <function Steps.notify>, '__dict__': <attribute '__dict__' of 'Steps' objects>, '__weakref__': <attribute '__weakref__' of 'Steps' objects>, '__doc__': None})¶
-
__module__
= 'labgrid.step'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
labgrid.step.
StepEvent
(step, data, *, resource=None, stream=False)[source]¶ Bases:
object
-
__init__
(step, data, *, resource=None, stream=False)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
age
¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.step', '__init__': <function StepEvent.__init__>, '__str__': <function StepEvent.__str__>, '__setitem__': <function StepEvent.__setitem__>, '_invalidate': <function StepEvent._invalidate>, 'merge': <function StepEvent.merge>, 'age': <property object>, '__dict__': <attribute '__dict__' of 'StepEvent' objects>, '__weakref__': <attribute '__weakref__' of 'StepEvent' objects>, '__doc__': None})¶
-
__module__
= 'labgrid.step'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
labgrid.step.
Step
(title, level, tag, source)[source]¶ Bases:
object
-
__init__
(title, level, tag, source)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
duration
¶
-
property
status
¶
-
property
is_active
¶
-
property
is_done
¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.step', '__init__': <function Step.__init__>, '__repr__': <function Step.__repr__>, '__str__': <function Step.__str__>, 'duration': <property object>, 'status': <property object>, 'is_active': <property object>, 'is_done': <property object>, '_notify': <function Step._notify>, 'start': <function Step.start>, 'skip': <function Step.skip>, 'stop': <function Step.stop>, '__del__': <function Step.__del__>, '__dict__': <attribute '__dict__' of 'Step' objects>, '__weakref__': <attribute '__weakref__' of 'Step' objects>, '__doc__': None})¶
-
__module__
= 'labgrid.step'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.stepreporter module¶
-
class
labgrid.stepreporter.
StepReporter
[source]¶ Bases:
object
-
instance
= None¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.stepreporter', 'instance': None, 'start': <classmethod object>, 'stop': <classmethod object>, '__init__': <function StepReporter.__init__>, 'notify': <staticmethod object>, '__dict__': <attribute '__dict__' of 'StepReporter' objects>, '__weakref__': <attribute '__weakref__' of 'StepReporter' objects>, '__doc__': None})¶
-
__module__
= 'labgrid.stepreporter'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
labgrid.target module¶
-
class
labgrid.target.
Target
(name, env=None)[source]¶ Bases:
object
-
update_resources
()[source]¶ Iterate over all relevant resources and deactivate any active but unavailable resources.
-
await_resources
(resources, timeout=None, avail=True)[source]¶ Poll the given resources and wait until they are (un-)available.
- Parameters
resources (List) – the resources to poll
timeout (float) – optional timeout
avail (bool) – optionally wait until the resources are unavailable with avail=False
-
get_resource
(cls, *, name=None, wait_avail=True)[source]¶ Helper function to get a resource of the target. Returns the first valid resource found, otherwise a NoResourceFoundError is raised.
Arguments: cls – resource-class to return as a resource name – optional name to use as a filter wait_avail – wait for the resource to become available (default True)
-
get_active_driver
(cls, *, name=None)[source]¶ Helper function to get the active driver of the target. Returns the active driver found, otherwise None.
Arguments: cls – driver-class to return as a resource name – optional name to use as a filter
-
get_driver
(cls, *, name=None, activate=True)[source]¶ Helper function to get a driver of the target. Returns the first valid driver found, otherwise None.
Arguments: cls – driver-class to return as a resource name – optional name to use as a filter activate – activate the driver (default True)
-
__getitem__
(key)[source]¶ Syntactic sugar to access drivers by class (optionally filtered by name).
>>> target = Target('main') >>> console = FakeConsoleDriver(target, 'console') >>> target.activate(console) >>> target[FakeConsoleDriver] FakeConsoleDriver(target=Target(name='main', …), name='console', …) >>> target[FakeConsoleDriver, 'console'] FakeConsoleDriver(target=Target(name='main', …), name='console', …)
-
bind_driver
(client)[source]¶ Bind the driver to all suppliers (resources and other drivers).
Currently, we only support binding all suppliers at once.
-
activate
(client, name=None)[source]¶ Activate the client by activating all bound suppliers. This may require deactivating other clients.
-
deactivate
(client, name=None)[source]¶ Recursively deactivate the client’s clients and itself.
This is needed to ensure that no client has an inactive supplier.
-
__attrs_attrs__
= (Attribute(name='name', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='env', default=None, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))¶
-
__dict__
= mappingproxy({'__module__': 'labgrid.target', '__attrs_post_init__': <function Target.__attrs_post_init__>, 'interact': <function Target.interact>, 'update_resources': <function Target.update_resources>, 'await_resources': <function Target.await_resources>, 'get_resource': <function Target.get_resource>, '_get_driver': <function Target._get_driver>, 'get_active_driver': <function Target.get_active_driver>, 'get_driver': <function Target.get_driver>, '__getitem__': <function Target.__getitem__>, 'set_binding_map': <function Target.set_binding_map>, 'bind_resource': <function Target.bind_resource>, 'bind_driver': <function Target.bind_driver>, 'bind': <function Target.bind>, 'activate': <function Target.activate>, 'deactivate': <function Target.deactivate>, 'deactivate_all_drivers': <function Target.deactivate_all_drivers>, '_atexit_cleanup': <function Target._atexit_cleanup>, 'cleanup': <function Target.cleanup>, '__dict__': <attribute '__dict__' of 'Target' objects>, '__weakref__': <attribute '__weakref__' of 'Target' objects>, '__doc__': None, '__attrs_attrs__': (Attribute(name='name', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='env', default=None, validator=None, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None)), '__repr__': <function Target.__repr__>, '__init__': <function Target.__init__>})¶
-
__init__
(name, env=None) → None¶ Method generated by attrs for class Target.
-
__module__
= 'labgrid.target'¶
-
__repr__
()¶ Method generated by attrs for class Target.
-
__weakref__
¶ list of weak references to the object (if defined)
-