labgrid.util package¶
Subpackages¶
Submodules¶
labgrid.util.agent module¶
- class labgrid.util.agent.Agent[source]¶
Bases:
object
- __dict__ = mappingproxy({'__module__': 'labgrid.util.agent', '__init__': <function Agent.__init__>, 'send': <function Agent.send>, 'register': <function Agent.register>, 'load': <function Agent.load>, 'list': <function Agent.list>, 'run': <function Agent.run>, '__dict__': <attribute '__dict__' of 'Agent' objects>, '__weakref__': <attribute '__weakref__' of 'Agent' objects>, '__doc__': None, '__annotations__': {}})¶
- __module__ = 'labgrid.util.agent'¶
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.agentwrapper module¶
- exception labgrid.util.agentwrapper.AgentError[source]¶
Bases:
Exception
- __module__ = 'labgrid.util.agentwrapper'¶
- __weakref__¶
list of weak references to the object (if defined)
- exception labgrid.util.agentwrapper.AgentException[source]¶
Bases:
Exception
- __module__ = 'labgrid.util.agentwrapper'¶
- __weakref__¶
list of weak references to the object (if defined)
- class labgrid.util.agentwrapper.MethodProxy(wrapper, name)[source]¶
Bases:
object
- __dict__ = mappingproxy({'__module__': 'labgrid.util.agentwrapper', '__init__': <function MethodProxy.__init__>, '__call__': <function MethodProxy.__call__>, '__dict__': <attribute '__dict__' of 'MethodProxy' objects>, '__weakref__': <attribute '__weakref__' of 'MethodProxy' objects>, '__doc__': None, '__annotations__': {}})¶
- __module__ = 'labgrid.util.agentwrapper'¶
- __weakref__¶
list of weak references to the object (if defined)
- class labgrid.util.agentwrapper.ModuleProxy(wrapper, name)[source]¶
Bases:
object
- __dict__ = mappingproxy({'__module__': 'labgrid.util.agentwrapper', '__init__': <function ModuleProxy.__init__>, '__getattr__': <function ModuleProxy.__getattr__>, '__dict__': <attribute '__dict__' of 'ModuleProxy' objects>, '__weakref__': <attribute '__weakref__' of 'ModuleProxy' objects>, '__doc__': None, '__annotations__': {}})¶
- __module__ = 'labgrid.util.agentwrapper'¶
- __weakref__¶
list of weak references to the object (if defined)
- class labgrid.util.agentwrapper.AgentWrapper(host=None)[source]¶
Bases:
object
- __dict__ = mappingproxy({'__module__': 'labgrid.util.agentwrapper', '__init__': <function AgentWrapper.__init__>, '__del__': <function AgentWrapper.__del__>, '__getattr__': <function AgentWrapper.__getattr__>, 'call': <function AgentWrapper.call>, 'load': <function AgentWrapper.load>, 'close': <function AgentWrapper.close>, '__dict__': <attribute '__dict__' of 'AgentWrapper' objects>, '__weakref__': <attribute '__weakref__' of 'AgentWrapper' objects>, '__doc__': None, '__annotations__': {}})¶
- __module__ = 'labgrid.util.agentwrapper'¶
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.atomic module¶
labgrid.util.dict module¶
This module contains helper functions for working with dictionaries.
- labgrid.util.dict.diff_dict(old, new)[source]¶
Compares old and new dictionaries, yielding for each difference (key, old_value, new_value). None is used for missing values.
labgrid.util.exceptions module¶
- exception labgrid.util.exceptions.NoValidDriverError(msg)[source]¶
Bases:
Exception
- __attrs_attrs__ = (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, 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 NoValidDriverError.
- __module__ = 'labgrid.util.exceptions'¶
- __repr__()¶
Method generated by attrs for class NoValidDriverError.
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.expect module¶
- class labgrid.util.expect.PtxExpect(driver)[source]¶
Bases:
pexpect.pty_spawn.spawn
labgrid Wrapper of the pexpect module.
This class provides pexpect functionality for the ConsoleProtocol classes. driver: ConsoleProtocol object to be passed in
- read_nonblocking(size=1, timeout=- 1)[source]¶
Pexpects needs a nonblocking read function, simply use pyserial with a timeout of 0.
- __module__ = 'labgrid.util.expect'¶
labgrid.util.helper module¶
- class labgrid.util.helper.ProcessWrapper(callbacks=NOTHING)[source]¶
Bases:
object
- loglevel = 20¶
- check_output(command, *, print_on_silent_log=False, input=None)[source]¶
Run a command and supply the output to callback functions
- __attrs_attrs__ = (Attribute(name='callbacks', default=Factory(factory=<class 'list'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
- __dict__ = mappingproxy({'__module__': 'labgrid.util.helper', 'loglevel': 20, 'check_output': <function ProcessWrapper.check_output>, 'register': <function ProcessWrapper.register>, 'unregister': <function ProcessWrapper.unregister>, 'log_callback': <staticmethod object>, 'print_callback': <staticmethod object>, 'enable_logging': <function ProcessWrapper.enable_logging>, 'disable_logging': <function ProcessWrapper.disable_logging>, 'enable_print': <function ProcessWrapper.enable_print>, 'disable_print': <function ProcessWrapper.disable_print>, '__dict__': <attribute '__dict__' of 'ProcessWrapper' objects>, '__weakref__': <attribute '__weakref__' of 'ProcessWrapper' objects>, '__doc__': None, '__attrs_attrs__': (Attribute(name='callbacks', default=Factory(factory=<class 'list'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),), '__repr__': <function ProcessWrapper.__repr__>, '__eq__': <function ProcessWrapper.__eq__>, '__ne__': <function ProcessWrapper.__ne__>, '__lt__': <function ProcessWrapper.__lt__>, '__le__': <function ProcessWrapper.__le__>, '__gt__': <function ProcessWrapper.__gt__>, '__ge__': <function ProcessWrapper.__ge__>, '__hash__': None, '__init__': <function ProcessWrapper.__init__>, '__annotations__': {}})¶
- __eq__(other)¶
Method generated by attrs for class ProcessWrapper.
- __ge__(other)¶
Method generated by attrs for class ProcessWrapper.
- __gt__(other)¶
Method generated by attrs for class ProcessWrapper.
- __hash__ = None¶
- __init__(callbacks=NOTHING) None ¶
Method generated by attrs for class ProcessWrapper.
- __le__(other)¶
Method generated by attrs for class ProcessWrapper.
- __lt__(other)¶
Method generated by attrs for class ProcessWrapper.
- __module__ = 'labgrid.util.helper'¶
- __ne__(other)¶
Method generated by attrs for class ProcessWrapper.
- __repr__()¶
Method generated by attrs for class ProcessWrapper.
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.managedfile module¶
- exception labgrid.util.managedfile.ManagedFileError[source]¶
Bases:
Exception
- __module__ = 'labgrid.util.managedfile'¶
- __weakref__¶
list of weak references to the object (if defined)
- class labgrid.util.managedfile.ManagedFile(local_path, resource, detect_nfs=True)[source]¶
Bases:
object
The ManagedFile allows the synchronisation of a file to a remote host. It has to be created with the to be synced file and the target resource as argument:
- ::
from labgrid.util.managedfile import ManagedFile
ManagedFile(“/tmp/examplefile”, <your-resource>)
Synchronisation is done with the sync_to_resource method.
- sync_to_resource(symlink=None)[source]¶
sync the file to the host specified in a resource
- Raises
ExecutionError – if the SSH connection/copy fails
- get_remote_path()[source]¶
Retrieve the remote file path
- Returns
path to the file on the remote host
- Return type
str
- get_hash()[source]¶
Retrieve the hash of the file
- Returns
SHA256 hexdigest of the file
- Return type
str
- __attrs_attrs__ = (Attribute(name='local_path', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<function ManagedFile.<lambda>>, kw_only=False, inherited=False, on_setattr=None), Attribute(name='resource', default=NOTHING, validator=<instance_of validator for type <class 'labgrid.resource.common.Resource'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='detect_nfs', default=True, validator=<instance_of validator for type <class 'bool'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))¶
- __dict__ = mappingproxy({'__module__': 'labgrid.util.managedfile', '__doc__': ' The ManagedFile allows the synchronisation of a file to a remote host.\n It has to be created with the to be synced file and the target resource as\n argument:\n\n ::\n from labgrid.util.managedfile import ManagedFile\n\n ManagedFile("/tmp/examplefile", <your-resource>)\n\n Synchronisation is done with the sync_to_resource method.\n ', '__attrs_post_init__': <function ManagedFile.__attrs_post_init__>, 'sync_to_resource': <function ManagedFile.sync_to_resource>, '_on_nfs': <function ManagedFile._on_nfs>, 'get_remote_path': <function ManagedFile.get_remote_path>, 'get_hash': <function ManagedFile.get_hash>, '__dict__': <attribute '__dict__' of 'ManagedFile' objects>, '__weakref__': <attribute '__weakref__' of 'ManagedFile' objects>, '__attrs_attrs__': (Attribute(name='local_path', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=<function ManagedFile.<lambda>>, kw_only=False, inherited=False, on_setattr=None), Attribute(name='resource', default=NOTHING, validator=<instance_of validator for type <class 'labgrid.resource.common.Resource'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='detect_nfs', default=True, validator=<instance_of validator for type <class 'bool'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None)), '__repr__': <function ManagedFile.__repr__>, '__eq__': <function ManagedFile.__eq__>, '__ne__': <function ManagedFile.__ne__>, '__lt__': <function ManagedFile.__lt__>, '__le__': <function ManagedFile.__le__>, '__gt__': <function ManagedFile.__gt__>, '__ge__': <function ManagedFile.__ge__>, '__hash__': None, '__init__': <function ManagedFile.__init__>, '__annotations__': {}})¶
- __eq__(other)¶
Method generated by attrs for class ManagedFile.
- __ge__(other)¶
Method generated by attrs for class ManagedFile.
- __gt__(other)¶
Method generated by attrs for class ManagedFile.
- __hash__ = None¶
- __init__(local_path, resource, detect_nfs=True) None ¶
Method generated by attrs for class ManagedFile.
- __le__(other)¶
Method generated by attrs for class ManagedFile.
- __lt__(other)¶
Method generated by attrs for class ManagedFile.
- __module__ = 'labgrid.util.managedfile'¶
- __ne__(other)¶
Method generated by attrs for class ManagedFile.
- __repr__()¶
Method generated by attrs for class ManagedFile.
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.marker module¶
labgrid.util.proxy module¶
labgrid.util.qmp module¶
- class labgrid.util.qmp.QMPMonitor(monitor_out, monitor_in)[source]¶
Bases:
object
- __attrs_attrs__ = (Attribute(name='monitor_out', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='monitor_in', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))¶
- __dict__ = mappingproxy({'__module__': 'labgrid.util.qmp', '__attrs_post_init__': <function QMPMonitor.__attrs_post_init__>, '_negotiate_capabilities': <function QMPMonitor._negotiate_capabilities>, '_read_parse_json': <function QMPMonitor._read_parse_json>, 'execute': <function QMPMonitor.execute>, '__dict__': <attribute '__dict__' of 'QMPMonitor' objects>, '__weakref__': <attribute '__weakref__' of 'QMPMonitor' objects>, '__doc__': None, '__attrs_attrs__': (Attribute(name='monitor_out', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='monitor_in', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None)), '__repr__': <function QMPMonitor.__repr__>, '__init__': <function QMPMonitor.__init__>, '__annotations__': {}})¶
- __init__(monitor_out, monitor_in) None ¶
Method generated by attrs for class QMPMonitor.
- __module__ = 'labgrid.util.qmp'¶
- __repr__()¶
Method generated by attrs for class QMPMonitor.
- __weakref__¶
list of weak references to the object (if defined)
- exception labgrid.util.qmp.QMPError(msg)[source]¶
Bases:
Exception
- __attrs_attrs__ = (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, 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 QMPError.
- __module__ = 'labgrid.util.qmp'¶
- __repr__()¶
Method generated by attrs for class QMPError.
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.ssh module¶
- class labgrid.util.ssh.SSHConnection(host)[source]¶
Bases:
object
SSHConnections are individual connections to hosts managed by a control socket. In addition to command execution this class also provides an interface to manage port forwardings. These are used in the remote infrastructure to tunnel multiple connections over one SSH link.
A public identity infrastructure is assumed, no extra username or passwords are supported.
- run(command, *, codec='utf-8', decodeerrors='strict', force_tty=False, stderr_merge=False, stderr_loglevel=None, stdout_loglevel=None)[source]¶
Run a command over the SSHConnection
- Parameters
command (string) – The command to run
codec (string, optional) – output encoding. Defaults to “utf-8”.
decodeerrors (string, optional) – behavior on decode errors. Defaults to “strict”. Refer to stdtypes’ bytes.decode for details.
force_tty (bool, optional) – force allocate a tty (ssh -tt). Defaults to False
stderr_merge (bool, optional) – merge ssh subprocess stderr into stdout. Defaults to False.
stdout_loglevel (int, optional) – log stdout with specific log level as well. Defaults to None, i.e. don’t log.
stderr_loglevel (int, optional) – log stderr with specific log level as well. Defaults to None, i.e. don’t log.
- Returns
(stdout, stderr, returncode)
- run_check(command, *, codec='utf-8', decodeerrors='strict', force_tty=False, stderr_merge=False, stderr_loglevel=None, stdout_loglevel=None)[source]¶
Runs a command over the SSHConnection returns the output if successful, raises ExecutionError otherwise.
Except for the means of returning the value, this is equivalent to run.
- Parameters
command (string) – The command to run
codec (string, optional) – output encoding. Defaults to “utf-8”.
decodeerrors (string, optional) – behavior on decode errors. Defaults to “strict”. Refer to stdtypes’ bytes.decode for details.
force_tty (bool, optional) – force allocate a tty (ssh -tt). Defaults to False
stderr_merge (bool, optional) – merge ssh subprocess stderr into stdout. Defaults to False.
stdout_loglevel (int, optional) – log stdout with specific log level as well. Defaults to None, i.e. don’t log.
stderr_loglevel (int, optional) – log stderr with specific log level as well. Defaults to None, i.e. don’t log.
- Returns
- stdout of the executed command if successful and
otherwise an ExecutionError Exception
- Return type
List[str]
- add_remote_port_forward(remote_port, local_port, remote_bind=None)[source]¶
remote forward command
Note that the remote socket is not bound to any specific IP by default, making it reachable by the target. Also, ‘GatewayPorts clientspecified’ needs to be configured in the remote host’s sshd_config.
- remove_remote_port_forward(remote_port, local_port, remote_bind=None)[source]¶
remote cancel command
- __attrs_attrs__ = (Attribute(name='host', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_connected', default=False, validator=<instance_of validator for type <class 'bool'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_tmpdir', default=Factory(factory=<function SSHConnection.<lambda>>, takes_self=False), validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_l_forwards', default=Factory(factory=<class 'dict'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_r_forwards', default=Factory(factory=<class 'set'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None))¶
- __dict__ = mappingproxy({'__module__': 'labgrid.util.ssh', '__doc__': 'SSHConnections are individual connections to hosts managed by a control\n socket. In addition to command execution this class also provides an\n interface to manage port forwardings. These are used in the remote\n infrastructure to tunnel multiple connections over one SSH link.\n\n A public identity infrastructure is assumed, no extra username or passwords\n are supported.', '__attrs_post_init__': <function SSHConnection.__attrs_post_init__>, '_get_ssh_base_args': <staticmethod object>, '_get_ssh_control_args': <function SSHConnection._get_ssh_control_args>, '_get_ssh_args': <function SSHConnection._get_ssh_args>, '_open_connection': <function SSHConnection._open_connection>, '_run_socket_command': <function SSHConnection._run_socket_command>, 'get_prefix': <function SSHConnection.get_prefix>, 'run': <function SSHConnection.run>, 'run_check': <function SSHConnection.run_check>, 'get_file': <function SSHConnection.get_file>, 'put_file': <function SSHConnection.put_file>, 'add_port_forward': <function SSHConnection.add_port_forward>, 'remove_port_forward': <function SSHConnection.remove_port_forward>, 'add_remote_port_forward': <function SSHConnection.add_remote_port_forward>, 'remove_remote_port_forward': <function SSHConnection.remove_remote_port_forward>, 'connect': <function SSHConnection.connect>, 'isconnected': <function SSHConnection.isconnected>, '_check_external_master': <function SSHConnection._check_external_master>, '_start_own_master': <function SSHConnection._start_own_master>, '_stop_own_master': <function SSHConnection._stop_own_master>, '_start_keepalive': <function SSHConnection._start_keepalive>, '_check_keepalive': <function SSHConnection._check_keepalive>, '_stop_keepalive': <function SSHConnection._stop_keepalive>, 'disconnect': <function SSHConnection.disconnect>, 'cleanup': <function SSHConnection.cleanup>, '__dict__': <attribute '__dict__' of 'SSHConnection' objects>, '__weakref__': <attribute '__weakref__' of 'SSHConnection' objects>, '__attrs_attrs__': (Attribute(name='host', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_connected', default=False, validator=<instance_of validator for type <class 'bool'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_tmpdir', default=Factory(factory=<function SSHConnection.<lambda>>, takes_self=False), validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_l_forwards', default=Factory(factory=<class 'dict'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), Attribute(name='_r_forwards', default=Factory(factory=<class 'set'>, takes_self=False), validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=False, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None)), '__repr__': <function SSHConnection.__repr__>, '__eq__': <function SSHConnection.__eq__>, '__ne__': <function SSHConnection.__ne__>, '__lt__': <function SSHConnection.__lt__>, '__le__': <function SSHConnection.__le__>, '__gt__': <function SSHConnection.__gt__>, '__ge__': <function SSHConnection.__ge__>, '__hash__': None, '__init__': <function SSHConnection.__init__>, '__annotations__': {}})¶
- __eq__(other)¶
Method generated by attrs for class SSHConnection.
- __ge__(other)¶
Method generated by attrs for class SSHConnection.
- __gt__(other)¶
Method generated by attrs for class SSHConnection.
- __hash__ = None¶
- __init__(host) None ¶
Method generated by attrs for class SSHConnection.
- __le__(other)¶
Method generated by attrs for class SSHConnection.
- __lt__(other)¶
Method generated by attrs for class SSHConnection.
- __module__ = 'labgrid.util.ssh'¶
- __ne__(other)¶
Method generated by attrs for class SSHConnection.
- __repr__()¶
Method generated by attrs for class SSHConnection.
- __weakref__¶
list of weak references to the object (if defined)
- exception labgrid.util.ssh.ForwardError(msg)[source]¶
Bases:
Exception
- __attrs_attrs__ = (Attribute(name='msg', default=NOTHING, validator=<instance_of validator for type <class 'str'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
- __eq__(other)¶
Method generated by attrs for class ForwardError.
- __ge__(other)¶
Method generated by attrs for class ForwardError.
- __gt__(other)¶
Method generated by attrs for class ForwardError.
- __hash__ = None¶
- __init__(msg) None ¶
Method generated by attrs for class ForwardError.
- __le__(other)¶
Method generated by attrs for class ForwardError.
- __lt__(other)¶
Method generated by attrs for class ForwardError.
- __module__ = 'labgrid.util.ssh'¶
- __ne__(other)¶
Method generated by attrs for class ForwardError.
- __repr__()¶
Method generated by attrs for class ForwardError.
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.timeout module¶
- class labgrid.util.timeout.Timeout(timeout=120.0)[source]¶
Bases:
object
Reperents a timeout (as a deadline)
- property remaining¶
- property expired¶
- __attrs_attrs__ = (Attribute(name='timeout', default=120.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),)¶
- __dict__ = mappingproxy({'__module__': 'labgrid.util.timeout', '__doc__': 'Reperents a timeout (as a deadline)', '__attrs_post_init__': <function Timeout.__attrs_post_init__>, 'remaining': <property object>, 'expired': <property object>, '__dict__': <attribute '__dict__' of 'Timeout' objects>, '__weakref__': <attribute '__weakref__' of 'Timeout' objects>, '__attrs_attrs__': (Attribute(name='timeout', default=120.0, validator=<instance_of validator for type <class 'float'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None),), '__repr__': <function Timeout.__repr__>, '__init__': <function Timeout.__init__>, '__annotations__': {}})¶
- __init__(timeout=120.0) None ¶
Method generated by attrs for class Timeout.
- __module__ = 'labgrid.util.timeout'¶
- __repr__()¶
Method generated by attrs for class Timeout.
- __weakref__¶
list of weak references to the object (if defined)
labgrid.util.yaml module¶
This module contains the custom YAML load and dump functions and associated loader and dumper
- class labgrid.util.yaml.Loader(stream)[source]¶
Bases:
yaml.loader.SafeLoader
- __module__ = 'labgrid.util.yaml'¶
- yaml_constructors = {'tag:yaml.org,2002:null': <function SafeConstructor.construct_yaml_null>, 'tag:yaml.org,2002:bool': <function SafeConstructor.construct_yaml_bool>, 'tag:yaml.org,2002:int': <function SafeConstructor.construct_yaml_int>, 'tag:yaml.org,2002:float': <function SafeConstructor.construct_yaml_float>, 'tag:yaml.org,2002:binary': <function SafeConstructor.construct_yaml_binary>, 'tag:yaml.org,2002:timestamp': <function SafeConstructor.construct_yaml_timestamp>, 'tag:yaml.org,2002:omap': <function SafeConstructor.construct_yaml_omap>, 'tag:yaml.org,2002:pairs': <function SafeConstructor.construct_yaml_pairs>, 'tag:yaml.org,2002:set': <function SafeConstructor.construct_yaml_set>, 'tag:yaml.org,2002:str': <function _str_constructor>, 'tag:yaml.org,2002:seq': <function SafeConstructor.construct_yaml_seq>, 'tag:yaml.org,2002:map': <function _dict_constructor>, None: <function SafeConstructor.construct_undefined>, 'tag:yaml.org,2002:python/tuple': <function FullConstructor.construct_python_tuple>, '!template': <function _template_constructor>}¶
- class labgrid.util.yaml.Dumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)[source]¶
Bases:
yaml.dumper.SafeDumper
- __module__ = 'labgrid.util.yaml'¶
- yaml_representers = {<class 'NoneType'>: <function SafeRepresenter.represent_none>, <class 'str'>: <function SafeRepresenter.represent_str>, <class 'bytes'>: <function SafeRepresenter.represent_binary>, <class 'bool'>: <function SafeRepresenter.represent_bool>, <class 'int'>: <function SafeRepresenter.represent_int>, <class 'float'>: <function SafeRepresenter.represent_float>, <class 'list'>: <function SafeRepresenter.represent_list>, <class 'tuple'>: <function SafeRepresenter.represent_list>, <class 'dict'>: <function SafeRepresenter.represent_dict>, <class 'set'>: <function SafeRepresenter.represent_set>, <class 'datetime.date'>: <function SafeRepresenter.represent_date>, <class 'datetime.datetime'>: <function SafeRepresenter.represent_datetime>, None: <function SafeRepresenter.represent_undefined>, <class 'collections.OrderedDict'>: <function _dict_representer>}¶