File: //usr/lib/python3.9/site-packages/dasbus/server/__pycache__/interface.cpython-39.pyc
a
װ_�D � @ s� d dl Z d dlZd dl mZ d dlmZ d dlmZ d dlmZ d dl m
Z
mZ d dlm
Z
d dlmZ g d �Zd
ZG dd� de�Zddd�Zdd� Zdd� ZG dd� de�ZdS )� N)� Parameter)�get_type_hints)�
get_dbus_name)�Signal)�DBusSpecificationError�DBusSpecification)�
get_dbus_type)�XMLGenerator)�
dbus_class�dbus_interface�dbus_signal�get_xmlZ__dbus_xml__c @ s6 e Zd ZdZdefdd�Zdd� Zdd� Zd d
� ZdS )r a� DBus signal.
Can be used as:
.. code-block:: python
Signal = dbus_signal()
Or as a method decorator:
.. code-block:: python
@dbus_signal
def Signal(x: Int, y: Double):
pass
Signal is defined by the type hints of a decorated method.
This method is accessible as: signal.definition
If the signal is not defined by a method, it is expected to
have no arguments and signal.definition is equal to None.
Nc C s || _ || _d| _dS )z�Create a signal descriptor.
:param definition: a definition of the emit function
:param factory: a signal factory
N)�
definition�factory�name)�selfr r � r �;/usr/lib/python3.9/site-packages/dasbus/server/interface.py�__init__F s zdbus_signal.__init__c C s. | j durdS d�t| �j�� |�� �| _ dS )aV Set a name of the descriptor
The descriptor has been assigned to the specified name.
Generate a name of a private attribute that will be set
to a signal in the ``__get__`` method.
For example: ``__dbus_signal_my_name``
:param owner: the owning class
:param name: the descriptor name
Nz__{}_{})r �format�type�__name__�lower)r �ownerr r r r �__set_name__P s
�zdbus_signal.__set_name__c C s<