Skip to content

Commit

Permalink
Use consistent D-Bus spelling for documentation
Browse files Browse the repository at this point in the history
D-Bus in documentation but code can use either dbus or Dbus.
  • Loading branch information
igo95862 committed Aug 12, 2023
1 parent ae7bda2 commit 5860a6b
Show file tree
Hide file tree
Showing 21 changed files with 186 additions and 186 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Features:
* No Python 2 legacy.
* Based on fast sd-bus from systemd. (also supports elogind)
* Unified client/server interface classes. Write interface once!
* Dbus methods can have keyword and default arguments.
* D-Bus methods can have keyword and default arguments.

See the
[documentation](https://python-sdbus.readthedocs.io/en/latest/index.html)
Expand Down Expand Up @@ -157,7 +157,7 @@ async def startup() -> None:
# Acquire a known name on the bus
# Clients will use that name to address this server
await request_default_bus_name_async('org.example.test')
# Export the object to dbus
# Export the object to D-Bus
export_object.export_to_dbus('/')


Expand Down
56 changes: 28 additions & 28 deletions docs/asyncio_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ Classes
.. py:class:: DbusInterfaceCommonAsync(interface_name)
Dbus async interface class.
Dbus methods and properties should be defined using
D-Bus async interface class.
D-Bus methods and properties should be defined using
:py:func:`dbus_property_async`, :py:func:`dbus_signal_async`,
and :py:func:`dbus_method_async` decorators.

.. note::
Don't forget to call ``super().__init__()`` in derived classes
init calls as it sets up important attributes.

:param str interface_name: Sets the dbus interface
:param str interface_name: Sets the D-Bus interface
name that will be used for all properties, methods
and signals defined in the body of the class.

:param bool serving_enabled: If set to :py:obj:`True`
the interface will not be served on dbus. Mostly used
the interface will not be served on D-Bus. Mostly used
for interfaces that sd-bus already provides such as
``org.freedesktop.DBus.Peer``.

.. py:method:: dbus_ping()
:async:

Pings the remote service using dbus.
Pings the remote service using D-Bus.

Useful to test if connection or remote service is alive.

Expand All @@ -47,7 +47,7 @@ Classes
.. py:method:: dbus_introspect()
:async:

Get dbus introspection XML.
Get D-Bus introspection XML.

It is users responsibility to parse that data.

Expand Down Expand Up @@ -92,50 +92,50 @@ Classes

.. py:method:: _proxify(bus, service_name, object_path)
Begin proxying to a remote dbus object.
Begin proxying to a remote D-Bus object.

:param str service_name:
Remote object dbus connection name.
Remote object D-Bus connection name.
For example, systemd uses ``org.freedesktop.systemd1``

:param str object_path:
Remote object dbus path.
Remote object D-Bus path.
Should be a forward slash separated path.
Starting object is usually ``/``.
Example: ``/org/freedesktop/systemd/unit/dbus_2eservice``

:param SdBus bus:
Optional dbus connection object.
If not passed the default dbus will be used.
Optional D-Bus connection object.
If not passed the default D-Bus will be used.

.. py:classmethod:: new_proxy(bus, service_name, object_path)
Create new proxy object and bypass ``__init__``.

:param str service_name:
Remote object dbus connection name.
Remote object D-Bus connection name.
For example, systemd uses ``org.freedesktop.systemd1``

:param str object_path:
Remote object dbus path.
Remote object D-Bus path.
Should be a forward slash separated path.
Starting object is usually ``/``.
Example: ``/org/freedesktop/systemd/unit/dbus_2eservice``

:param SdBus bus:
Optional dbus connection object.
If not passed the default dbus will be used.
Optional D-Bus connection object.
If not passed the default D-Bus will be used.

.. py:method:: export_to_dbus(object_path, bus)
Object will appear and become callable on dbus.
Object will appear and become callable on D-Bus.

:param str object_path:
Object path that it will be available at.

:param SdBus bus:
Optional dbus connection object.
If not passed the default dbus will be used.
Optional D-Bus connection object.
If not passed the default D-Bus will be used.


.. py:class:: DbusObjectManagerInterfaceAsync(interface_name)
Expand Down Expand Up @@ -218,8 +218,8 @@ Classes
Object to export to D-Bus.

:param SdBus bus:
Optional dbus connection object.
If not passed the default dbus will be used.
Optional D-Bus connection object.
If not passed the default D-Bus will be used.

:raises RuntimeError: ObjectManager was not exported.

Expand Down Expand Up @@ -248,11 +248,11 @@ Decorators

Underlying function must be a coroutine function.

:param str input_signature: dbus input signature.
:param str input_signature: D-Bus input signature.
Defaults to "" meaning method takes no arguments.
Required if you intend to connect to a remote object.

:param str result_signature: dbus result signature.
:param str result_signature: D-Bus result signature.
Defaults to "" meaning method returns empty reply on success.
Required if you intend to serve the object.

Expand Down Expand Up @@ -290,7 +290,7 @@ Decorators
argument names will be used otherwise input arguments
will be nameless

:param str method_name: Force specific dbus method name
:param str method_name: Force specific D-Bus method name
instead of being based on Python function name.

Example: ::
Expand Down Expand Up @@ -318,7 +318,7 @@ Decorators

.. py:decorator:: dbus_property_async(property_signature, [flags, [property_name]])
Declare a dbus property.
Declare a D-Bus property.

The underlying function has to be a regular ``def`` function.

Expand All @@ -331,7 +331,7 @@ Decorators
does not perform heavy IO or computation
as that will block other methods or properties.

:param str property_signature: Property dbus signature.
:param str property_signature: Property D-Bus signature.
Has to be a single type or container.

:param int flags: modifies behavior.
Expand Down Expand Up @@ -407,11 +407,11 @@ Decorators

.. py:decorator:: dbus_signal_async([signal_signature, [signal_args_names, [flags, [signal_name]]]])
Defines a dbus signal.
Defines a D-Bus signal.

Underlying function return type hint is used for signal type hints.

:param str signal_signature: signal dbus signature.
:param str signal_signature: signal D-Bus signature.
Defaults to empty signal.

:param Sequence[str] signal_args_names: sequence of signal argument names.
Expand Down Expand Up @@ -466,7 +466,7 @@ Decorators
the service name of the proxy will be used.

:param str bus:
Optional dbus connection object.
Optional D-Bus connection object.
If not passed when called from proxy the bus connected
to proxy will be used or when called from class default
bus will be used.
Expand Down
16 changes: 8 additions & 8 deletions docs/asyncio_quick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Python-sdbus works by declaring interface classes.

Interface classes for async IO should be derived from :py:class:`DbusInterfaceCommonAsync`.

The class constructor takes ``interface_name`` keyword to determine the dbus interface name for all
dbus elements declared in the class body.
The class constructor takes ``interface_name`` keyword to determine the D-Bus interface name for all
D-Bus elements declared in the class body.

Example: ::

Expand Down Expand Up @@ -77,14 +77,14 @@ Recommended to create proxy classes that a subclass of the interface: ::
self._proxify('org.example.test', '/')


.. note:: Successfully initiating a proxy object does NOT guarantee that the dbus object exists.
.. note:: Successfully initiating a proxy object does NOT guarantee that the D-Bus object exists.

Serving objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:py:meth:`DbusInterfaceCommonAsync.export_to_dbus` method
will export the object to the dbus. After calling it the object
becomes visible on dbus for other processes to call.
will export the object to the D-Bus. After calling it the object
becomes visible on D-Bus for other processes to call.

Example using ExampleInterface from before: ::

Expand Down Expand Up @@ -238,7 +238,7 @@ Example: ::
Signals
^^^^^^^^^^^^^^^^^^^^^^^^^^^

To define a dbus signal wrap a function with :py:func:`dbus_signal_async` decorator.
To define a D-Bus signal wrap a function with :py:func:`dbus_signal_async` decorator.

The function is only used for type hints information. It is recommended
to just put ``raise NotImplementedError`` in to the body of the function.
Expand Down Expand Up @@ -286,7 +286,7 @@ Example::
Subclass Overrides
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you define a subclass which overrides a declared dbus method or property
If you define a subclass which overrides a declared D-Bus method or property
you need to use :py:func:`dbus_method_async_override` and :py:func:`dbus_property_async_override`
decorators. Overridden property can decorate a new setter.

Expand Down Expand Up @@ -318,7 +318,7 @@ Example: ::
Multiple interfaces
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

A dbus object can have multiple interfaces with different methods and properties.
A D-Bus object can have multiple interfaces with different methods and properties.

To implement this define multiple interface classes and do a
multiple inheritance on all interfaces the object has.
Expand Down
14 changes: 7 additions & 7 deletions docs/autodoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Autodoc extensions
==================

Python-sdbus has an extension for Sphinx autodoc that can
document dbus interfaces.
document D-Bus interfaces.

To use it include ``"sdbus.autodoc"`` extension in your
``conf.py`` file.
Expand All @@ -22,16 +22,16 @@ uses it to document the classes.
.. warning:: Autodoc extension is early in development and
has multiple issues. For example, the inheritance ``:inherited-members:``
does not work on the dbus elements.
does not work on the D-Bus elements.

Writing docstrings
-------------------

The dbus methods should be documented same way as the regular function
The D-Bus methods should be documented same way as the regular function
would. See `Sphinx documentation on possible fields \
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists>`_

Example docstring for a dbus method:
Example docstring for a D-Bus method:

.. code-block:: python
Expand All @@ -45,14 +45,14 @@ Example docstring for a dbus method:
"""
raise NotImplementedError
Dbus properties and signals will be annotated with type taken from the
D-Bus properties and signals will be annotated with type taken from the
stub function.

.. code-block:: python
@dbus_property_async('as')
def features(self) -> List[str]:
"""List of dbus daemon features.
"""List of D-Bus daemon features.
Features include:
Expand All @@ -61,7 +61,7 @@ stub function.
header fields.
* 'SELinux' - Messages filtered by SELinux on this bus.
* 'SystemdActivation' - services activated by systemd if their \
.service file specifies a dbus name.
.service file specifies a D-Bus name.
"""
raise NotImplementedError
Expand Down
12 changes: 6 additions & 6 deletions docs/common_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ These calls are shared between async and blocking API.

.. py:currentmodule:: sdbus
Dbus connections calls
D-Bus connections calls
++++++++++++++++++++++++++++++++++

.. py:function:: request_default_bus_name_async(new_name, allow_replacement, replace_existing, queue)
Expand All @@ -14,9 +14,9 @@ Dbus connections calls
Acquire a name on the default bus async.

:param str new_name: the name to acquire.
Must be a valid dbus service name.
Must be a valid D-Bus service name.
:param str new_name: the name to acquire.
Must be a valid dbus service name.
Must be a valid D-Bus service name.
:param bool allow_replacement: If name was acquired allow other peers
to take away the name.
:param bool replace_existing: If current name owner allows, take
Expand All @@ -32,7 +32,7 @@ Dbus connections calls
Acquire a name on the default bus.

:param str new_name: the name to acquire.
Must be a valid dbus service name.
Must be a valid D-Bus service name.
:param bool allow_replacement: If name was acquired allow other peers
to take away the name.
:param bool replace_existing: If current name owner allows, take
Expand Down Expand Up @@ -120,13 +120,13 @@ Helper functions
:return: valid object path
:rtype: str

Example on how systemd encodes unit names on dbus: ::
Example on how systemd encodes unit names on D-Bus: ::

from sdbus import encode_object_path


# System uses /org/freedesktop/systemd1/unit as prefix of all units
# dbus.service is a name of dbus unit but dot . is not a valid object path
# dbus.service is a name of D-Bus unit but dot . is not a valid object path
s = encode_object_path('/org/freedesktop/systemd1/unit', 'dbus.service')
print(s)
# Prints: /org/freedesktop/systemd1/unit/dbus_2eservice
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ There are 3 files:
# Acquire a known name on the bus
# Clients will use that name to address to this server
await request_default_bus_name_async('org.example.test')
# Export the object to dbus
# Export the object to D-Bus
export_object.export_to_dbus('/')


Expand Down

0 comments on commit 5860a6b

Please sign in to comment.