HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/gi/__pycache__/_gtktemplate.cpython-38.pyc
U

��	^��@s~ddlmZmZmZdd�Zdd�Zdd�ZGdd	�d	e�ZGd
d�de�Z	Gdd
�d
e�Z
dd�ZGdd�de�ZdgZ
dS)�)�GLib�GObject�Gioc
Cs�||jkrdS|j|}|�|j�}|j�|�t||�}	t|tjj	@�}
t|tjj
@�}|rntdtjj
��|dk	r�|
r�|j}n|j
}|||	|�n|
r�|j}n|j}|||	�dS)Nz%r not supported)�__gtktemplate_methods__Z
get_object�__gtype_name__�__gtktemplate_handlers__�add�getattr�intrZConnectFlagsZAFTERZSWAPPED�RuntimeErrorZconnect_object_after�connect_objectZ
connect_afterZconnect)
Zbuilder�objZsignal_name�handler_namer�flags�clsZmethod_nameZ
template_instZhandlerZafterZswapped�func�r�1/usr/lib/python3/dist-packages/gi/_gtktemplate.py�connect_funcs*



�rcs
i}i}t�j���D]�\}}t|t�rvt�||j�|j}|dkrH|}||krl||}td|||f��q�|||<qt|t	�r|j}|dkr�|}||kr�||}td|||f��q|||<��
||jd�q|�_|�_
��t���j���fdd��_�j�_dS)Nz>Error while exposing handler %r as %r, already available as %rz<Error while exposing child %r as %r, already available as %rrcst|���S�N)�
init_template��s��base_init_templaterrr�<lambda>_�z#register_template.<locals>.<lambda>)�list�__dict__�items�
isinstance�	CallThing�setattr�_func�_namer�ChildZbind_template_child_full�	_internalr�__gtktemplate_widgets__Zset_connect_funcrrZ__dontuse_ginstance_init__)rZ
bound_methodsZ
bound_widgets�	attr_namer
rZ
old_attr_name�widget_namerrr�register_template6sT
���

����r*cCs�dd�|_|j|k	rtd��t�|_||�|j��D]\}}|�||�|j|<q6|j	��D]\}}||jkr\t
d|��q\dS)NcSsdSrrrrrrrfrzinit_template.<locals>.<lambda>zRInheritance 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)r�	__class__�	TypeError�setrr'rZget_template_childrrr)�selfrrr)r(rrrrres 

�
��rc@seZdZddd�ZdS)r%NcKs(||_|�dd�|_|r$td|��dS)NZinternalFzUnhandled arguments: %r)r$�popr&r,)r.�name�kwargsrrr�__init__}szChild.__init__)N��__name__�
__module__�__qualname__r2rrrrr%{sr%c@seZdZdd�ZdS)r!cCs||_||_dSr)r$r#)r.r0rrrrr2�szCallThing.__init__Nr3rrrrr!�sr!c@seZdZddd�Zdd�ZdS)�CallbackNcCs
||_dSr)r$)r.r0rrrr2�szCallback.__init__cCst|j|�Sr)r!r$)r.rrrr�__call__�szCallback.__call__)N)r4r5r6r2r8rrrrr7�s
r7cCs@zt�|tjj�Wn&tjk
r:t�|tjj�YnXdS)z4Raises GLib.Error in case the resource doesn't existN)rZresources_get_infoZResourceLookupFlagsZNONEr�ErrorZresources_lookup_data)�pathrrr�validate_resource_path�sr;c@sHeZdZdd�Zedd��Zedd��Zedd��ZeZe	Z	d	d
�Z
dS)�TemplatecKspd|_d|_d|_d|kr(|�d�|_n4d|kr>|�d�|_nd|krT|�d�|_ntd��|rltd|��dS)N�string�filename�
resource_pathzHRequires one of the following arguments: string, filename, resource_pathzUnhandled keyword arguments %r)r=r>r?r/r,)r.r1rrrr2�s�zTemplate.__init__cCs
||d�S)N)r>r)rr>rrr�	from_file�szTemplate.from_filecCs
||d�S)N)r=r)rr=rrr�from_string�szTemplate.from_stringcCs
||d�S)N)r?r)rr?rrr�
from_resource�szTemplate.from_resourcecCsddlm}t|t�r"t||j�s*td��d|jkrBtd|j��t	|d�rTtd��|j
dk	r�|j
}t|t�sx|�d�}t
j�|�}|�|�t|�|S|jdk	r�t|j�|�|j�t|�|S|jdk	s�t�tj�|j�}t
j�|��d	�}|�|�t|�|SdS)
Nr)�Gtkz%Can only use @Gtk.Template on WidgetsrzS%r does not have a __gtype_name__. Set it to the name of the class in your templaterzCannot nest template classeszutf-8�)�
gi.repositoryrCr �type�
issubclassZWidgetr,rr4�hasattrr=�bytes�encoderZBytes�newZset_templater*r?r;Zset_template_from_resourcer>�AssertionErrorrZFileZnew_for_pathZ
load_contents)r.rrC�dataZbytes_Zfile_rrrr8�s<
��







zTemplate.__call__N)r4r5r6r2�classmethodr@rArBr7r%r8rrrrr<�s


r<N)rErrrrr*r�objectr%r!r7r;r<�__all__rrrr�<module>s/		H