%PDF- %PDF-
| Direktori : /lib/python3/dist-packages/jeepney/__pycache__/ |
| Current File : //lib/python3/dist-packages/jeepney/__pycache__/bindgen.cpython-312.pyc |
�
+�c� � � � d Z ddlZddlmZ ddlmc mZ ddlm Z ddl
mZmZ ddl
mZ G d� d� Zd Z G d
� d� ZdZh d
�Zd� Zdd�Zd� Zedk( r e� yy)z5Generate a wrapper class from DBus introspection data� N)�indent)�Introspectable)�open_dbus_connection�Proxy)�__version__c � � e Zd Zd� Zd� Zd� Zy)�Methodc � � |j d | _ g | _ g | _ |j d� D ]U } |j d }| j j |� | j j |j d � �W y # t
$ r' dj
t | j � � }Y �uw xY w)N�namezarg[@direction='in']zarg{}�type) �attribr �in_args� signature�findall�KeyError�format�len�append)�self�xml_node�argr s �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 )r r )r s r �_make_code_noargszMethod._make_code_noargs s% � �?�@F����� AG� A� � c �: � | j s| j � S dj | 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)r r �joinr r r r )r r r r! s r � make_codezMethod.make_code s� � ��|�|��)�)�+�+��y�y����&���G�G�D�N�N�+� �����-��2���F�F�t�L��8�9?�������%� :@� :
�
r N)�__name__�
__module__�__qualname__r r r# � r r r r
s � �
6��
r r 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 � � e Zd Zd� Zd� Zy)� Interfacec � � |j d | _ || _ || _ |j d� D �cg c]
}t |� �� c}| _ y c c}w )Nr �method)r
r �path�bus_namer r �methods)r r r, r- �nodes r r zInterface.__init__3 sD � ��O�O�F�+�� ��� � ��
�19�1A�1A�(�1K�L���t��L����Ls �Ac �D � | j j d� d }t j || j | j | j
�� g}| j D ]+ }|j t |j � d� � �- dj |� S )N�.���)�cls_name� interfacer, r- z �
)r �split�INTERFACE_CLASS_TEMPLATEr r, r- r. r r r# r"