%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�u�c�>����dZddlZddlZddlZddlmZmZddlmZddl	m
Z
mZddlZ
Gd�de�ZGd�d	e�ZgZeD]XZej%ej&j)ed
��ej%ej&j)ed���Zej%ej&j+d��gaiZiZiZddgd
�fd�Zd�Zd�Zd�Zd�Zd�Zy)z`
Complete implementation of the XDG Icon Spec
http://standards.freedesktop.org/icon-theme-spec/
�N)�IniFile�is_ascii)�
xdg_data_dirs)�NoThemeError�debugc��eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�	IconThemez&Class to parse and validate IconThemesc�.�tj|�y�N�r�__init__��selfs �//usr/lib/python3/dist-packages/xdg/IconTheme.pyr
zIconTheme.__init__��������c��|jSr)�namers r�__repr__zIconTheme.__repr__s���y�y�rc���tj||ddg�tjj	|�|_tjj
|j
�\}|_y)Nz
Icon Theme�KDE Icon Theme)r�parse�os�path�dirname�dir�splitr)r�file�nils   rrzIconTheme.parsesI���
�
�d�D�<�1A�"B�C��7�7�?�?�4�(����7�7�=�=����2���d�irc��|jSr)rrs r�getDirzIconTheme.getDirs���x�x�rc�(�|jdd��S)N�NameT��locale��getrs r�getNamezIconTheme.getName s���x�x��t�x�,�,rc�(�|jdd��S)N�CommentTr$r&rs r�
getCommentzIconTheme.getComment"s���x�x�	�$�x�/�/rc�(�|jdd��S)N�InheritsT��listr&rs r�getInheritszIconTheme.getInherits$s���x�x�
��x�.�.rc�(�|jdd��S)N�DirectoriesTr.r&rs r�getDirectorieszIconTheme.getDirectories&s���x�x�
�D�x�1�1rc�(�|jdd��S)N�ScaledDirectoriesTr.r&rs r�getScaledDirectorieszIconTheme.getScaledDirectories(s���x�x�+�$�x�7�7rc�(�|jdd��S)N�Hidden�boolean��typer&rs r�	getHiddenzIconTheme.getHidden*s���x�x��y�x�1�1rc�$�|jd�S)N�Exampler&rs r�
getExamplezIconTheme.getExample,s���x�x�	�"�"rc�*�|jdd|��S)N�Size�integer�r;�groupr&�r�	directorys  r�getSizezIconTheme.getSize0s���x�x��Y�i�x�@�@rc�(�|jd|��S)N�Context�rDr&rEs  r�
getContextzIconTheme.getContext2s���x�x�	��x�3�3rc�2�|jd|��}|r|Sy)N�TyperJ�	Thresholdr&�rrF�values   r�getTypezIconTheme.getType4s������y��1����L�rc�^�|jdd|��}|s|dk(r|S|j|�S)N�MaxSizerBrCr�r'rGrOs   r�
getMaxSizezIconTheme.getMaxSize:�3�������)��D���E�Q�J��L��<�<�	�*�*rc�^�|jdd|��}|s|dk(r|S|j|�S)N�MinSizerBrCrrTrOs   r�
getMinSizezIconTheme.getMinSize@rVrc�>�|jdd|��}|s|dk(r|Sy)NrNrBrCr�r&rOs   r�getThresholdzIconTheme.getThresholdFs'������9�I��F���E�Q�J��L�rc�6�|jdd|��}|xsdS)N�ScalerBrC�r&rOs   r�getScalezIconTheme.getScaleMs ������y�	��B���z��rc���|jdk(r|jjd�|jdk(rnF|jdk(r|jjd�n|jjd�	|j|jd|_	|j|jd	|_	|j|jd|_	y#t$r|jjd�Y�kwxYw#t$r|jjd
�Y�swxYw#t$r|jjd�YywxYw)
Nrz%[KDE Icon Theme]-Header is deprecatedz.themez.desktopz$.desktop fileExtension is deprecated�Unknown File extensionr#zKey 'Name' is missingr*zKey 'Comment' is missingr2zKey 'Directories' is missing)
�defaultGroup�warnings�append�
fileExtension�contentr�KeyError�errors�comment�directoriesrs r�checkExtraszIconTheme.checkExtrasRs6����� 0�0��M�M� � �!H�I�����)��
�
�
�:�
-��M�M� � �!G�H��M�M� � �!9�:�	8����T�%6�%6�7��?�D�I�
	;��<�<��(9�(9�:�9�E�D�L�
	?�#�|�|�D�,=�,=�>�}�M�D����	8��K�K���6�7�	8���	;��K�K���9�:�	;���	?��K�K���=�>�	?�s6�!C(�$!D�!D<�($D�D�$D9�8D9�<$E#�"E#c���||jk(r1	|j|d|_	|j|d|_y||j
�vr1	|j|d|_	|j|d|_ytjd	|�rt|�s|jjd
|z�yy#t$r!|jjd|z�Y��wxYw#t$r!|jjd|z�YywxYw#t$r
d|_Y��wxYw#t$r!|jjd|z�YywxYw)Nr#z#Key 'Name' in Group '%s' is missingr*z&Key 'Comment' in Group '%s' is missingrMrNrAz#Key 'Size' in Group '%s' is missing�^\[X-�Invalid Group name: %s)rcrgrrhrirer3r;�re�matchr�rrDs  r�
checkGroupzIconTheme.checkGrouprsX���D�%�%�%�
R� �L�L��/��7��	�
U� �L�L��/�	�:��	��d�)�)�+�
+�
(� �L�L��/��7��	�
R� �L�L��/��7��	��(�(�8�U�+�����K�K���7�%�?�@�1@���
R����"�"�#H�5�#P�Q�
R���
U����"�"�#K�e�#S�T�
U��
�
(�'��	�
(���
R����"�"�#H�5�#P�Q�
R�sF�C�C2�D�,D5�'C/�.C/�2'D�D�D2�1D2�5'E�Ec���||jk(�r tjdtjj
zdz|�rytjdtjj
zdz|�ry|dk(r|j
||d��y|dk(r|j
||d��y|dk(r|j
||d��y|d	k(r|j
||d
��y|dk(r|j
||�ytjd
|�ry|jjd|z�y||j�v�r�|dk(r|j
||d��y|dk(r|j
||�y|dk(r6|j
||�|dvr|jjd|z�yy|dk(rM|j
||d��|jdk7r)|jjd|jz�yy|dk(rM|j
||d��|jdk7r)|jjd|jz�yy|dk(rM|j
||d��|jdk7r)|jjd|jz�yy|dk(r|j
||d��ytjd
|�ry|jjd|z�yy)Nz^Name�$z^Commentr-Tr.r2r5r8r9r:r>�^X-[a-zA-Z0-9-]+�Invalid key: %srArBrIrM)�Fixed�ScalablerNzGKey 'Type' must be one out of 'Fixed','Scalable','Threshold', but is %srSryz"Key 'MaxSize' give, but Type is %srXz"Key 'MinSize' give, but Type is %srNz$Key 'Threshold' give, but Type is %sr^)rcrprq�xdg�Locale�regex�
checkValuerirer3r;�r�keyrPrDs    r�checkKeyzIconTheme.checkKey�s����D�%�%�%��x�x���
�
� 0� 0�0��4�c�:�����*�S�Z�Z�%5�%5�5�c�9�3�?���
�"�����U���6��
�%�����U���6��+�+�����U���6��������U���;��	�!�����U�+����,�c�2�����"�"�#4�s�#:�;�
�d�)�)�+�
+��f�}�����U���;��	�!�����U�+��������U�+�� B�B��K�K�&�&�'p�sx�'x�y�C��	�!�����U���;��9�9�
�*��K�K�&�&�'K�d�i�i�'W�X�+��	�!�����U���;��9�9�
�*��K�K�&�&�'K�d�i�i�'W�X�+���#�����U���;��9�9��+��K�K�&�&�'M�PT�PY�PY�'Y�Z�,��������U���;����,�c�2�����"�"�#4�s�#:�;�5,rN)�__name__�
__module__�__qualname__�__doc__r
rrr!r(r+r0r3r6r<r?rGrKrQrUrYr\r`rlrsr��rrr	r	sq��,���3�
�-�0�/�2�8�2�#�A�4��+�+���
?�@A�./<rr	c�F�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�IconDataz*Class to parse and validate IconData Filesc�.�tj|�yrrrs rr
zIconData.__init__�rrc�2�|j�}|rd|zSy)Nz<IconData: %s>z
<IconData>)�getDisplayName)r�displaynames  rrzIconData.__repr__�s!���)�)�+���#�k�1�1�rc�4�tj||dg�y)Nz	Icon Data)rr)rrs  rrzIconData.parse�s���
�
�d�D�;�-�0rc�(�|jdd��S)zBRetrieve the display name from the icon data, if one is specified.�DisplayNameTr$r&rs rr�zIconData.getDisplayName�s���x�x�
�d�x�3�3rc�*�|jddd��S)zzRetrieve the embedded text rectangle from the icon data as a list of
        numbers (x0, y0, x1, y1), if it is specified.�EmbeddedTextRectanglerBT�r;r/r&rs r�getEmbeddedTextRectanglez!IconData.getEmbeddedTextRectangle�s���x�x�/�i�d�x�K�Krc�*�|jddd��S)z�Retrieve the anchor points for overlays & emblems from the icon data,
        as a list of co-ordinate pairs, if they are specified.�AttachPoints�pointTr�r&rs r�getAttachPointszIconData.getAttachPoints�s���x�x��W�4�x�@�@rc�Z�|jdk7r|jjd�yy)N�.iconrb)rfrdrers rrlzIconData.checkExtras�s(������(��M�M� � �!9�:�)rc���||jk(sQtjd|�rt|�s/|jjd|j
dd�z�yyy)Nrnro�ascii�replace)rcrprqrrire�encoderrs  rrszIconData.checkGroup�sR����*�*�*��H�H�X�u�%�(�5�/��K�K���7�%�,�,�w�PY�:Z�Z�[�+:�+rc�D�tjdtjjzdz|�ry|dk(r|j||dd��y|dk(r|j||dd��ytjd	|�ry|jjd
|z�y)Nz^DisplayNamerur�rBTr�r�r�rvrw)rprqrzr{r|r}rirer~s    rr�zIconData.checkKey�s���
�8�8�N�3�:�:�#3�#3�3�C�7��=��
�+�
+��O�O�C��Y�T�O�B�
�N�
"��O�O�C��W�4�O�@�
�X�X�(�#�
.���K�K���0�3�6�7rN)
r�r�r�r�r
rrr�r�r�rlrsr�r�rrr�r��s5��0�� �1�4�L�A�;�
\�8rr��icons�pixmapsz~/.icons)�png�svg�xpmc�|�|dk(rtjj}|dk(rtjj}tj
j
|�r|Stj
j|�ddd|vr"tj
j|�d}tgk(stdj|k7rtt|��a|||t|�f}	t|\}}tj�|z
tjjk\rt|=n|StD]3}t#||||�}|s�tj�|ft|<|cSt$D]�}|t&vsst)tj�t&|dz
�tjjk\s�Qt&|dtj
j+|�ks�~tj
j-|�s��t	j.|�tj�tj
j+|�ft&|<��t&j1�D]c\}	}
|D]Y}	|dz|z|
dvrItj
j3|	|dz|z�}tj�|gt|<|ccS�[�e|dk7r,t9||d�}tj�|gt|<|Sy#t $rY���wxYw#t4$r}t6r|�Yd}~��d}~wwxYw)a�Get the path to a specified icon.
    
    size :
      Icon size in pixels. Defaults to ``xdg.Config.icon_size``.
    theme :
      Icon theme name. Defaults to ``xdg.Config.icon_theme``. If the icon isn't
      found in the specified theme, it will be looked up in the basic 'hicolor'
      theme.
    extensions :
      List of preferred file extensions.
    
    Example::
    
        >>> getIconPath("inkscape", 32)
        '/usr/share/icons/hicolor/32x32/apps/inkscape.png'
    Nr_rr[�.�hicolor)rz�Config�	icon_size�
icon_themerr�isabs�splitext�themesrr/�__get_themes�tuple�
icon_cache�time�
cache_timerh�
LookupIcon�icondirs�	dir_cache�int�getmtime�isdir�listdir�items�join�UnicodeDecodeErrorr�getIconPath)
�iconname�size�theme�
extensions�tmp�	timestamp�icon�thmerFr�values�	extension�es
             rr�r��s���(�t�|��z�z�#�#����}��
�
�%�%��
�w�w�}�}�X����
�w�w����!�!�$�Q�R�(�J�6��7�7�#�#�H�-�a�0��	�"��&��)�.�.�E�1��l�5�)�*���T�5�%�
�"3�
4�C��$�S�/��	�4�
�I�I�K�)�#��
�
�(=�(=�=��3���K�����(�D�$�
�;���#�y�y�{�D�1�J�s�O��K�	��e�	��Y�&��D�I�I�K�)�I�"6�q�"9�9�:�c�j�j�>S�>S�S��)�$�Q�'�"�'�'�*:�*:�9�*E�E����
�
�i�(�$&�J�J�y�$9�4�9�9�;����HX�HX�Yb�Hc�#d�I�i� �e�!���(����V�#�
	�I�	
��c�>�I�-����:��7�7�<�<��X��^�i�-G�H�D�'+�y�y�{�D�&9�J�s�O��K�;�
	��
�	���8�T�9�5���9�9�;��-�
�3������I�
��
��:&�
���G���	
�s+�,L�AL �	L�L� 	L;�)L6�6L;c��tjj|�rbtjj|�ddz}tjj|�rt	�}|j|�|Syy)z�Retrieve the data from the .icon file corresponding to the given file. If
    there is no .icon file, it returns None.
    
    Example::
    
        getIconData("/usr/share/icons/Tango/scalable/places/folder.svg")
    rr�N)rr�isfiler�r�r)r�	icon_file�datas   r�getIconDatar�Psd��
�w�w�~�~�d���G�G�$�$�T�*�1�-��7�	�
�7�7�>�>�)�$��:�D��J�J�y�!��K�%�rc#��K�tD]�}tjj||d�}tjj	|�rnVtjj||d�}tjj	|�s��nt
rt
|��yt�}|j|�|��|j�D]}t|�D]}|����y�w)zjGenerator yielding IconTheme objects for a specified theme and any themes
    from which it inherits.
    zindex.themez
index.desktopN)r�rrr�r�rrr	rr0r�)�	themenamer�
theme_filer��subtheme�ts      rr�r�_s������
���W�W�\�\�#�y�-�@�
�
�7�7�>�>�*�%���W�W�\�\�#�y�/�B�
�
�7�7�>�>�*�%��
���y�)�)���K�E�	�K�K�
��
�K��%�%�'����h�'�	�A��G�	��s
�BC-�AC-c	�b�|jtvr�gt|j<t|jjtj�tj
jdzz
�t|jjd�t|jjt��ttj�t|jdz
�tj
jk\�r�tj�t|jd<|j�D�]a}tD�]T}tjj||j|�}|t|jdvs_t|jdtjjtjj||j��ks��|dk7s��tjj|�s��|tj |�gt|jd|<tjjtjj||j��t|jd<��W��dt|jdj#�D]T\}}t%|d||�s�|D]9}|dz|z|dvs�tjj||dz|z�ccS�Vd}	d}
t|jdj#�D]X\}}t'|d||�}||	ks�|D]8}|dz|z|dvs�tjj||dz|z�}
|}	�:�Z|
S)Nr_rr[�r�l)r�theme_cacherer�rzr�r��dictr�r3r�rrr�r�r�r�r��DirectoryMatchesSize�DirectorySizeDistance)r�r�r�r��subdirrFrr�r��minimal_size�closest_filename�distances            rr�r�vs����z�z��$�"$��E�J�J���E�J�J��&�&�t�y�y�{�c�j�j�6K�6K�a�6O�'P�Q��E�J�J��&�&�q�)��E�J�J��&�&�t�v�.��4�9�9�;��U�Z�Z�0��3�3�4��
�
�8M�8M�M�%)�Y�Y�[��E�J�J���"��*�*�,�	f�F�%�
f�	��g�g�l�l�9�U�Z�Z��?���{�5�:�:�6�q�9�9��u�z�z�*�1�-����0@�0@������i�X]�Xb�Xb�Ac�0d�d��b�L��G�G�M�M�#�&�7=�r�z�z�#��6O�K��
�
�+�A�.�s�3�13���1A�1A�"�'�'�,�,�y�Y^�Yc�Yc�Bd�1e�K��
�
�+�A�.�
f�	f�#�5�:�:�.�q�1�7�7�9�I���V���q�	�4��7�'�
I�	��c�>�I�-����:��7�7�<�<��X��^�i�-G�H�H�
I�I��L���"�5�:�:�.�q�1�7�7�9�,���V�(����D�%�@���l�"�'�
,�	��c�>�I�-����:�')�w�w�|�|�C��C��)�9S�'T�$�#+�L�
,�,��rc�"�|j|�}|j|�}|j|�}|j|�}|j	|�}|dk(r||k(S|dk(r||cxkxr|kScS|dk(r||z
|cxkxr||zkScSy)Nrx�	ScaleablerN)rQrGr\rYrU�r��iconsizer�rMrArNrXrSs        rr�r��s����=�=�� �D��=�=�� �D��"�"�6�*�I����v�&�G����v�&�G��w���x���	
��	��(�-�g�-�-�-�-�	
��	��i��8�?�t�i�/?�?�?�?�?�
rc�H�|j|�}|j|�}|j|�}|j|�}|j	|�}|dk(rt||z
�S|dk(r||kr||z
S||kDr||z
Sy|dk(r|||z
kr||z
S|||zkDr||z
Syy)NrxryrrN)rQrGr\rYrU�absr�s        rr�r��s����=�=�� �D��=�=�� �D��"�"�6�*�I����v�&�G����v�&�G��w���4�(�?�#�#�	
��	��g���X�%�%�
��
��X�%�%��	
��	��d�Y�&�&��X�%�%�
��y�(�
(��g�%�%��
r) r�rr�rp�xdg.IniFilerr�xdg.BaseDirectoryr�xdg.Exceptionsrr�
xdg.Configrzr	r�r��basedirrerr��
expanduserr�r�r�r�r�r�r�r�r�r�r�rr�<module>r�s����
�	�)�+�.��i<��i<�X38�w�38�n���6�G��O�O�B�G�G�L�L��'�2�3��O�O�B�G�G�L�L��)�4�5�6�	������"�"�:�.�/�
�����	�
�
�!%�t�BW�P�d
��.%�N@�r

Zerion Mini Shell 1.0