%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/jeepney/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/jeepney/__pycache__/bindgen.cpython-312.pyc

�

+�c����dZddlZddlmZddlmcmZddlm	Z	ddl
mZmZddl
mZGd�d�Zd	ZGd
�d�ZdZhd
�Zd�Zdd�Zd�Zedk(re�yy)z5Generate a wrapper class from DBus introspection data�N)�indent)�Introspectable)�open_dbus_connection�Proxy)�__version__c��eZdZd�Zd�Zd�Zy)�Methodc��|jd|_g|_g|_|j	d�D]U}	|jd}|jj|�|jj|jd��Wy#t
$r'dj
t|j��}Y�uwxYw)N�namezarg[@direction='in']zarg{}�type)	�attribr�in_args�	signature�findall�KeyError�format�len�append)�self�xml_node�argrs    �1/usr/lib/python3/dist-packages/jeepney/bindgen.py�__init__zMethod.__init__s����O�O�F�+��	��������#�#�$:�;�	6�C�
9��z�z�&�)��
�L�L����%��N�N�!�!�#�*�*�V�"4�5�
	6���
9��~�~�c�$�,�,�&7�8��
9�s�B
�
-B=�<B=c�:�dj|j��S)Nz=def {name}(self):
    return new_method_call(self, '{name}')
)r)rr)rs r�_make_code_noargszMethod._make_code_noargss%��?�@F�����AG�A�	�c�:�|js|j�Sdj|j�}dj|j�}t	|j�dk(rdndj|�}dj|j|||��S)Nz, ��z({},)z({})zxdef {name}(self, {args}):
    return new_method_call(self, '{name}', '{signature}',
                           {tuple})
)r�argsr�tuple)rr�joinrrrr)rr rr!s    r�	make_codezMethod.make_codes����|�|��)�)�+�+��y�y����&���G�G�D�N�N�+�	�����-��2���F�F�t�L��8�9?�������%�:@�:
�	
rN)�__name__�
__module__�__qualname__rrr#�rrr	r	
s��
6��

rr	z�
class {cls_name}(MessageGenerator):
    interface = {interface!r}

    def __init__(self, object_path={path!r},
                 bus_name={bus_name!r}):
        super().__init__(object_path=object_path, bus_name=bus_name)
c��eZdZd�Zd�Zy)�	Interfacec��|jd|_||_||_|j	d�D�cgc]
}t|���c}|_ycc}w)Nr�method)r
r�path�bus_namerr	�methods)rrr,r-�nodes     rrzInterface.__init__3sD���O�O�F�+��	���	� ��
�19�1A�1A�(�1K�L���t��L����Ls�Ac�D�|jjd�d}tj||j|j|j
��g}|jD]+}|jt|j�d���-dj|�S)N�.���)�cls_name�	interfacer,r-z    �
)r�split�INTERFACE_CLASS_TEMPLATErr,r-r.rrr#r")rr3�chunksr+s    rr#zInterface.make_code9s����9�9�?�?�3�'��+��*�1�1�8��	�	��	�	�D�M�M�2�K�L���l�l�	?�F��M�M�&��!1�!1�!3�W�=�>�	?��y�y�� � rN)r$r%r&rr#r'rrr)r)2s
��M�!rr)z�"""Auto-generated DBus bindings

Generated by jeepney version {version}

Object path: {path}
Bus name   : {bus_name}
"""

from jeepney.wrappers import MessageGenerator, new_method_call

>�org.freedesktop.DBus.Peer�org.freedesktop.DBus.Properties�#org.freedesktop.DBus.Introspectablec���t|ttf�r$t|d�5}t	||||�cddd�Stj|�}|jtjt||���d}|jd�D]G}|jdtvr�|jt|||�j��|dz
}�I|S#1swY��xYw)N�w)�versionr,r-rr4rr)�
isinstance�bytes�str�open�
code_from_xml�ET�
fromstring�write�MODULE_TEMPLATErrrr
�IGNORE_INTERFACESr)r#)�xmlr,r-�fh�f�root�i�interface_nodes        rrCrCUs����"�u�c�l�#�
�"�c�]�	9�a� ��d�H�a�8�	9�	9��=�=���D��H�H�_�
#�
#�K�d�-5�$�7�8�	
�A��,�,�{�3���� � ��(�,=�=��
����>�4��:�D�D�F�G�	�Q���	�
�H�	9�	9�s�C�C#c��t|�}tt||�|�}|j�\}t	||||�}tdj
||��y)Nz#Written {} interface wrappers to {})rrr�
IntrospectrC�printr)r,r�output_file�bus�conn�introspectablerI�n_interfacess        r�generaterWgsW����$�D��>�$��5�t�<�N��$�$�&�D�C�!��d�D�+�>�L�	�
/�
6�
6�|�[�
Q�Rrc��tj�}|jddd��|jddd��|jdd�	�|jd
d�|j�}|jxs"|j
ddj
d
d�dz}t|j
|j||j�y)Nz-nz--nameT)�requiredz-pz--pathz--bus�SESSION)�defaultz-oz--outputr�/�_z.py)
�argparse�ArgumentParser�add_argument�
parse_args�outputr,�replacerWrrS)�apr rbs   r�mainreps���	�	 �	 �	"�B��O�O�D�(�T�O�2��O�O�D�(�T�O�2��O�O�G�Y�O�/��O�O�D�*�%�
�=�=�?�D�
�[�[�
E�T�Y�Y�q�r�]�2�2�3��<�u�D�F��T�Y�Y��	�	�6�4�8�8�4r�__main__)rZ)�__doc__r^�textwrapr�xml.etree.ElementTree�etree�ElementTreerD�jeepney.wrappersr�jeepney.io.blockingrr�jeepneyrr	r7r)rGrHrCrWrer$r'rr�<module>rosl��;���"�"�+�;��
�
�>��
!�
!�����
�$S�
5��z���F�r

Zerion Mini Shell 1.0