관리-도구
편집 파일: proxy.cpython-39.pyc
a ����װ_'����������������������@���s����d�dl�mZmZ�d�dlmZ�d�dlmZ�d�dlmZ�d�dl m Z �g�d�Zdd��Zd d ��Z dd��ZG�d d��ded�ZG�dd��de�ZG�dd��de�ZdS�)�����)�ABCMeta�abstractmethod)�Lock)�ClientObjectHandler)� PropertyProxy)�DBusSpecificationError)�AbstractObjectProxy�ObjectProxy�InterfaceProxy�get_object_path�disconnect_proxyc�����������������C���s(���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���� r���c�����������������C���s���t�|��}|jS�)zkGet an object path of the remote DBus object. :param proxy: a DBus proxy :return: a DBus path )r����object_path�r���Zhandlerr���r���r���r���1���s����r���c�����������������C���s���t�|��}|����dS�)zVDisconnect the DBus proxy from the remote object. :param proxy: a DBus proxy N)r���Zdisconnect_membersr���r���r���r���r���;���s����r���c�����������������������s`���e�Zd�ZdZg�d�Zh�e�Zefdd�Zedd���Z dd��Z d d ��Zdd��Z��fd d�Z ���ZS�)r���z'Abstract proxy of a remote DBus object.)r ����_members�_lock�__weakref__c�����������������K���s*���||||fi�|��|�_�t��|�_t��|�_dS�)aK��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_factory: a factory of a DBus client object handler :param handler_arguments: additional arguments for the handler factory N)r ����dictr���r���r���)�self�message_bus�service_namer���Zhandler_factoryZhandler_argumentsr���r���r����__init__Q���s���� ��zAbstractObjectProxy.__init__c�����������������C���s���dS�)z|Get the DBus interface of the member. :param member_name: a member name :return: an interface name Nr����r����member_namer���r���r����_get_interfaced���s����z"AbstractObjectProxy._get_interfacec�����������������G���s*���z|�j�|�W�S��ty���Y�n0�|�j|��S�)a��Find 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����keyr���r���r����_get_memberm���s ����zAbstractObjectProxy._get_memberc�����������������G���s����|�j����z|�j|�W�W��d����S��ty4���Y�n0�z|�jj|��}W�n2�tyx�}�ztt|��d�W�Y�d}~n d}~0�0�||�j|<�|W��d����S�1�s�0����Y��dS�)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)r���r���r%���r ���Z create_memberr����AttributeError�str)r���r'����member�er���r���r���r&�������s����$ z"AbstractObjectProxy._create_memberc�����������������C���s(���|���|��|�|�}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$���r���r����get)r����namer+���r���r���r����__getattr__����s���� zAbstractObjectProxy.__getattr__c��������������������sP���||�j�v�rt���||�S�|��|��|�|�}t|t�r>|�|�S�td� |���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$���r���r����setr)���r���)r���r.����valuer+����� __class__r���r���r2�������s���� �zAbstractObjectProxy.__setattr__)r���� __module__�__qualname__�__doc__� __slots__r0���r���r!���r���r$���r(���r&���r/���r2���� __classcell__r���r���r5���r���r���D���s���� r���)� metaclassc�����������������������s<���e�Zd�ZdZdgZh�ej�e�Z��fdd�Zdd��Z���Z S�)r ���zProxy of a remote DBus object.�_interface_namesc��������������������s���t���j|i�|���d|�_dS�)zRCreate a new proxy. :param handler: a DBus client object handler N)r1���r!���r=���)r����args�kwargsr5���r���r���r!�������s����zObjectProxy.__init__c�����������������C���sZ���|�j�du�r(t|�jjj�}dd��|D��|�_�z|�j�|�W�S��tyF���Y�n0�td�|���dS�)zkGet the DBus interface of the member. The members of standard interfaces have a priority. Nc�����������������S���s���i�|�]}|j�|j�qS�r���)r.����interface_name)�.0�mr���r���r���� <dictcomp>����s����z.ObjectProxy._get_interface.<locals>.<dictcomp>z"DBus object has no attribute '{}'.)r=����reversedr ���Z specification�membersr%���r)���r���)r���r#���rE���r���r���r���r$�������s���� ���zObjectProxy._get_interface� r���r7���r8���r9���r:���r���r0���r!���r$���r;���r���r���r5���r���r �������s ���r ���c�����������������������s<���e�Zd�ZdZdgZh�ej�e�Z��fdd�Zdd��Z���Z S�)r ���z!Proxy of a remote DBus interface.�_interface_namec��������������������s(���t���j|||g|�R�i�|���||�_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)r1���r!���rG���)r���r���r ���r���r@���r>���r?���r5���r���r���r!�������s���� ��zInterfaceProxy.__init__c�����������������C���s���|�j�S�)z%Get the DBus interface of the member.)rG���r"���r���r���r���r$�������s����zInterfaceProxy._get_interfacerF���r���r���r5���r���r �������s ��� r ���N)�abcr���r���� threadingr���Zdasbus.client.handlerr���Zdasbus.client.propertyr���Zdasbus.specificationr����__all__r���r���r���r���r ���r ���r���r���r���r����<module>���s��� x(