chore: rename
This commit is contained in:
parent
7e9609b0f5
commit
36b08afbff
10
README.md
10
README.md
@ -74,7 +74,7 @@ For more information, see the [overview for the high-level client](https://dbus-
|
||||
This example connects to a media player and controls it with the [MPRIS](https://specifications.freedesktop.org/mpris-spec/latest/) DBus interface.
|
||||
|
||||
```python
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
import asyncio
|
||||
|
||||
@ -118,8 +118,8 @@ To define a service on the bus, use the `ServiceInterface` class and decorate cl
|
||||
For more information, see the [overview for the high-level service](https://python-dbus-fast.readthedocs.io/en/latest/high-level-service/index.html).
|
||||
|
||||
```python
|
||||
from dbus_next.service import ServiceInterface, method, dbus_property, signal, Variant
|
||||
from dbus_next.aio MessageBus
|
||||
from dbus_fast.service import ServiceInterface, method, dbus_property, signal, Variant
|
||||
from dbus_fast.aio MessageBus
|
||||
|
||||
import asyncio
|
||||
|
||||
@ -171,8 +171,8 @@ The low-level interface works with DBus messages directly.
|
||||
For more information, see the [overview for the low-level interface](https://python-dbus-fast.readthedocs.io/en/latest/low-level-interface/index.html).
|
||||
|
||||
```python
|
||||
from dbus_next.message import Message, MessageType
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_fast.message import Message, MessageType
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
Authentication
|
||||
==============
|
||||
|
||||
Classes for the DBus `authentication protocol <https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol>`_ for us with :class:`MessageBus <dbus_next.message_bus.BaseMessageBus>` implementations.
|
||||
Classes for the DBus `authentication protocol <https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol>`_ for us with :class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>` implementations.
|
||||
|
||||
.. autoclass:: dbus_next.auth.Authenticator
|
||||
.. autoclass:: dbus_fast.auth.Authenticator
|
||||
|
||||
.. autoclass:: dbus_next.auth.AuthExternal
|
||||
.. autoclass:: dbus_next.auth.AuthAnnonymous
|
||||
.. autoclass:: dbus_fast.auth.AuthExternal
|
||||
.. autoclass:: dbus_fast.auth.AuthAnnonymous
|
||||
|
||||
@ -16,7 +16,7 @@ import sys
|
||||
|
||||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/.."))
|
||||
|
||||
from dbus_next.__version__ import __author__, __copyright__, __title__, __version__
|
||||
from dbus_fast.__version__ import __author__, __copyright__, __title__, __version__
|
||||
|
||||
_project_slug = __title__.replace("_", "-")
|
||||
|
||||
|
||||
@ -2,38 +2,38 @@ Constants
|
||||
=========
|
||||
|
||||
|
||||
.. autoclass:: dbus_next.BusType
|
||||
.. autoclass:: dbus_fast.BusType
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.MessageType
|
||||
.. autoclass:: dbus_fast.MessageType
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.MessageFlag
|
||||
.. autoclass:: dbus_fast.MessageFlag
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.NameFlag
|
||||
.. autoclass:: dbus_fast.NameFlag
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.RequestNameReply
|
||||
.. autoclass:: dbus_fast.RequestNameReply
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.ReleaseNameReply
|
||||
.. autoclass:: dbus_fast.ReleaseNameReply
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.PropertyAccess
|
||||
.. autoclass:: dbus_fast.PropertyAccess
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.ArgDirection
|
||||
.. autoclass:: dbus_fast.ArgDirection
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.ErrorType
|
||||
.. autoclass:: dbus_fast.ErrorType
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
Errors
|
||||
======
|
||||
|
||||
.. autoclass:: dbus_next.DBusError
|
||||
.. autoclass:: dbus_fast.DBusError
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.SignatureBodyMismatchError
|
||||
.. autoclass:: dbus_next.InvalidSignatureError
|
||||
.. autoclass:: dbus_next.InvalidAddressError
|
||||
.. autoclass:: dbus_next.AuthError
|
||||
.. autoclass:: dbus_next.InvalidMessageError
|
||||
.. autoclass:: dbus_next.InvalidIntrospectionError
|
||||
.. autoclass:: dbus_next.InterfaceNotFoundError
|
||||
.. autoclass:: dbus_next.SignalDisabledError
|
||||
.. autoclass:: dbus_next.InvalidBusNameError
|
||||
.. autoclass:: dbus_next.InvalidObjectPathError
|
||||
.. autoclass:: dbus_next.InvalidInterfaceNameError
|
||||
.. autoclass:: dbus_next.InvalidMemberNameError
|
||||
.. autoclass:: dbus_fast.SignatureBodyMismatchError
|
||||
.. autoclass:: dbus_fast.InvalidSignatureError
|
||||
.. autoclass:: dbus_fast.InvalidAddressError
|
||||
.. autoclass:: dbus_fast.AuthError
|
||||
.. autoclass:: dbus_fast.InvalidMessageError
|
||||
.. autoclass:: dbus_fast.InvalidIntrospectionError
|
||||
.. autoclass:: dbus_fast.InterfaceNotFoundError
|
||||
.. autoclass:: dbus_fast.SignalDisabledError
|
||||
.. autoclass:: dbus_fast.InvalidBusNameError
|
||||
.. autoclass:: dbus_fast.InvalidObjectPathError
|
||||
.. autoclass:: dbus_fast.InvalidInterfaceNameError
|
||||
.. autoclass:: dbus_fast.InvalidMemberNameError
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
aio.ProxyInterface
|
||||
==================
|
||||
|
||||
.. autoclass:: dbus_next.aio.ProxyInterface
|
||||
.. autoclass:: dbus_fast.aio.ProxyInterface
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
aio.ProxyObject
|
||||
===============
|
||||
|
||||
.. autoclass:: dbus_next.aio.ProxyObject
|
||||
.. autoclass:: dbus_fast.aio.ProxyObject
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
BaseProxyInterface
|
||||
==================
|
||||
|
||||
.. autoclass:: dbus_next.proxy_object.BaseProxyInterface
|
||||
.. autoclass:: dbus_fast.proxy_object.BaseProxyInterface
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
BaseProxyObject
|
||||
===============
|
||||
|
||||
.. autoclass:: dbus_next.proxy_object.BaseProxyObject
|
||||
.. autoclass:: dbus_fast.proxy_object.BaseProxyObject
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
glib.ProxyInterface
|
||||
===================
|
||||
|
||||
.. autoclass:: dbus_next.glib.ProxyInterface
|
||||
.. autoclass:: dbus_fast.glib.ProxyInterface
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
glib.ProxyObject
|
||||
================
|
||||
|
||||
.. autoclass:: dbus_next.glib.ProxyObject
|
||||
.. autoclass:: dbus_fast.glib.ProxyObject
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
@ -40,11 +40,11 @@ DBus interfaces are defined with an XML-based `introspection data format <https:
|
||||
<node name="another_child_of_sample_object"/>
|
||||
</node>
|
||||
|
||||
The object at this path (a ``node``) may contain interfaces and child nodes. Nodes like this are represented in the library by a :class:`ProxyObject <dbus_next.proxy_object.BaseProxyObject>`. The interfaces contained in the nodes are represented by a :class:`ProxyInterface <dbus_next.proxy_object.BaseProxyInterface>`. The proxy interface exposes the methods, signals, and properties specified by the interface definition.
|
||||
The object at this path (a ``node``) may contain interfaces and child nodes. Nodes like this are represented in the library by a :class:`ProxyObject <dbus_fast.proxy_object.BaseProxyObject>`. The interfaces contained in the nodes are represented by a :class:`ProxyInterface <dbus_fast.proxy_object.BaseProxyInterface>`. The proxy interface exposes the methods, signals, and properties specified by the interface definition.
|
||||
|
||||
The proxy object is obtained by the :class:`MessageBus <dbus_next.message_bus.BaseMessageBus>` through the :func:`get_proxy_object() <dbus_next.message_bus.BaseMessageBus.get_proxy_object>` method. This method takes the name of the client to send messages to, the path exported by that client that is expected to export the node, and the XML introspection data. If you can, it is recommended to include the XML in your project and pass it to that method as a string. But you may also use the :func:`introspect() <dbus_next.message_bus.BaseMessageBus.introspect>` method of the message bus to get this data dynamically at runtime.
|
||||
The proxy object is obtained by the :class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>` through the :func:`get_proxy_object() <dbus_fast.message_bus.BaseMessageBus.get_proxy_object>` method. This method takes the name of the client to send messages to, the path exported by that client that is expected to export the node, and the XML introspection data. If you can, it is recommended to include the XML in your project and pass it to that method as a string. But you may also use the :func:`introspect() <dbus_fast.message_bus.BaseMessageBus.introspect>` method of the message bus to get this data dynamically at runtime.
|
||||
|
||||
Once you have a proxy object, use the :func:`get_proxy_interface() <dbus_next.proxy_object.BaseProxyObject.get_interface>` method to create an interface passing the name of the interface to get. Each message bus has its own implementation of the proxy interface which behaves slightly differently. This is an example of how to use a proxy interface for the asyncio :class:`MessageBus <dbus_next.aio.MessageBus>`.
|
||||
Once you have a proxy object, use the :func:`get_proxy_interface() <dbus_fast.proxy_object.BaseProxyObject.get_interface>` method to create an interface passing the name of the interface to get. Each message bus has its own implementation of the proxy interface which behaves slightly differently. This is an example of how to use a proxy interface for the asyncio :class:`MessageBus <dbus_fast.aio.MessageBus>`.
|
||||
|
||||
If any file descriptors are sent or received (DBus type ``h``), the variable refers to the file descriptor itself. You are responsible for closing any file descriptors sent or received by the bus. You must set the ``negotiate_unix_fd`` flag to ``True`` in the ``MessageBus`` constructor to use unix file descriptors.
|
||||
|
||||
@ -52,8 +52,8 @@ If any file descriptors are sent or received (DBus type ``h``), the variable ref
|
||||
|
||||
.. code-block:: python3
|
||||
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next import Variant
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast import Variant
|
||||
|
||||
bus = await MessageBus().connect()
|
||||
|
||||
|
||||
@ -6,11 +6,11 @@ The High Level Service
|
||||
|
||||
service-interface
|
||||
|
||||
The high level service interface provides everything you need to export interfaces on the bus. When you export an interface on your :class:`MessageBus <dbus_next.message_bus.BaseMessageBus>`, clients can send you messages to call methods, get and set properties, and listen to your signals.
|
||||
The high level service interface provides everything you need to export interfaces on the bus. When you export an interface on your :class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>`, clients can send you messages to call methods, get and set properties, and listen to your signals.
|
||||
|
||||
If you're exposing a service for general use, you can request a well-known name for your connection with :func:`MessageBus.request_name() <dbus_next.message_bus.BaseMessageBus.request_name>` so users have a predictable name to use to send messages your client.
|
||||
If you're exposing a service for general use, you can request a well-known name for your connection with :func:`MessageBus.request_name() <dbus_fast.message_bus.BaseMessageBus.request_name>` so users have a predictable name to use to send messages your client.
|
||||
|
||||
Services are defined by subclassing :class:`ServiceInterface <dbus_next.service.ServiceInterface>` and definining members as methods on the class with the decorator methods :func:`@method() <dbus_next.service.method>`, :func:`@dbus_property() <dbus_next.service.dbus_property>`, and :func:`@signal() <dbus_next.service.signal>`. The parameters of the decorated class methods must be annotated with DBus type strings to indicate the types of values they expect. See the documentation on `the type system </type-system/index.html>`_ for more information on how DBus types are mapped to Python values with signature strings. The decorator methods themselves take arguments that affect how the member is exported on the bus, such as the name of the member or the access permissions of a property.
|
||||
Services are defined by subclassing :class:`ServiceInterface <dbus_fast.service.ServiceInterface>` and definining members as methods on the class with the decorator methods :func:`@method() <dbus_fast.service.method>`, :func:`@dbus_property() <dbus_fast.service.dbus_property>`, and :func:`@signal() <dbus_fast.service.signal>`. The parameters of the decorated class methods must be annotated with DBus type strings to indicate the types of values they expect. See the documentation on `the type system </type-system/index.html>`_ for more information on how DBus types are mapped to Python values with signature strings. The decorator methods themselves take arguments that affect how the member is exported on the bus, such as the name of the member or the access permissions of a property.
|
||||
|
||||
A class method decorated with ``@method()`` will be called when a client calls the method over DBus. The parameters given to the class method will be provided by the calling client and will conform to the parameter type annotations. The value returned by the class method will be returned to the client and must conform to the return type annotation specified by the user. If the return annotation specifies more than one type, the values must be returned in a ``list``. When :class:`aio.MessageBus` is used, methods can be coroutines.
|
||||
|
||||
@ -18,9 +18,9 @@ A class method decorated with ``@dbus_property()`` will be exposed as a DBus pro
|
||||
|
||||
A class method decorated with ``@signal()`` will be exposed as a DBus signal. The value returned by the class method will be emitted as a signal and broadcast to clients who are listening to the signal. The returned value must conform to the return annotation of the class method as a DBus signature string. If the signal has more than one argument, they must be returned within a ``list``.
|
||||
|
||||
A class method decorated with ``@method()`` or ``@dbus_property()`` may throw a :class:`DBusError <dbus_next.DBusError>` to return a detailed error to the client if something goes wrong.
|
||||
A class method decorated with ``@method()`` or ``@dbus_property()`` may throw a :class:`DBusError <dbus_fast.DBusError>` to return a detailed error to the client if something goes wrong.
|
||||
|
||||
After the service interface is defined, call :func:`MessageBus.export() <dbus_next.message_bus.BaseMessageBus.export>` on a connected message bus and the service will be made available on the given object path.
|
||||
After the service interface is defined, call :func:`MessageBus.export() <dbus_fast.message_bus.BaseMessageBus.export>` on a connected message bus and the service will be made available on the given object path.
|
||||
|
||||
If any file descriptors are sent or received (DBus type ``h``), the variable refers to the file descriptor itself. You are responsible for closing any file descriptors sent or received by the bus. You must set the ``negotiate_unix_fd`` flag to ``True`` in the ``MessageBus`` constructor to use unix file descriptors.
|
||||
|
||||
@ -28,10 +28,10 @@ If any file descriptors are sent or received (DBus type ``h``), the variable ref
|
||||
|
||||
.. code-block:: python3
|
||||
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.service import (ServiceInterface,
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.service import (ServiceInterface,
|
||||
method, dbus_property, signal)
|
||||
from dbus_next import Variant, DBusError
|
||||
from dbus_fast import Variant, DBusError
|
||||
|
||||
import asyncio
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
ServiceInterface
|
||||
================
|
||||
|
||||
.. autoclass:: dbus_next.service.ServiceInterface
|
||||
.. autoclass:: dbus_fast.service.ServiceInterface
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autodecorator:: dbus_next.service.dbus_property
|
||||
.. autodecorator:: dbus_fast.service.dbus_property
|
||||
|
||||
.. autodecorator:: dbus_next.service.method
|
||||
.. autodecorator:: dbus_fast.service.method
|
||||
|
||||
.. autodecorator:: dbus_next.service.signal
|
||||
.. autodecorator:: dbus_fast.service.signal
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Python DBus-Next Documentation
|
||||
==============================
|
||||
|
||||
.. module:: dbus_next
|
||||
.. module:: dbus_fast
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
Introspection
|
||||
=============
|
||||
|
||||
.. autoclass:: dbus_next.introspection.Node
|
||||
.. autoclass:: dbus_fast.introspection.Node
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.introspection.Interface
|
||||
.. autoclass:: dbus_fast.introspection.Interface
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.introspection.Property
|
||||
.. autoclass:: dbus_fast.introspection.Property
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.introspection.Method
|
||||
.. autoclass:: dbus_fast.introspection.Method
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.introspection.Signal
|
||||
.. autoclass:: dbus_fast.introspection.Signal
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
.. autoclass:: dbus_next.introspection.Arg
|
||||
.. autoclass:: dbus_fast.introspection.Arg
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
@ -6,22 +6,22 @@ The Low Level Interface
|
||||
|
||||
message
|
||||
|
||||
The low-level interface allows you to work with messages directly through the :class:`MessageBus <dbus_next.message_bus.BaseMessageBus>` with the :class:`Message <dbus_next.Message>` class. This might be useful in the following cases:
|
||||
The low-level interface allows you to work with messages directly through the :class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>` with the :class:`Message <dbus_fast.Message>` class. This might be useful in the following cases:
|
||||
|
||||
- Implementing an application that works with DBus directly like ``dbus-send(1)`` or ``dbus-monitor(1)``.
|
||||
- Creating a new implementation of the :class:`BaseMessageBus <dbus_next.message_bus.BaseMessageBus>`.
|
||||
- Creating a new implementation of the :class:`BaseMessageBus <dbus_fast.message_bus.BaseMessageBus>`.
|
||||
- Creating clients or services that use an alternative to the standard DBus interfaces.
|
||||
|
||||
The primary methods and classes of the low-level interface are:
|
||||
|
||||
- :class:`Message <dbus_next.Message>`
|
||||
- :func:`MessageBus.send() <dbus_next.message_bus.BaseMessageBus.send>`
|
||||
- :func:`MessageBus.add_message_handler() <dbus_next.message_bus.BaseMessageBus.add_message_handler>`
|
||||
- :func:`MessageBus.remove_message_handler() <dbus_next.message_bus.BaseMessageBus.remove_message_handler>`
|
||||
- :func:`MessageBus.next_serial() <dbus_next.message_bus.BaseMessageBus.next_serial>`
|
||||
- :func:`aio.MessageBus.call() <dbus_next.aio.MessageBus.call>`
|
||||
- :func:`glib.MessageBus.call() <dbus_next.glib.MessageBus.call>`
|
||||
- :func:`glib.MessageBus.call_sync() <dbus_next.glib.MessageBus.call_sync>`
|
||||
- :class:`Message <dbus_fast.Message>`
|
||||
- :func:`MessageBus.send() <dbus_fast.message_bus.BaseMessageBus.send>`
|
||||
- :func:`MessageBus.add_message_handler() <dbus_fast.message_bus.BaseMessageBus.add_message_handler>`
|
||||
- :func:`MessageBus.remove_message_handler() <dbus_fast.message_bus.BaseMessageBus.remove_message_handler>`
|
||||
- :func:`MessageBus.next_serial() <dbus_fast.message_bus.BaseMessageBus.next_serial>`
|
||||
- :func:`aio.MessageBus.call() <dbus_fast.aio.MessageBus.call>`
|
||||
- :func:`glib.MessageBus.call() <dbus_fast.glib.MessageBus.call>`
|
||||
- :func:`glib.MessageBus.call_sync() <dbus_fast.glib.MessageBus.call_sync>`
|
||||
|
||||
Mixed use of the low and high level interfaces on the same bus connection is not recommended.
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Message
|
||||
=======
|
||||
|
||||
.. autoclass:: dbus_next.Message
|
||||
.. autoclass:: dbus_fast.Message
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
aio.MessageBus
|
||||
==============
|
||||
|
||||
.. autoclass:: dbus_next.aio.MessageBus
|
||||
.. autoclass:: dbus_fast.aio.MessageBus
|
||||
:members:
|
||||
:inherited-members:
|
||||
:show-inheritance:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
BaseMessageBus
|
||||
==============
|
||||
|
||||
.. autoclass:: dbus_next.message_bus.BaseMessageBus
|
||||
.. autoclass:: dbus_fast.message_bus.BaseMessageBus
|
||||
:members:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
glib.MessageBus
|
||||
===============
|
||||
|
||||
.. autoclass:: dbus_next.glib.MessageBus
|
||||
.. autoclass:: dbus_fast.glib.MessageBus
|
||||
:members:
|
||||
:inherited-members:
|
||||
:show-inheritance:
|
||||
|
||||
@ -10,7 +10,7 @@ The Message Bus
|
||||
|
||||
The message bus manages a connection to the DBus daemon. It's capable of sending and receiving messages and wiring up the classes of the high level interfaces.
|
||||
|
||||
There are currently two implementations of the message bus depending on what main loop implementation you want to use. Use :class:`aio.MessageBus <dbus_next.aio.MessageBus>` if you are using an asyncio main loop. Use :class:`glib.MessageBus <dbus_next.glib.MessageBus>` if you are using a GLib main loop.
|
||||
There are currently two implementations of the message bus depending on what main loop implementation you want to use. Use :class:`aio.MessageBus <dbus_fast.aio.MessageBus>` if you are using an asyncio main loop. Use :class:`glib.MessageBus <dbus_fast.glib.MessageBus>` if you are using a GLib main loop.
|
||||
|
||||
For standalone applications, the asyncio message bus is preferable because it has a nice async/await api in place of the callback/synchronous interface of the GLib message bus. If your application is using other libraries that use the GLib main loop, such as a GTK application, the GLib implementation will be needed. However neither library is a requirement.
|
||||
|
||||
|
||||
@ -51,14 +51,14 @@ below.
|
||||
| SIGNATURE | g | str | Must be a valid signature. |
|
||||
+-------------+-------+--------------------------------------+-------------------------------------------------------------------------+
|
||||
| UNIX_FD | h | int | In the low-level interface, an index pointing to a file descriptor |
|
||||
| | | | in the ``unix_fds`` member of the :class:`Message <dbus_next.Message>`. |
|
||||
| | | | in the ``unix_fds`` member of the :class:`Message <dbus_fast.Message>`. |
|
||||
| | | | In the high-level interface, it is the file descriptor itself. |
|
||||
+-------------+-------+--------------------------------------+-------------------------------------------------------------------------+
|
||||
| ARRAY | a | list | Must be followed by a complete type which specifies the child type. |
|
||||
+-------------+-------+--------------------------------------+-------------------------------------------------------------------------+
|
||||
| STRUCT | ( | list | Types in the Python ``list`` must match the types between the parens. |
|
||||
+-------------+-------+--------------------------------------+-------------------------------------------------------------------------+
|
||||
| VARIANT | v | :class:`Variant <dbus_next.Variant>` | This class is provided by the library. |
|
||||
| VARIANT | v | :class:`Variant <dbus_fast.Variant>` | This class is provided by the library. |
|
||||
| | | | |
|
||||
+-------------+-------+--------------------------------------+-------------------------------------------------------------------------+
|
||||
| DICT_ENTRY | { | dict | Must be included in an array to be a ``dict``. |
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
SignatureTree
|
||||
=============
|
||||
|
||||
.. autoclass:: dbus_next.SignatureTree
|
||||
.. autoclass:: dbus_fast.SignatureTree
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
SignatureType
|
||||
==============
|
||||
|
||||
.. autoclass:: dbus_next.SignatureType
|
||||
.. autoclass:: dbus_fast.SignatureType
|
||||
:members:
|
||||
:undoc-members:
|
||||
:exclude-members: signature
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Variant
|
||||
=======
|
||||
|
||||
.. autoclass:: dbus_next.Variant
|
||||
.. autoclass:: dbus_fast.Variant
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
Validators
|
||||
==========
|
||||
|
||||
.. autofunction:: dbus_next.is_bus_name_valid
|
||||
.. autofunction:: dbus_next.is_member_name_valid
|
||||
.. autofunction:: dbus_next.is_object_path_valid
|
||||
.. autofunction:: dbus_next.is_interface_name_valid
|
||||
.. autofunction:: dbus_next.assert_bus_name_valid
|
||||
.. autofunction:: dbus_next.assert_member_name_valid
|
||||
.. autofunction:: dbus_next.assert_object_path_valid
|
||||
.. autofunction:: dbus_next.assert_interface_name_valid
|
||||
.. autofunction:: dbus_fast.is_bus_name_valid
|
||||
.. autofunction:: dbus_fast.is_member_name_valid
|
||||
.. autofunction:: dbus_fast.is_object_path_valid
|
||||
.. autofunction:: dbus_fast.is_interface_name_valid
|
||||
.. autofunction:: dbus_fast.assert_bus_name_valid
|
||||
.. autofunction:: dbus_fast.assert_member_name_valid
|
||||
.. autofunction:: dbus_fast.assert_object_path_valid
|
||||
.. autofunction:: dbus_fast.assert_interface_name_valid
|
||||
|
||||
@ -7,8 +7,8 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__) + "/.."))
|
||||
import asyncio
|
||||
import json
|
||||
|
||||
from dbus_next import Message, MessageType
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_fast import Message, MessageType
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__) + "/.."))
|
||||
|
||||
import asyncio
|
||||
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
|
||||
@ -8,9 +8,9 @@ import asyncio
|
||||
import json
|
||||
from argparse import OPTIONAL, ArgumentParser
|
||||
|
||||
from dbus_next import BusType, Message, MessageType, Variant
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.validators import (
|
||||
from dbus_fast import BusType, Message, MessageType, Variant
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.validators import (
|
||||
is_bus_name_valid,
|
||||
is_interface_name_valid,
|
||||
is_member_name_valid,
|
||||
|
||||
@ -6,9 +6,9 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__) + "/.."))
|
||||
|
||||
import asyncio
|
||||
|
||||
from dbus_next import Variant
|
||||
from dbus_next.aio.message_bus import MessageBus
|
||||
from dbus_next.service import ServiceInterface, dbus_property, method, signal
|
||||
from dbus_fast import Variant
|
||||
from dbus_fast.aio.message_bus import MessageBus
|
||||
from dbus_fast.service import ServiceInterface, dbus_property, method, signal
|
||||
|
||||
|
||||
class ExampleInterface(ServiceInterface):
|
||||
|
||||
@ -7,10 +7,11 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__) + "/.."))
|
||||
import json
|
||||
import signal
|
||||
|
||||
from dbus_next import Message
|
||||
from dbus_next.glib import MessageBus
|
||||
from gi.repository import GLib
|
||||
|
||||
from dbus_fast import Message
|
||||
from dbus_fast.glib import MessageBus
|
||||
|
||||
main = GLib.MainLoop()
|
||||
bus = MessageBus().connect_sync()
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__) + "/.."))
|
||||
|
||||
import asyncio
|
||||
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
__title__ = "dbus_next"
|
||||
__title__ = "dbus_fast"
|
||||
__description__ = "A zero-dependency DBus library for Python with asyncio support"
|
||||
__url__ = "https://github.com/altdesktop/python-dbus-fast"
|
||||
__version__ = "0.2.3"
|
||||
|
||||
@ -109,17 +109,17 @@ class MessageBus(BaseMessageBus):
|
||||
library. It sets up a connection to the DBus daemon and exposes an
|
||||
interface to send and receive messages and expose services.
|
||||
|
||||
You must call :func:`connect() <dbus_next.aio.MessageBus.connect>` before
|
||||
You must call :func:`connect() <dbus_fast.aio.MessageBus.connect>` before
|
||||
using this message bus.
|
||||
|
||||
:param bus_type: The type of bus to connect to. Affects the search path for
|
||||
the bus address.
|
||||
:type bus_type: :class:`BusType <dbus_next.BusType>`
|
||||
:type bus_type: :class:`BusType <dbus_fast.BusType>`
|
||||
:param bus_address: A specific bus address to connect to. Should not be
|
||||
used under normal circumstances.
|
||||
:param auth: The authenticator to use, defaults to an instance of
|
||||
:class:`AuthExternal <dbus_next.auth.AuthExternal>`.
|
||||
:type auth: :class:`Authenticator <dbus_next.auth.Authenticator>`
|
||||
:class:`AuthExternal <dbus_fast.auth.AuthExternal>`.
|
||||
:type auth: :class:`Authenticator <dbus_fast.auth.Authenticator>`
|
||||
:param negotiate_unix_fd: Allow the bus to send and receive Unix file
|
||||
descriptors (DBus type 'h'). This must be supported by the transport.
|
||||
:type negotiate_unix_fd: bool
|
||||
@ -159,10 +159,10 @@ class MessageBus(BaseMessageBus):
|
||||
This method must be called before the message bus can be used.
|
||||
|
||||
:returns: This message bus for convenience.
|
||||
:rtype: :class:`MessageBus <dbus_next.aio.MessageBus>`
|
||||
:rtype: :class:`MessageBus <dbus_fast.aio.MessageBus>`
|
||||
|
||||
:raises:
|
||||
- :class:`AuthError <dbus_next.AuthError>` - If authorization to \
|
||||
- :class:`AuthError <dbus_fast.AuthError>` - If authorization to \
|
||||
the DBus daemon failed.
|
||||
- :class:`Exception` - If there was a connection error.
|
||||
"""
|
||||
@ -215,14 +215,14 @@ class MessageBus(BaseMessageBus):
|
||||
:type timeout: float
|
||||
|
||||
:returns: The introspection data for the name at the path.
|
||||
:rtype: :class:`Node <dbus_next.introspection.Node>`
|
||||
:rtype: :class:`Node <dbus_fast.introspection.Node>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` \
|
||||
- :class:`InvalidObjectPathError <dbus_fast.InvalidObjectPathError>` \
|
||||
- If the given object path is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If \
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If \
|
||||
the given bus name is not valid.
|
||||
- :class:`DBusError <dbus_next.DBusError>` - If the service threw \
|
||||
- :class:`DBusError <dbus_fast.DBusError>` - If the service threw \
|
||||
an error for the method call or returned an invalid result.
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
- :class:`asyncio.TimeoutError` - Waited for future but time run out.
|
||||
@ -247,15 +247,15 @@ class MessageBus(BaseMessageBus):
|
||||
:param name: The name to request.
|
||||
:type name: str
|
||||
:param flags: Name flags that affect the behavior of the name request.
|
||||
:type flags: :class:`NameFlag <dbus_next.NameFlag>`
|
||||
:type flags: :class:`NameFlag <dbus_fast.NameFlag>`
|
||||
|
||||
:returns: The reply to the name request.
|
||||
:rtype: :class:`RequestNameReply <dbus_next.RequestNameReply>`
|
||||
:rtype: :class:`RequestNameReply <dbus_fast.RequestNameReply>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If \
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If \
|
||||
the given bus name is not valid.
|
||||
- :class:`DBusError <dbus_next.DBusError>` - If the service threw \
|
||||
- :class:`DBusError <dbus_fast.DBusError>` - If the service threw \
|
||||
an error for the method call or returned an invalid result.
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
"""
|
||||
@ -278,12 +278,12 @@ class MessageBus(BaseMessageBus):
|
||||
:type name: str
|
||||
|
||||
:returns: The reply to the release request.
|
||||
:rtype: :class:`ReleaseNameReply <dbus_next.ReleaseNameReply>`
|
||||
:rtype: :class:`ReleaseNameReply <dbus_fast.ReleaseNameReply>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If \
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If \
|
||||
the given bus name is not valid.
|
||||
- :class:`DBusError <dbus_next.DBusError>` - If the service threw \
|
||||
- :class:`DBusError <dbus_fast.DBusError>` - If the service threw \
|
||||
an error for the method call or returned an invalid result.
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
"""
|
||||
@ -303,12 +303,12 @@ class MessageBus(BaseMessageBus):
|
||||
"""Send a method call and wait for a reply from the DBus daemon.
|
||||
|
||||
:param msg: The method call message to send.
|
||||
:type msg: :class:`Message <dbus_next.Message>`
|
||||
:type msg: :class:`Message <dbus_fast.Message>`
|
||||
|
||||
:returns: A message in reply to the message sent. If the message does
|
||||
not expect a reply based on the message flags or type, returns
|
||||
``None`` after the message is sent.
|
||||
:rtype: :class:`Message <dbus_next.Message>` or :class:`None` if no reply is expected.
|
||||
:rtype: :class:`Message <dbus_fast.Message>` or :class:`None` if no reply is expected.
|
||||
|
||||
:raises:
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
@ -342,7 +342,7 @@ class MessageBus(BaseMessageBus):
|
||||
release of the library.
|
||||
|
||||
:param msg: The message to send.
|
||||
:type msg: :class:`Message <dbus_next.Message>`
|
||||
:type msg: :class:`Message <dbus_fast.Message>`
|
||||
|
||||
:returns: A future that resolves when the message is sent or a
|
||||
connection error occurs.
|
||||
|
||||
@ -14,11 +14,11 @@ from ..signature import Variant
|
||||
class ProxyInterface(BaseProxyInterface):
|
||||
"""A class representing a proxy to an interface exported on the bus by
|
||||
another client for the asyncio :class:`MessageBus
|
||||
<dbus_next.aio.MessageBus>` implementation.
|
||||
<dbus_fast.aio.MessageBus>` implementation.
|
||||
|
||||
This class is not meant to be constructed directly by the user. Use
|
||||
:func:`ProxyObject.get_interface()
|
||||
<dbus_next.aio.ProxyObject.get_interface>` on a asyncio proxy object to get
|
||||
<dbus_fast.aio.ProxyObject.get_interface>` on a asyncio proxy object to get
|
||||
a proxy interface.
|
||||
|
||||
This class exposes methods to call DBus methods, listen to signals, and get
|
||||
@ -70,7 +70,7 @@ class ProxyInterface(BaseProxyInterface):
|
||||
must correspond to the type of the property in the interface definition.
|
||||
|
||||
If the service returns an error for a DBus call, a :class:`DBusError
|
||||
<dbus_next.DBusError>` will be raised with information about the error.
|
||||
<dbus_fast.DBusError>` will be raised with information about the error.
|
||||
"""
|
||||
|
||||
def _add_method(self, intr_method):
|
||||
@ -162,9 +162,9 @@ class ProxyInterface(BaseProxyInterface):
|
||||
|
||||
|
||||
class ProxyObject(BaseProxyObject):
|
||||
"""The proxy object implementation for the GLib :class:`MessageBus <dbus_next.glib.MessageBus>`.
|
||||
"""The proxy object implementation for the GLib :class:`MessageBus <dbus_fast.glib.MessageBus>`.
|
||||
|
||||
For more information, see the :class:`BaseProxyObject <dbus_next.proxy_object.BaseProxyObject>`.
|
||||
For more information, see the :class:`BaseProxyObject <dbus_fast.proxy_object.BaseProxyObject>`.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
||||
@ -30,7 +30,7 @@ class _AuthResponse(enum.Enum):
|
||||
|
||||
# UNSTABLE
|
||||
class Authenticator:
|
||||
"""The base class for authenticators for :class:`MessageBus <dbus_next.message_bus.BaseMessageBus>` authentication.
|
||||
"""The base class for authenticators for :class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>` authentication.
|
||||
|
||||
In the future, the library may allow extending this class for custom authentication protocols.
|
||||
|
||||
@ -54,7 +54,7 @@ class Authenticator:
|
||||
|
||||
class AuthExternal(Authenticator):
|
||||
"""An authenticator class for the external auth protocol for use with the
|
||||
:class:`MessageBus <dbus_next.message_bus.BaseMessageBus>`.
|
||||
:class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>`.
|
||||
|
||||
:sealso: https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
|
||||
"""
|
||||
@ -86,7 +86,7 @@ class AuthExternal(Authenticator):
|
||||
|
||||
class AuthAnnonymous(Authenticator):
|
||||
"""An authenticator class for the annonymous auth protocol for use with the
|
||||
:class:`MessageBus <dbus_next.message_bus.BaseMessageBus>`.
|
||||
:class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>`.
|
||||
|
||||
:sealso: https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
|
||||
"""
|
||||
|
||||
@ -133,18 +133,18 @@ class MessageBus(BaseMessageBus):
|
||||
library. It sets up a connection to the DBus daemon and exposes an
|
||||
interface to send and receive messages and expose services.
|
||||
|
||||
You must call :func:`connect() <dbus_next.glib.MessageBus.connect>` or
|
||||
:func:`connect_sync() <dbus_next.glib.MessageBus.connect_sync>` before
|
||||
You must call :func:`connect() <dbus_fast.glib.MessageBus.connect>` or
|
||||
:func:`connect_sync() <dbus_fast.glib.MessageBus.connect_sync>` before
|
||||
using this message bus.
|
||||
|
||||
:param bus_type: The type of bus to connect to. Affects the search path for
|
||||
the bus address.
|
||||
:type bus_type: :class:`BusType <dbus_next.BusType>`
|
||||
:type bus_type: :class:`BusType <dbus_fast.BusType>`
|
||||
:param bus_address: A specific bus address to connect to. Should not be
|
||||
used under normal circumstances.
|
||||
:param auth: The authenticator to use, defaults to an instance of
|
||||
:class:`AuthExternal <dbus_next.auth.AuthExternal>`.
|
||||
:type auth: :class:`Authenticator <dbus_next.auth.Authenticator>`
|
||||
:class:`AuthExternal <dbus_fast.auth.AuthExternal>`.
|
||||
:type auth: :class:`Authenticator <dbus_fast.auth.Authenticator>`
|
||||
|
||||
:ivar connected: True if this message bus is expected to be able to send
|
||||
and receive messages.
|
||||
@ -183,7 +183,7 @@ class MessageBus(BaseMessageBus):
|
||||
|
||||
:param connect_notify: A callback that will be called with this message
|
||||
bus. May return an :class:`Exception` on connection errors or
|
||||
:class:`AuthError <dbus_next.AuthError>` on authorization errors.
|
||||
:class:`AuthError <dbus_fast.AuthError>` on authorization errors.
|
||||
:type callback: :class:`Callable`
|
||||
"""
|
||||
|
||||
@ -235,10 +235,10 @@ class MessageBus(BaseMessageBus):
|
||||
message bus can be used.
|
||||
|
||||
:returns: This message bus for convenience.
|
||||
:rtype: :class:`MessageBus <dbus_next.glib.MessageBus>`
|
||||
:rtype: :class:`MessageBus <dbus_fast.glib.MessageBus>`
|
||||
|
||||
:raises:
|
||||
- :class:`AuthError <dbus_next.AuthError>` - If authorization to \
|
||||
- :class:`AuthError <dbus_fast.AuthError>` - If authorization to \
|
||||
the DBus daemon failed.
|
||||
- :class:`Exception` - If there was a connection error.
|
||||
"""
|
||||
@ -267,7 +267,7 @@ class MessageBus(BaseMessageBus):
|
||||
daemon.
|
||||
|
||||
:param msg: The method call message to send.
|
||||
:type msg: :class:`Message <dbus_next.Message>`
|
||||
:type msg: :class:`Message <dbus_fast.Message>`
|
||||
:param reply_notify: A callback that will be called with the reply to
|
||||
this message. May return an :class:`Exception` on connection errors.
|
||||
:type reply_notify: Callable
|
||||
@ -279,15 +279,15 @@ class MessageBus(BaseMessageBus):
|
||||
daemon.
|
||||
|
||||
:param msg: The method call message to send.
|
||||
:type msg: :class:`Message <dbus_next.Message>`
|
||||
:type msg: :class:`Message <dbus_fast.Message>`
|
||||
|
||||
:returns: A message in reply to the message sent. If the message does
|
||||
not expect a reply based on the message flags or type, returns
|
||||
``None`` immediately.
|
||||
:rtype: :class:`Message <dbus_next.Message>`
|
||||
:rtype: :class:`Message <dbus_fast.Message>`
|
||||
|
||||
:raises:
|
||||
- :class:`DBusError <dbus_next.DBusError>` - If the service threw \
|
||||
- :class:`DBusError <dbus_fast.DBusError>` - If the service threw \
|
||||
an error for the method call or returned an invalid result.
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
"""
|
||||
@ -336,14 +336,14 @@ class MessageBus(BaseMessageBus):
|
||||
:type path: str
|
||||
|
||||
:returns: The introspection data for the name at the path.
|
||||
:rtype: :class:`Node <dbus_next.introspection.Node>`
|
||||
:rtype: :class:`Node <dbus_fast.introspection.Node>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` \
|
||||
- :class:`InvalidObjectPathError <dbus_fast.InvalidObjectPathError>` \
|
||||
- If the given object path is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If \
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If \
|
||||
the given bus name is not valid.
|
||||
- :class:`DBusError <dbus_next.DBusError>` - If the service threw \
|
||||
- :class:`DBusError <dbus_fast.DBusError>` - If the service threw \
|
||||
an error for the method call or returned an invalid result.
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
"""
|
||||
@ -376,15 +376,15 @@ class MessageBus(BaseMessageBus):
|
||||
:param name: The name to request.
|
||||
:type name: str
|
||||
:param flags: Name flags that affect the behavior of the name request.
|
||||
:type flags: :class:`NameFlag <dbus_next.NameFlag>`
|
||||
:type flags: :class:`NameFlag <dbus_fast.NameFlag>`
|
||||
|
||||
:returns: The reply to the name request.
|
||||
:rtype: :class:`RequestNameReply <dbus_next.RequestNameReply>`
|
||||
:rtype: :class:`RequestNameReply <dbus_fast.RequestNameReply>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If \
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If \
|
||||
the given bus name is not valid.
|
||||
- :class:`DBusError <dbus_next.DBusError>` - If the service threw \
|
||||
- :class:`DBusError <dbus_fast.DBusError>` - If the service threw \
|
||||
an error for the method call or returned an invalid result.
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
"""
|
||||
@ -416,12 +416,12 @@ class MessageBus(BaseMessageBus):
|
||||
:type name: str
|
||||
|
||||
:returns: The reply to the release request.
|
||||
:rtype: :class:`ReleaseNameReply <dbus_next.ReleaseNameReply>`
|
||||
:rtype: :class:`ReleaseNameReply <dbus_fast.ReleaseNameReply>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If \
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If \
|
||||
the given bus name is not valid.
|
||||
- :class:`DBusError <dbus_next.DBusError>` - If the service threw \
|
||||
- :class:`DBusError <dbus_fast.DBusError>` - If the service threw \
|
||||
an error for the method call or returned an invalid result.
|
||||
- :class:`Exception` - If a connection error occurred.
|
||||
"""
|
||||
|
||||
@ -18,12 +18,12 @@ except ImportError:
|
||||
|
||||
class ProxyInterface(BaseProxyInterface):
|
||||
"""A class representing a proxy to an interface exported on the bus by
|
||||
another client for the GLib :class:`MessageBus <dbus_next.glib.MessageBus>`
|
||||
another client for the GLib :class:`MessageBus <dbus_fast.glib.MessageBus>`
|
||||
implementation.
|
||||
|
||||
This class is not meant to be constructed directly by the user. Use
|
||||
:func:`ProxyObject.get_interface()
|
||||
<dbus_next.glib.ProxyObject.get_interface>` on a GLib proxy
|
||||
<dbus_fast.glib.ProxyObject.get_interface>` on a GLib proxy
|
||||
object to get a proxy interface.
|
||||
|
||||
This class exposes methods to call DBus methods, listen to signals, and get
|
||||
@ -49,7 +49,7 @@ class ProxyInterface(BaseProxyInterface):
|
||||
To *asynchronously* call a method, provide a callback that takes an error
|
||||
as the first argument and a list as the second argument. If the call
|
||||
completed successfully, ``error`` will be :class:`None`. If the service
|
||||
returns an error, it will be a :class:`DBusError <dbus_next.DBusError>`
|
||||
returns an error, it will be a :class:`DBusError <dbus_fast.DBusError>`
|
||||
with information about the error returned from the bus. The result will be
|
||||
a list of values that correspond to the *out args* of the introspection
|
||||
method definition.
|
||||
@ -101,11 +101,11 @@ class ProxyInterface(BaseProxyInterface):
|
||||
To asynchronously get or set a property, provide a callback that takes an
|
||||
:class:`Exception` as the first argument. If the call completed
|
||||
successfully, ``error`` will be :class:`None`. If the service returns an
|
||||
error, it will be a :class:`DBusError <dbus_next.DBusError>` with
|
||||
error, it will be a :class:`DBusError <dbus_fast.DBusError>` with
|
||||
information about the error returned from the bus.
|
||||
|
||||
If the service returns an error for a synchronous DBus call, a
|
||||
:class:`DBusError <dbus_next.DBusError>` will be raised with information
|
||||
:class:`DBusError <dbus_fast.DBusError>` will be raised with information
|
||||
about the error.
|
||||
"""
|
||||
|
||||
@ -288,9 +288,9 @@ class ProxyInterface(BaseProxyInterface):
|
||||
|
||||
|
||||
class ProxyObject(BaseProxyObject):
|
||||
"""The proxy object implementation for the asyncio :class:`MessageBus <dbus_next.aio.MessageBus>`.
|
||||
"""The proxy object implementation for the asyncio :class:`MessageBus <dbus_fast.aio.MessageBus>`.
|
||||
|
||||
For more information, see the :class:`BaseProxyObject <dbus_next.proxy_object.BaseProxyObject>`.
|
||||
For more information, see the :class:`BaseProxyObject <dbus_fast.proxy_object.BaseProxyObject>`.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
||||
@ -16,16 +16,16 @@ class Arg:
|
||||
:ivar name: The name of this arg.
|
||||
:vartype name: str
|
||||
:ivar direction: Whether this is an input or an output argument.
|
||||
:vartype direction: :class:`ArgDirection <dbus_next.ArgDirection>`
|
||||
:vartype direction: :class:`ArgDirection <dbus_fast.ArgDirection>`
|
||||
:ivar type: The parsed signature type of this argument.
|
||||
:vartype type: :class:`SignatureType <dbus_next.SignatureType>`
|
||||
:vartype type: :class:`SignatureType <dbus_fast.SignatureType>`
|
||||
:ivar signature: The signature string of this argument.
|
||||
:vartype signature: str
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidMemberNameError <dbus_next.InvalidMemberNameError>` - If the name of the arg is not valid.
|
||||
- :class:`InvalidSignatureError <dbus_next.InvalidSignatureError>` - If the signature is not valid.
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the signature is not a single complete type.
|
||||
- :class:`InvalidMemberNameError <dbus_fast.InvalidMemberNameError>` - If the name of the arg is not valid.
|
||||
- :class:`InvalidSignatureError <dbus_fast.InvalidSignatureError>` - If the signature is not valid.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the signature is not a single complete type.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@ -63,10 +63,10 @@ class Arg:
|
||||
:param element: The parsed XML element.
|
||||
:type element: :class:`xml.etree.ElementTree.Element`
|
||||
:param direction: The direction of this arg. Must be specified because it can default to different values depending on if it's in a method or signal.
|
||||
:type direction: :class:`ArgDirection <dbus_next.ArgDirection>`
|
||||
:type direction: :class:`ArgDirection <dbus_fast.ArgDirection>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
"""
|
||||
name = element.attrib.get("name")
|
||||
signature = element.attrib.get("type")
|
||||
@ -102,7 +102,7 @@ class Signal:
|
||||
:vartype signature: str
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidMemberNameError <dbus_next.InvalidMemberNameError>` - If the name of the signal is not a valid member name.
|
||||
- :class:`InvalidMemberNameError <dbus_fast.InvalidMemberNameError>` - If the name of the signal is not a valid member name.
|
||||
"""
|
||||
|
||||
def __init__(self, name: str, args: List[Arg] = None):
|
||||
@ -124,7 +124,7 @@ class Signal:
|
||||
:type is_root: bool
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
"""
|
||||
name = element.attrib.get("name")
|
||||
if not name:
|
||||
@ -165,7 +165,7 @@ class Method:
|
||||
:vartype out_signature: str
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidMemberNameError <dbus_next.InvalidMemberNameError>` - If the name of this method is not valid.
|
||||
- :class:`InvalidMemberNameError <dbus_fast.InvalidMemberNameError>` - If the name of this method is not valid.
|
||||
"""
|
||||
|
||||
def __init__(self, name: str, in_args: List[Arg] = [], out_args: List[Arg] = []):
|
||||
@ -188,7 +188,7 @@ class Method:
|
||||
:type is_root: bool
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
"""
|
||||
name = element.attrib.get("name")
|
||||
if not name:
|
||||
@ -230,14 +230,14 @@ class Property:
|
||||
:ivar signature: The signature string for this property. Must be a single complete type.
|
||||
:vartype signature: str
|
||||
:ivar access: Whether this property is readable and writable.
|
||||
:vartype access: :class:`PropertyAccess <dbus_next.PropertyAccess>`
|
||||
:vartype access: :class:`PropertyAccess <dbus_fast.PropertyAccess>`
|
||||
:ivar type: The parsed type of this property.
|
||||
:vartype type: :class:`SignatureType <dbus_next.SignatureType>`
|
||||
:vartype type: :class:`SignatureType <dbus_fast.SignatureType>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the property is not a single complete type.
|
||||
- :class `InvalidSignatureError <dbus_next.InvalidSignatureError>` - If the given signature is not valid.
|
||||
- :class: `InvalidMemberNameError <dbus_next.InvalidMemberNameError>` - If the member name is not valid.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the property is not a single complete type.
|
||||
- :class `InvalidSignatureError <dbus_fast.InvalidSignatureError>` - If the given signature is not valid.
|
||||
- :class: `InvalidMemberNameError <dbus_fast.InvalidMemberNameError>` - If the member name is not valid.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@ -268,7 +268,7 @@ class Property:
|
||||
:type element: :class:`xml.etree.ElementTree.Element`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
"""
|
||||
name = element.attrib.get("name")
|
||||
signature = element.attrib.get("type")
|
||||
@ -306,7 +306,7 @@ class Interface:
|
||||
:vartype properties: list(:class:`Property`)
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidInterfaceNameError <dbus_next.InvalidInterfaceNameError>` - If the name is not a valid interface name.
|
||||
- :class:`InvalidInterfaceNameError <dbus_fast.InvalidInterfaceNameError>` - If the name is not a valid interface name.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@ -334,7 +334,7 @@ class Interface:
|
||||
:type element: :class:`xml.etree.ElementTree.Element`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
"""
|
||||
name = element.attrib.get("name")
|
||||
if not name:
|
||||
@ -377,12 +377,12 @@ class Node:
|
||||
|
||||
This class is an essential building block for a high-level DBus interface.
|
||||
This is the underlying data structure for the :class:`ProxyObject
|
||||
<dbus_next.proxy_object.BaseProxyInterface>`. A :class:`ServiceInterface
|
||||
<dbus_next.service.ServiceInterface>` definition is converted to this class
|
||||
<dbus_fast.proxy_object.BaseProxyInterface>`. A :class:`ServiceInterface
|
||||
<dbus_fast.service.ServiceInterface>` definition is converted to this class
|
||||
to expose XML on the introspectable interface.
|
||||
|
||||
:ivar interfaces: A list of interfaces exposed on this node.
|
||||
:vartype interfaces: list(:class:`Interface <dbus_next.introspection.Interface>`)
|
||||
:vartype interfaces: list(:class:`Interface <dbus_fast.introspection.Interface>`)
|
||||
:ivar nodes: A list of child nodes.
|
||||
:vartype nodes: list(:class:`Node`)
|
||||
:ivar name: The object path of this node.
|
||||
@ -391,7 +391,7 @@ class Node:
|
||||
:vartype is_root: bool
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the name is not a valid node name.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the name is not a valid node name.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@ -417,7 +417,7 @@ class Node:
|
||||
:type is_root: bool
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the XML tree is not valid introspection data.
|
||||
"""
|
||||
node = Node(element.attrib.get("name"), is_root=is_root)
|
||||
|
||||
@ -439,7 +439,7 @@ class Node:
|
||||
:type data: str
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the string is not valid introspection data.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the string is not valid introspection data.
|
||||
"""
|
||||
element = ET.fromstring(data)
|
||||
if element.tag != "node":
|
||||
|
||||
@ -15,7 +15,7 @@ from .validators import (
|
||||
|
||||
class Message:
|
||||
"""A class for sending and receiving messages through the
|
||||
:class:`MessageBus <dbus_next.message_bus.BaseMessageBus>` with the
|
||||
:class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>` with the
|
||||
low-level api.
|
||||
|
||||
A ``Message`` can be constructed by the user to send over the message bus.
|
||||
|
||||
@ -38,14 +38,14 @@ class BaseMessageBus:
|
||||
|
||||
:param bus_type: The type of bus to connect to. Affects the search path for
|
||||
the bus address.
|
||||
:type bus_type: :class:`BusType <dbus_next.BusType>`
|
||||
:type bus_type: :class:`BusType <dbus_fast.BusType>`
|
||||
:param bus_address: A specific bus address to connect to. Should not be
|
||||
used under normal circumstances.
|
||||
:type bus_address: str
|
||||
:param ProxyObject: The proxy object implementation for this message bus.
|
||||
Must be passed in by an implementation that supports the high-level client.
|
||||
:type ProxyObject: Type[:class:`BaseProxyObject
|
||||
<dbus_next.proxy_object.BaseProxyObject>`]
|
||||
<dbus_fast.proxy_object.BaseProxyObject>`]
|
||||
|
||||
:ivar unique_name: The unique name of the message bus connection. It will
|
||||
be :class:`None` until the message bus connects.
|
||||
@ -111,10 +111,10 @@ class BaseMessageBus:
|
||||
:type path: str
|
||||
:param interface: The service interface to export.
|
||||
:type interface: :class:`ServiceInterface
|
||||
<dbus_next.service.ServiceInterface>`
|
||||
<dbus_fast.service.ServiceInterface>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidObjectPathError <dbus_fast.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`ValueError` - If an interface with this name is already exported on the message bus at this path
|
||||
"""
|
||||
assert_object_path_valid(path)
|
||||
@ -145,10 +145,10 @@ class BaseMessageBus:
|
||||
:param interface: The interface instance or the name of the interface
|
||||
to unexport. If ``None``, unexport every interface on the path.
|
||||
:type interface: :class:`ServiceInterface
|
||||
<dbus_next.service.ServiceInterface>` or str or None
|
||||
<dbus_fast.service.ServiceInterface>` or str or None
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidObjectPathError <dbus_fast.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
"""
|
||||
assert_object_path_valid(path)
|
||||
if type(interface) not in [str, type(None)] and not isinstance(
|
||||
@ -202,12 +202,12 @@ class BaseMessageBus:
|
||||
:param path: The path to introspect.
|
||||
:type path: str
|
||||
:param callback: A callback that will be called with the introspection
|
||||
data as a :class:`Node <dbus_next.introspection.Node>`.
|
||||
data as a :class:`Node <dbus_fast.introspection.Node>`.
|
||||
:type callback: :class:`Callable`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
- :class:`InvalidObjectPathError <dbus_fast.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
"""
|
||||
BaseMessageBus._check_callback_type(callback)
|
||||
|
||||
@ -241,7 +241,7 @@ class BaseMessageBus:
|
||||
:type path: str
|
||||
:param interface: Exported service interface.
|
||||
:type interface: :class:`ServiceInterface
|
||||
<dbus_next.service.ServiceInterface>`
|
||||
<dbus_fast.service.ServiceInterface>`
|
||||
"""
|
||||
if self._disconnected:
|
||||
return
|
||||
@ -309,13 +309,13 @@ class BaseMessageBus:
|
||||
:param name: The name to request.
|
||||
:type name: str
|
||||
:param flags: Name flags that affect the behavior of the name request.
|
||||
:type flags: :class:`NameFlag <dbus_next.NameFlag>`
|
||||
:type flags: :class:`NameFlag <dbus_fast.NameFlag>`
|
||||
:param callback: A callback that will be called with the reply of the
|
||||
request as a :class:`RequestNameReply <dbus_next.RequestNameReply>`.
|
||||
request as a :class:`RequestNameReply <dbus_fast.RequestNameReply>`.
|
||||
:type callback: :class:`Callable`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
"""
|
||||
assert_bus_name_valid(name)
|
||||
|
||||
@ -360,11 +360,11 @@ class BaseMessageBus:
|
||||
:type name: str
|
||||
:param callback: A callback that will be called with the reply of the
|
||||
release request as a :class:`ReleaseNameReply
|
||||
<dbus_next.ReleaseNameReply>`.
|
||||
<dbus_fast.ReleaseNameReply>`.
|
||||
:type callback: :class:`Callable`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
"""
|
||||
assert_bus_name_valid(name)
|
||||
|
||||
@ -408,15 +408,15 @@ class BaseMessageBus:
|
||||
:type path: str
|
||||
:param introspection: XML introspection data used to build the
|
||||
interfaces on the proxy object.
|
||||
:type introspection: :class:`Node <dbus_next.introspection.Node>` or str or :class:`ElementTree`
|
||||
:type introspection: :class:`Node <dbus_fast.introspection.Node>` or str or :class:`ElementTree`
|
||||
|
||||
:returns: A proxy object for the given path on the given name.
|
||||
:rtype: :class:`BaseProxyObject <dbus_next.proxy_object.BaseProxyObject>`
|
||||
:rtype: :class:`BaseProxyObject <dbus_fast.proxy_object.BaseProxyObject>`
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the introspection data for the node is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
- :class:`InvalidObjectPathError <dbus_fast.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the introspection data for the node is not valid.
|
||||
"""
|
||||
if self._ProxyObject is None:
|
||||
raise Exception(
|
||||
@ -440,7 +440,7 @@ class BaseMessageBus:
|
||||
|
||||
def next_serial(self) -> int:
|
||||
"""Get the next serial for this bus. This can be used as the ``serial``
|
||||
attribute of a :class:`Message <dbus_next.Message>` to manually handle
|
||||
attribute of a :class:`Message <dbus_fast.Message>` to manually handle
|
||||
the serial of messages.
|
||||
|
||||
:returns: The next serial for the bus.
|
||||
@ -455,7 +455,7 @@ class BaseMessageBus:
|
||||
"""Add a custom message handler for incoming messages.
|
||||
|
||||
The handler should be a callable that takes a :class:`Message
|
||||
<dbus_next.Message>`. If the message is a method call, you may return
|
||||
<dbus_fast.Message>`. If the message is a method call, you may return
|
||||
another Message as a reply and it will be marked as handled. You may
|
||||
also return ``True`` to mark the message as handled without sending a
|
||||
reply.
|
||||
@ -479,7 +479,7 @@ class BaseMessageBus:
|
||||
):
|
||||
"""Remove a message handler that was previously added by
|
||||
:func:`add_message_handler()
|
||||
<dbus_next.message_bus.BaseMessageBus.add_message_handler>`.
|
||||
<dbus_fast.message_bus.BaseMessageBus.add_message_handler>`.
|
||||
|
||||
:param handler: A message handler.
|
||||
:type handler: :class:`Callable`
|
||||
@ -493,7 +493,7 @@ class BaseMessageBus:
|
||||
"""Asynchronously send a message on the message bus.
|
||||
|
||||
:param msg: The message to send.
|
||||
:type msg: :class:`Message <dbus_next.Message>`
|
||||
:type msg: :class:`Message <dbus_fast.Message>`
|
||||
"""
|
||||
raise NotImplementedError(
|
||||
'the "send" method must be implemented in the inheriting class'
|
||||
|
||||
@ -35,9 +35,9 @@ class BaseProxyInterface:
|
||||
:ivar path: The object path exported on the client that owns the bus name.
|
||||
:vartype path: str
|
||||
:ivar introspection: Parsed introspection data for the proxy interface.
|
||||
:vartype introspection: :class:`Node <dbus_next.introspection.Interface>`
|
||||
:vartype introspection: :class:`Node <dbus_fast.introspection.Interface>`
|
||||
:ivar bus: The message bus this proxy interface is connected to.
|
||||
:vartype bus: :class:`BaseMessageBus <dbus_next.message_bus.BaseMessageBus>`
|
||||
:vartype bus: :class:`BaseMessageBus <dbus_fast.message_bus.BaseMessageBus>`
|
||||
"""
|
||||
|
||||
def __init__(self, bus_name, path, introspection, bus):
|
||||
@ -157,7 +157,7 @@ class BaseProxyObject:
|
||||
|
||||
Implementations of this class are not meant to be constructed directly. Use
|
||||
:func:`BaseMessageBus.get_proxy_object()
|
||||
<dbus_next.message_bus.BaseMessageBus.get_proxy_object>` to get a proxy
|
||||
<dbus_fast.message_bus.BaseMessageBus.get_proxy_object>` to get a proxy
|
||||
object. Each message bus implementation provides its own proxy object
|
||||
implementation that will be returned by that method.
|
||||
|
||||
@ -173,18 +173,18 @@ class BaseProxyObject:
|
||||
:ivar path: The object path exported on the client that owns the bus name.
|
||||
:vartype path: str
|
||||
:ivar introspection: Parsed introspection data for the proxy object.
|
||||
:vartype introspection: :class:`Node <dbus_next.introspection.Node>`
|
||||
:vartype introspection: :class:`Node <dbus_fast.introspection.Node>`
|
||||
:ivar bus: The message bus this proxy object is connected to.
|
||||
:vartype bus: :class:`BaseMessageBus <dbus_next.message_bus.BaseMessageBus>`
|
||||
:vartype bus: :class:`BaseMessageBus <dbus_fast.message_bus.BaseMessageBus>`
|
||||
:ivar ~.ProxyInterface: The proxy interface class this proxy object uses.
|
||||
:vartype ~.ProxyInterface: Type[:class:`BaseProxyInterface <dbus_next.proxy_object.BaseProxyObject>`]
|
||||
:vartype ~.ProxyInterface: Type[:class:`BaseProxyInterface <dbus_fast.proxy_object.BaseProxyObject>`]
|
||||
:ivar child_paths: A list of absolute object paths of the children of this object.
|
||||
:vartype child_paths: list(str)
|
||||
|
||||
:raises:
|
||||
- :class:`InvalidBusNameError <dbus_next.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
- :class:`InvalidObjectPathError <dbus_next.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidIntrospectionError <dbus_next.InvalidIntrospectionError>` - If the introspection data for the node is not valid.
|
||||
- :class:`InvalidBusNameError <dbus_fast.InvalidBusNameError>` - If the given bus name is not valid.
|
||||
- :class:`InvalidObjectPathError <dbus_fast.InvalidObjectPathError>` - If the given object path is not valid.
|
||||
- :class:`InvalidIntrospectionError <dbus_fast.InvalidIntrospectionError>` - If the introspection data for the node is not valid.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@ -232,7 +232,7 @@ class BaseProxyObject:
|
||||
:type name: str
|
||||
|
||||
:raises:
|
||||
- :class:`InterfaceNotFoundError <dbus_next.InterfaceNotFoundError>` - If there is no interface by this name exported on the bus.
|
||||
- :class:`InterfaceNotFoundError <dbus_fast.InterfaceNotFoundError>` - If there is no interface by this name exported on the bus.
|
||||
"""
|
||||
if name in self._interfaces:
|
||||
return self._interfaces[name]
|
||||
|
||||
@ -65,7 +65,7 @@ def method(name: str = None, disabled: bool = False):
|
||||
dbus-fast type system. If multiple parameters are returned, they must be
|
||||
contained within a :class:`list`.
|
||||
|
||||
The decorated method may raise a :class:`DBusError <dbus_next.DBusError>`
|
||||
The decorated method may raise a :class:`DBusError <dbus_fast.DBusError>`
|
||||
to return an error to the client.
|
||||
|
||||
:param name: The member name that DBus clients will use to call this method. Defaults to the name of the class method.
|
||||
@ -271,7 +271,7 @@ def dbus_property(
|
||||
|
||||
The parameters of the getter and the setter must conform to the dbus-fast
|
||||
type system. The getter or the setter may raise a :class:`DBusError
|
||||
<dbus_next.DBusError>` to return an error to the client.
|
||||
<dbus_fast.DBusError>` to return an error to the client.
|
||||
|
||||
:param name: The name that DBus clients will use to interact with this
|
||||
property on the bus.
|
||||
@ -311,12 +311,12 @@ class ServiceInterface:
|
||||
"""An abstract class that can be extended by the user to define DBus services.
|
||||
|
||||
Instances of :class:`ServiceInterface` can be exported on a path of the bus
|
||||
with the :class:`export <dbus_next.message_bus.BaseMessageBus.export>`
|
||||
method of a :class:`MessageBus <dbus_next.message_bus.BaseMessageBus>`.
|
||||
with the :class:`export <dbus_fast.message_bus.BaseMessageBus.export>`
|
||||
method of a :class:`MessageBus <dbus_fast.message_bus.BaseMessageBus>`.
|
||||
|
||||
Use the :func:`@method <dbus_next.service.method>`, :func:`@dbus_property
|
||||
<dbus_next.service.dbus_property>`, and :func:`@signal
|
||||
<dbus_next.service.signal>` decorators to mark class methods as DBus
|
||||
Use the :func:`@method <dbus_fast.service.method>`, :func:`@dbus_property
|
||||
<dbus_fast.service.dbus_property>`, and :func:`@signal
|
||||
<dbus_fast.service.signal>` decorators to mark class methods as DBus
|
||||
methods, properties, and signals respectively.
|
||||
|
||||
:ivar name: The name of this interface as it appears to clients. Must be a
|
||||
@ -402,7 +402,7 @@ class ServiceInterface:
|
||||
This might be useful for creating clients for the interface or examining the introspection output of an interface.
|
||||
|
||||
:returns: The introspection data for the interface.
|
||||
:rtype: :class:`dbus_next.introspection.Interface`
|
||||
:rtype: :class:`dbus_fast.introspection.Interface`
|
||||
"""
|
||||
# TODO cannot be overridden by a dbus member
|
||||
return intr.Interface(
|
||||
|
||||
@ -449,6 +449,6 @@ class Variant:
|
||||
return super().__eq__(other)
|
||||
|
||||
def __repr__(self):
|
||||
return "<dbus_next.signature.Variant ('{}', {})>".format(
|
||||
return "<dbus_fast.signature.Variant ('{}', {})>".format(
|
||||
self.type.signature, self.value
|
||||
)
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
from test.util import check_gi_repository, skip_reason_no_gi
|
||||
|
||||
import dbus_next.introspection as intr
|
||||
import pytest
|
||||
from dbus_next import DBusError, aio, glib
|
||||
from dbus_next.message import MessageFlag
|
||||
from dbus_next.service import ServiceInterface, method
|
||||
|
||||
import dbus_fast.introspection as intr
|
||||
from dbus_fast import DBusError, aio, glib
|
||||
from dbus_fast.message import MessageFlag
|
||||
from dbus_fast.service import ServiceInterface, method
|
||||
|
||||
has_gi = check_gi_repository()
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
from test.util import check_gi_repository, skip_reason_no_gi
|
||||
|
||||
import pytest
|
||||
from dbus_next import DBusError, Message, aio, glib
|
||||
from dbus_next.service import PropertyAccess, ServiceInterface, dbus_property
|
||||
|
||||
from dbus_fast import DBusError, Message, aio, glib
|
||||
from dbus_fast.service import PropertyAccess, ServiceInterface, dbus_property
|
||||
|
||||
has_gi = check_gi_repository()
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import pytest
|
||||
from dbus_next import Message
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.constants import RequestNameReply
|
||||
from dbus_next.introspection import Node
|
||||
from dbus_next.service import ServiceInterface, signal
|
||||
|
||||
from dbus_fast import Message
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.constants import RequestNameReply
|
||||
from dbus_fast.introspection import Node
|
||||
from dbus_fast.service import ServiceInterface, signal
|
||||
|
||||
|
||||
class ExampleInterface(ServiceInterface):
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
from dbus_next import PropertyAccess
|
||||
from dbus_next import introspection as intr
|
||||
from dbus_next.service import ServiceInterface, dbus_property, method, signal
|
||||
from dbus_fast import PropertyAccess
|
||||
from dbus_fast import introspection as intr
|
||||
from dbus_fast.service import ServiceInterface, dbus_property, method, signal
|
||||
|
||||
|
||||
class ExampleInterface(ServiceInterface):
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import pytest
|
||||
from dbus_next import Message, MessageType
|
||||
from dbus_next import introspection as intr
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.service import ServiceInterface, method
|
||||
|
||||
from dbus_fast import Message, MessageType
|
||||
from dbus_fast import introspection as intr
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.service import ServiceInterface, method
|
||||
|
||||
standard_interfaces_count = len(intr.Node.default().interfaces)
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import pytest
|
||||
from dbus_next import (
|
||||
|
||||
from dbus_fast import (
|
||||
DBusError,
|
||||
ErrorType,
|
||||
Message,
|
||||
@ -8,8 +9,8 @@ from dbus_next import (
|
||||
SignatureTree,
|
||||
Variant,
|
||||
)
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.service import ServiceInterface, method
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.service import ServiceInterface, method
|
||||
|
||||
|
||||
class ExampleInterface(ServiceInterface):
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
from dbus_next import (
|
||||
|
||||
from dbus_fast import (
|
||||
DBusError,
|
||||
ErrorType,
|
||||
Message,
|
||||
@ -9,8 +10,8 @@ from dbus_next import (
|
||||
PropertyAccess,
|
||||
Variant,
|
||||
)
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.service import ServiceInterface, dbus_property, method
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.service import ServiceInterface, dbus_property, method
|
||||
|
||||
|
||||
class ExampleInterface(ServiceInterface):
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
from dbus_next import Message, MessageType
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.constants import PropertyAccess
|
||||
from dbus_next.service import (
|
||||
|
||||
from dbus_fast import Message, MessageType
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.constants import PropertyAccess
|
||||
from dbus_fast.service import (
|
||||
ServiceInterface,
|
||||
SignalDisabledError,
|
||||
dbus_property,
|
||||
signal,
|
||||
)
|
||||
from dbus_next.signature import Variant
|
||||
from dbus_fast.signature import Variant
|
||||
|
||||
|
||||
class ExampleInterface(ServiceInterface):
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
import pytest
|
||||
from dbus_next import Message, MessageType
|
||||
from dbus_next import introspection as intr
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.constants import ErrorType
|
||||
from dbus_next.service import PropertyAccess, ServiceInterface, dbus_property
|
||||
from dbus_next.signature import Variant
|
||||
|
||||
from dbus_fast import Message, MessageType
|
||||
from dbus_fast import introspection as intr
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.constants import ErrorType
|
||||
from dbus_fast.service import PropertyAccess, ServiceInterface, dbus_property
|
||||
from dbus_fast.signature import Variant
|
||||
|
||||
standard_interfaces_count = len(intr.Node.default().interfaces)
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from dbus_next._private.address import parse_address
|
||||
from dbus_fast._private.address import parse_address
|
||||
|
||||
|
||||
def test_valid_addresses():
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import pytest
|
||||
from dbus_next import Message, MessageFlag, MessageType
|
||||
from dbus_next.aio import MessageBus
|
||||
|
||||
from dbus_fast import Message, MessageFlag, MessageType
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
from test.util import check_gi_repository, skip_reason_no_gi
|
||||
|
||||
import pytest
|
||||
from dbus_next import Message, MessageType, aio, glib
|
||||
from dbus_next.service import ServiceInterface, method
|
||||
|
||||
from dbus_fast import Message, MessageType, aio, glib
|
||||
from dbus_fast.service import ServiceInterface, method
|
||||
|
||||
has_gi = check_gi_repository()
|
||||
|
||||
|
||||
@ -2,8 +2,9 @@ import functools
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from dbus_next import Message
|
||||
from dbus_next.aio import MessageBus
|
||||
|
||||
from dbus_fast import Message
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
@ -2,10 +2,11 @@
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from dbus_next import Message, MessageType
|
||||
from dbus_next.aio import MessageBus
|
||||
from dbus_next.service import ServiceInterface, dbus_property, method, signal
|
||||
from dbus_next.signature import SignatureTree, Variant
|
||||
|
||||
from dbus_fast import Message, MessageType
|
||||
from dbus_fast.aio import MessageBus
|
||||
from dbus_fast.service import ServiceInterface, dbus_property, method, signal
|
||||
from dbus_fast.signature import SignatureTree, Variant
|
||||
|
||||
|
||||
def open_file():
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
from test.util import check_gi_repository, skip_reason_no_gi
|
||||
|
||||
import pytest
|
||||
from dbus_next import Message, MessageFlag, MessageType
|
||||
from dbus_next.glib import MessageBus
|
||||
|
||||
from dbus_fast import Message, MessageFlag, MessageType
|
||||
from dbus_fast.glib import MessageBus
|
||||
|
||||
has_gi = check_gi_repository()
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import os
|
||||
|
||||
from dbus_next import ArgDirection, PropertyAccess, SignatureType
|
||||
from dbus_next import introspection as intr
|
||||
from dbus_fast import ArgDirection, PropertyAccess, SignatureType
|
||||
from dbus_fast import introspection as intr
|
||||
|
||||
example_data = open(f"{os.path.dirname(__file__)}/data/introspection.xml").read()
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@ import io
|
||||
import json
|
||||
import os
|
||||
|
||||
from dbus_next import Message, SignatureTree, Variant
|
||||
from dbus_next._private.unmarshaller import Unmarshaller
|
||||
from dbus_fast import Message, SignatureTree, Variant
|
||||
from dbus_fast._private.unmarshaller import Unmarshaller
|
||||
|
||||
|
||||
def print_buf(buf):
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
from test.util import check_gi_repository, skip_reason_no_gi
|
||||
|
||||
import pytest
|
||||
from dbus_next import (
|
||||
|
||||
from dbus_fast import (
|
||||
Message,
|
||||
MessageType,
|
||||
NameFlag,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import pytest
|
||||
from dbus_next import SignatureBodyMismatchError, SignatureTree, Variant
|
||||
from dbus_next._private.util import signature_contains_type
|
||||
|
||||
from dbus_fast import SignatureBodyMismatchError, SignatureTree, Variant
|
||||
from dbus_fast._private.util import signature_contains_type
|
||||
|
||||
|
||||
def assert_simple_type(signature, type_):
|
||||
|
||||
@ -2,9 +2,10 @@ import asyncio
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from dbus_next import Message
|
||||
from dbus_next._private.address import parse_address
|
||||
from dbus_next.aio import MessageBus
|
||||
|
||||
from dbus_fast import Message
|
||||
from dbus_fast._private.address import parse_address
|
||||
from dbus_fast.aio import MessageBus
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from dbus_next import (
|
||||
from dbus_fast import (
|
||||
is_bus_name_valid,
|
||||
is_interface_name_valid,
|
||||
is_member_name_valid,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user