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: //proc/thread-self/root/lib/python3/dist-packages/LanguageSelector/__pycache__/xkb.cpython-38.pyc
U

ڀR]
�@s~ddlmZddlZGdd�d�ZGdd�d�Zdd�Zd	d
�Zdd�Zed
krzed�D]Z	e
e	�qXe�D]Z	e
e	�qldS)�)�print_functionNc@seZdZdd�Zdd�ZdS)�VariantcCs||_||_||_dS�N��name�desc�raw_desc)�selfrrr�r
�6/usr/lib/python3/dist-packages/LanguageSelector/xkb.py�__init__szVariant.__init__cCsd|j|j|jfS)Nz
%s: %s, %sr�r	r
r
r�__str__szVariant.__str__N��__name__�
__module__�__qualname__rrr
r
r
rrsrc@seZdZdd�Zdd�ZdS)�LayoutcCs(||_||_||_||_||_||_dSr�rrr�
short_desc�raw_short_desc�variants)r	rrrrrrr
r
rrszLayout.__init__cCs*d|j|j|j|j|jdd�|jD�fS)Nz%s: %s, %s; %s, %s;; %scSsg|]}d|�qS)z%sr
)�.0�xr
r
r�
<listcomp>sz"Layout.__str__.<locals>.<listcomp>rr
r
r
rrszLayout.__str__Nrr
r
r
rrsrcCs8t�}t�d�}|��}|�d�D]}|�|j�q"|S)N�/etc/X11/xkb/rules/xorg.xml�;/xkbConfigRegistry/layoutList/layout/configItem/name/text())�list�libxml2�	parseFile�xpathNewContext�	xpathEval�append�content)Zpossibility_list�doc�ctxt�ir
r
r�get_all_layout_possibilitiess
r'cCspt�}|�d�}|D]V}t|�d|��dkrB|�d|�d}nd}t|j||�d�dj�}|�|�q|S)Nz3../../../variantList/variant/configItem/name/text()�../description[@xml:lang='%s']r��../../description[position()=1])rr!�lenrr#r")Zlayout_node�langZvariant_listZ
variant_nodesr&Ztrans�vr
r
r�get_variants&s
r.cCs�t�}t�d�}|��}|�d�}|D]�}|j|kr&t|�d|��dkr^|�d|�d}nd}t|�d|��dkr�|�d|�d}nd}|�t|j||�d�dj||�d�djt	||���q&|S)	Nrrr(rr)z#../shortDescription[@xml:lang='%s']r*z$../../shortDescription[position()=1])
rrrr r!r#r+r"rr.)r,Zlayout_listr$r%Zlayout_nodesr&ZtranslationZshort_transr
r
r�get_layouts6s(



�r/�__main__�fr)Z
__future__rrrrr'r.r/rr&�printr
r
r
r�<module>s