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: //proc/self/root/lib/python3.9/site-packages/dasbus/client/__pycache__/proxy.cpython-39.pyc
a

װ_'�@s�ddlmZmZddlmZddlmZddlmZddl	m
Z
gd�Zdd�Zd	d
�Z
dd�ZGd
d�ded�ZGdd�de�ZGdd�de�ZdS)�)�ABCMeta�abstractmethod)�Lock)�ClientObjectHandler)�
PropertyProxy)�DBusSpecificationError)�AbstractObjectProxy�ObjectProxy�InterfaceProxy�get_object_path�disconnect_proxycCs(t|t�std�t|�j���t|d�S)zoGet an object handler of the DBus proxy.

    :param proxy: a DBus proxy
    :return: a DBus proxy handler
    zInvalid type '{}'.�_handler)�
isinstancer�	TypeError�format�type�__name__�getattr)�proxy�r�7/usr/lib/python3.9/site-packages/dasbus/client/proxy.py�get_object_handler%s
rcCst|�}|jS)zkGet an object path of the remote DBus object.

    :param proxy: a DBus proxy
    :return: a DBus path
    )r�object_path�rZhandlerrrrr1srcCst|�}|��dS)zVDisconnect the DBus proxy from the remote object.

    :param proxy: a DBus proxy
    N)rZdisconnect_membersrrrrr;srcs`eZdZdZgd�Zhe�Zefdd�Zedd��Z	dd�Z
d	d
�Zdd�Z�fd
d�Z
�ZS)rz'Abstract proxy of a remote DBus object.)r
�_members�_lock�__weakref__cKs*||||fi|��|_t�|_t�|_dS)aKCreate a new proxy.

        :param message_bus: a message bus
        :param service_name: a DBus name of the service
        :param object_path: a DBus path the object
        :param handler_factory: a factory of a DBus client object handler
        :param handler_arguments: additional arguments for the handler factory
        N)r
�dictrrr)�self�message_bus�service_namerZhandler_factoryZhandler_argumentsrrr�__init__Qs
��zAbstractObjectProxy.__init__cCsdS)z|Get the DBus interface of the member.

        :param member_name: a member name
        :return: an interface name
        Nr�r�member_namerrr�_get_interfacedsz"AbstractObjectProxy._get_interfacecGs*z|j|WStyYn0|j|�S)aFind a member of the DBus object.

        If the member doesn't exist, we will acquire
        a lock and ask a handler to create it.

        This method is thread-safe.

        :param key: a member key
        :return: a member
        :raise: AttributeError if invalid
        )r�KeyError�_create_member)r�keyrrr�_get_memberms
zAbstractObjectProxy._get_membercGs�|j��z|j|WWd�Sty4Yn0z|jj|�}Wn2tyx}ztt|��d�WYd}~n
d}~00||j|<|Wd�S1s�0YdS)a	Create a member of the DBus object.

        If the member doesn't exist, ask a handler
        to create it.

        This method is thread-safe.

        :param key: a member key
        :return: a member
        :raise: DBusSpecificationError if invalid
        N)rrr%r
Z
create_memberr�AttributeError�str)rr'�member�errrr&�s$
z"AbstractObjectProxy._create_membercCs(|�|�|�|�}t|t�r$|��S|S)z�Get the attribute.

        Called when an attribute lookup has not found
        the attribute in the usual places. Always call
        the DBus handler in this case.
        )r(r$rr�get)r�namer+rrr�__getattr__�s
zAbstractObjectProxy.__getattr__csP||jvrt��||�S|�|�|�|�}t|t�r>|�|�Std�	|���dS)z�Set the attribute.

        Called when an attribute assignment is attempted.
        Call the DBus handler if the name is not a
        name of an instance attribute defined in _locals.
        zCan't set DBus attribute '{}'.N)
�_locals�super�__setattr__r(r$rr�setr)r)rr.�valuer+��	__class__rrr2�s


�zAbstractObjectProxy.__setattr__)r�
__module__�__qualname__�__doc__�	__slots__r0rr!rr$r(r&r/r2�
__classcell__rrr5rrDs�

r)�	metaclasscs<eZdZdZdgZhej�e�Z�fdd�Zdd�Z�Z	S)r	zProxy of a remote DBus object.�_interface_namescst�j|i|��d|_dS)zRCreate a new proxy.

        :param handler: a DBus client object handler
        N)r1r!r=)r�args�kwargsr5rrr!�szObjectProxy.__init__cCsZ|jdur(t|jjj�}dd�|D�|_z|j|WStyFYn0td�|���dS)zkGet the DBus interface of the member.

        The members of standard interfaces have a priority.
        NcSsi|]}|j|j�qSr)r.�interface_name)�.0�mrrr�
<dictcomp>�s�z.ObjectProxy._get_interface.<locals>.<dictcomp>z"DBus object has no attribute '{}'.)r=�reversedr
Z
specification�membersr%r)r)rr#rErrrr$�s
���zObjectProxy._get_interface�
rr7r8r9r:rr0r!r$r;rrr5rr	�s
r	cs<eZdZdZdgZhej�e�Z�fdd�Zdd�Z�Z	S)r
z!Proxy of a remote DBus interface.�_interface_namecs(t�j|||g|�Ri|��||_dS)z�Create a new proxy.

        :param message_bus: a message bus
        :param service_name: a DBus name of the service
        :param object_path: a DBus path the object
        :param handler: a DBus client object handler
        N)r1r!rG)rrr rr@r>r?r5rrr!�s	��zInterfaceProxy.__init__cCs|jS)z%Get the DBus interface of the member.)rGr"rrrr$�szInterfaceProxy._get_interfacerFrrr5rr
�s

r
N)�abcrr�	threadingrZdasbus.client.handlerrZdasbus.client.propertyrZdasbus.specificationr�__all__rrrrr	r
rrrr�<module>s	
	x(