generates classes and methods useful to a D-Bus client
Project description
Introduction
This library contains a few methods that consume an XML specification of a D-Bus interface and return classes or functions that may be useful in constructing a python D-Bus client. The XML specification has the format of the data returned by the Introspect() method of the Introspectable interface.
Methods
managed_object_class
This function consumes the spec for a single interface and returns a class which constructs objects which wrap the table for a particular object in the format returned by the GetManagedObjects() method of the ObjectManager interface. Each object has an instance method for each property of the interface.
mo_query_builder
This function consumes the spec for a single interface and returns a function which implements a query on the whole object returned by a GetManagedObjects() call. The query function takes two arguments: the GetManagedObjects() object and a dict of key/value pairs. The query function generates pairs of the object path and corresponding table which match all the key/value pairs in the table.
Errors
This library exports the exception type DbusClientError and all its subtypes. It constitutes a bug if an error of any other type is propagated during class generation or when the methods of the class are executed.
The following shows the error heirarchy. Entries after the dash indicate additional fields beyond the message which the exception contains. Only leaves of the error class heirarchy are constructed directly.
DbusClientError
DbusClientGenerationError This exception is raised if an error occurs while generating a method. Such an exception would result from introspection data which lacked the necessary attributes or entries.
DbusClientRuntimeError - interface name This exception is raised if there is an error while the generated method is executing.
DbusClientMissingInterfaceError This exception is raisded if when constructing a managed object it turns out that its argument does not have an entry for the expected interface.
DbusClientMissingPropertyError - property name This exception is raised if when reading a value for a managed object it turns out that the value corresponding to that property is not available.
DbusClientMissingSearchPropertiesError - too many fields to list here This exception is raised if when traversing a GetManagedObjects() result the keys used by the query have no corresponding values in the result.
DbusClientUnknownSearchPropertiesError – too many fields to list here This exception is raised if the search properties specified can not be found in the specified interface.
Packaging
Downstream packagers, if incorporating testing into their packaging, are encouraged to use only the tests in the test_deterministic.py module, to avoid testing failures that may arise due to the non-deterministic behavior of Hypothesis tests.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dbus-client-gen-0.5.1.tar.gz
.
File metadata
- Download URL: dbus-client-gen-0.5.1.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd15e8ef6696a2b787fd5c3374400e82819247345feefcbc67f200fa59cba16c |
|
MD5 | 210a513418d9e8a855dcc5ab809d51c1 |
|
BLAKE2b-256 | 337b11062e17733c75fdddd210ed3fd04cbe7d29fe0b753ee18a4a77a7bea2d1 |
File details
Details for the file dbus_client_gen-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: dbus_client_gen-0.5.1-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7cd626766d309b67f7ffd0b0d33d827f6b54d8a64acca3337914a63433d01bd |
|
MD5 | bc359dbab12234953c64350c70d841e2 |
|
BLAKE2b-256 | 5270c907c1bae30d99749515d144a0143e7ccbfc370a1acfc634f98192cb7cf4 |