Skip to main content

A Python Library for Generating D-Bus Client Code

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 hierarchy. Entries after the dash indicate additional fields beyond the message which the exception contains. Only leaves of the error class hierarchy 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.

Metadata

Release files for dbus-client-gen 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbus-client-gen 0.5.2
File Size Uploaded
dbus_client_gen-0.5.2.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbus-client-gen 0.5.2
File Interpreter ABI Platform
dbus_client_gen-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / dbus_client_gen-0.5.2.tar.gz

Download URL dbus_client_gen-0.5.2.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8bdbc288d3897b29b4aecdcfeba8449ceac2702a8b730d9c4ae91a58f3daf33a
BLAKE2b-256 checksum
How to use checksums
229e55bf01f41136ccb7debe5690685a3b508b678771288aacb4c50434a56b76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / dbus_client_gen-0.5.2-py3-none-any.whl

Download URL dbus_client_gen-0.5.2-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfd253adcca1ec70262a2c4ce10304c2f3b72975b21226e383ce5e03e693ade7
BLAKE2b-256 checksum
How to use checksums
1e75ad18b34c9579cbb628d846f375e936e26a08dd8d439af4f86bf96dc7e1c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page