%PDF- %PDF-
Mini Shell

Mini Shell

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

�

��kd(���dZdZdZddlZddlZddlZddlZddlZddlZddl	m
Z
ejdk\rdZndZd	�Z
ejd
��ZGd�de�Zd
�Zy)z|Module with little helper functions and classes:

deprecated - decorator to emit a warning if a depreacted function is used
z%Sebastian Heinlein <devel@glatzor.de>)�
deprecated�IsoCodes�N)�ElementTree�3�gettext�ugettextc�B��tj���fd��}|S)z�This is a decorator which can be used to mark functions
    as deprecated. It will result in a warning being emitted
    when the function is used.

    Taken from http://wiki.python.org/moin/PythonDecoratorLibrary
    #GeneratingDeprecationWarnings
    c����tjdd�jizt�jj
�jjdz���|i|��S)Nz)Call to deprecated function %(funcname)s.�funcname�)�category�filename�lineno)�warnings�
warn_explicit�__name__�DeprecationWarning�__code__�co_filename�co_firstlineno)�args�kwargs�funcs  ��1/usr/lib/python3/dist-packages/aptdaemon/utils.py�new_funczdeprecated.<locals>.new_func1s]������7��D�M�M�;�
�(��]�]�.�.��=�=�/�/�!�3�
	
��T�$�V�$�$�)�	functools�wraps)rrs` rrr)s'����_�_�T��	%��	%��Orc#�K�tj�dk7rtj�dk7rd��ytj|�tj�}tj
|g�tj|�	d��tjtj��tjtj��tj
|�y#tjtj��tjtj��tj
|�wxYw�w)Nr)�os�getuid�getgid�setegid�	getgroups�	setgroups�seteuid)�uid�gid�
old_groupss   r�
set_euid_egidr*?s�����
�y�y�{�a��B�I�I�K�1�,�
���J�J�s�O�����J��L�L�#����J�J�s�O�!�
�
�
�
�2�9�9�;��
�
�
�2�9�9�;��
���Z� ��	�
�
�2�9�9�;��
�
�
�2�9�9�;��
���Z� �s �BE�C3�A$E�3A%E�Ec�$�eZdZdZdd�Zd�Zd�Zy)rzPProvides access to the iso-codes language, script and country
    database.
    Nc� �d|z}tj|��}i|_||_t|j	��D]I}|j|�}|s|r|j|�}|s�,|jd�|j|<�Ky)Nz/usr/share/xml/iso-codes/%s.xml)�file�name)r�_dict�norm�list�iter�get)�selfr0�tag�fallback_tagr�et�element�iso_codes        r�__init__zIsoCodes.__init__Xs~��4�t�;��
�
$�
$�(�
3����
���	��B�G�G�I��	;�G��{�{�3�'�H���"�;�;�|�4���'.�{�{�6�':��
�
�8�$�	;rc��	|j|}tj|jd|g��}t|t�|�S#t$rYywxYw)NT)�domain�fallback�	languages)r/�KeyErrorr�translationr0�getattr�_gettext_method)r4�value�localer.�transs     r�get_localised_namezIsoCodes.get_localised_nameds\��	��:�:�e�$�D��#�#�4�9�9�t�/5�h�8��.�w�u�o�.�t�4�4��	�	��	�s�A
�
	A�Ac�@�	|j|S#t$rYywxYw�N)r/r?)r4rCs  r�get_namezIsoCodes.get_namems(��	��:�:�e�$�$���	��	�s��	�rH)r�
__module__�__qualname__�__doc__r:rFrI�rrrrRs���
;�5�rrc��d|vr|jdd�\}}d}n"d|vr|jdd�\}}d}n|}dx}}|||fS)zQReturn the name, the version number and the release of the
    specified package.�=rN�/)�split)�packager.�version�releases    r�split_package_idrUts`���g�~��
�
�c�1�-�
��g���	����
�
�c�1�-�
��g����� � ��'���'�!�!r)rL�
__author__�__all__r �sys�
contextlibrrr�	xml.etreerrSrBr�contextmanagerr*�objectrrUrMrr�<module>r]sr���,5�
�
$��	�
�����!��;�;�#���O� �O��,���!��!�$�v��D"r

Zerion Mini Shell 1.0