HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/dasbus/server/__pycache__/template.cpython-39.opt-1.pyc
a

װ_��@sHddlmZddlmZddgZGdd�ded�ZGdd�dee�ZdS)	�)�ABCMeta)�PropertiesInterface�BasicInterfaceTemplate�InterfaceTemplatec@s,eZdZdZdd�Zedd��Zdd�ZdS)	ralBasic template for a DBus interface.

    This template uses a software design pattern called proxy.

    This class provides a recommended way how to define DBus interfaces
    and create publishable DBus objects. The class that defines a DBus
    interface should inherit this class and be decorated with @dbus_class
    or @dbus_interface decorator. The implementation of this interface will
    be provided by a separate object called implementation. Therefore the
    methods of this class should call the methods of the implementation,
    the signals should be connected to the signals of the implementation
    and the getters and setters of properties should access the properties
    of the implementation.

    .. code-block:: python

        @dbus_interface("org.myproject.X")
        class InterfaceX(BasicInterfaceTemplate):
            def DoSomething(self) -> Str:
                return self.implementation.do_something()

        class X(object):
            def do_something(self):
                return "Done!"

        x = X()
        i = InterfaceX(x)

        DBus.publish_object("/org/myproject/X", i)

    cCs||_|��dS)znCreate a publishable DBus object.

        :param implementation: an implementation of this interface
        N)�_implementation�connect_signals��self�implementation�r�:/usr/lib/python3.9/site-packages/dasbus/server/template.py�__init__@szBasicInterfaceTemplate.__init__cCs|jS)zYReturn the implementation of this interface.

        :return: an implementation
        )r�r	rrrr
Hsz%BasicInterfaceTemplate.implementationcCsdS)z�Interconnect the signals.

        You should connect the emit methods of the interface
        signals to the signals of the implementation. Every
        time the implementation emits a signal, this interface
        reemits the signal on DBus.
        NrrrrrrPsz&BasicInterfaceTemplate.connect_signalsN)�__name__�
__module__�__qualname__�__doc__r
�propertyr
rrrrrrs
 
)�	metaclassc@s eZdZdZdd�Zdd�ZdS)ra}Template for a DBus interface.

    The interface provides the support for the standard interface
    org.freedesktop.DBus.Properties.

    Usage:

    .. code-block:: python

        def connect_signals(self):
            super().connect_signals()
            self.implementation.module_properties_changed.connect(
                self.flush_changes
            )
            self.watch_property("X", self.implementation.x_changed)

        @property
        def X(self, x) -> Int:
            return self.implementation.x

        @emits_properties_changed
        def SetX(self, x: Int):
            self.implementation.set_x(x)

    cCst�|�t�||�dS�N)rr
rrrrrr
vs
zInterfaceTemplate.__init__cs(�j�����fdd�}|�|�dS)z�Watch a DBus property.

        Report a change when the property is changed.

        :param property_name: a name of a DBus property
        :param signal: a signal that emits when the property is changed
        cs����dSr)Zreport_changed_property)�args�kwargs��
property_namer	rr�callback�sz2InterfaceTemplate.watch_property.<locals>.callbackN)Z_properties_changesZcheck_propertyZconnect)r	r�signalrrrr�watch_propertyzsz InterfaceTemplate.watch_propertyN)rrrrr
rrrrrr[sN)�abcrZdasbus.server.propertyr�__all__rrrrrr�<module>s�<