%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__/errors.cpython-312.pyc

�

��kd$����dZdZdZddlZddlmZddlZddlZddlZ	ejjdkDZGd�dej�ZGd	�d
e�ZGd�de�ZGd
�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�dej�ZGd�de�ZGd�d e�Zd!�Zd"�Zd$d#�Zy)%zException classesz%Sebastian Heinlein <devel@glatzor.de>)
�AptDaemonError�ForeignTransaction�InvalidMetaDataError�InvalidProxyError�RepositoryInvalidError�TransactionAlreadyRunning�TransactionCancelled�TransactionAlreadySimulating�TransactionFailed�TransactionRoleAlreadySet�NotAuthorizedError�convert_dbus_exception�get_native_exception�N)�wraps�c�"�eZdZdZdZdd�Zd�Zy)rzInternal error of the aptdaemonzorg.debian.aptc�h�t|�}tjj||�||_y�N)�_convert_unicode�dbus�
DBusException�__init__�_message)�self�messages  �2/usr/lib/python3/dist-packages/aptdaemon/errors.pyrzAptDaemonError.__init__/s)��"�7�+�����#�#�D�'�2���
�c��trtjj|�S|jjd�S)z�Overwrite the DBusException method, since it calls
        Exception.__str__() internally which doesn't support unicode or
        or non-ascii encodings.�UTF-8)�PY3Krr�get_dbus_messager�encode�rs rr!zAptDaemonError.get_dbus_message4s3����%�%�6�6�t�<�<��=�=�'�'��0�0rN��)�__name__�
__module__�__qualname__�__doc__�_dbus_error_namerr!�rrrr)s��)�'�� �
1rrc��eZdZdZdZy)r�3Error if a transaction has already been configured.z(org.debian.apt.TransactionRoleAlreadySetN�r&r'r(r)r*r+rrrr>���=�A�rrc��eZdZdZdZy)rr-�(org.debian.apt.TransactionAlreadyRunningNr.r+rrrrEr/rrc��eZdZdZdZy)r	zZError if a transaction should be simulated but a simulation is
    already processed.
    z+org.debian.apt.TransactionAlreadySimulatingNr.r+rrr	r	Ls���E�rr	c��eZdZdZdZy)rz;Error if a transaction was initialized by a different user.r1Nr.r+rrrrUs��E�A�rrc�(�eZdZdZdZdd�Zd�Zd�Zy)r
zDInternal error if a transaction could not be processed successfully.z org.debian.apt.TransactionFailedc��|s|jdd�}t|D�cgc]
}t|���c}�}t|�}||_||_||_tj||�d||z���ycc}w)N�%z%%�: )�replace�tupler�code�details�details_argsrr)rr:r;�args�args     rrzTransactionFailed.__init__bsn����o�o�c�4�0�G��t�<��&�s�+�<�=��"�7�+����	���� �������$��$��&G�H��=s�A6c�t�dtjj|j��d|j��S)NzTransaction failed: �
)�	aptdaemon�enums�get_error_string_from_enumr:r;r#s r�__unicode__zTransactionFailed.__unicode__ms)�����:�:�4�9�9�E�����	rc�l�tr|j�S|j�jd�S)Nzutf-8)r rDr"r#s r�__str__zTransactionFailed.__str__rs.����#�#�%�%��#�#�%�,�,�W�5�5rNr$)r&r'r(r)r*rrDrFr+rrr
r
\s��N�9��	I��
6rr
c��eZdZdZdZy)rzInvalid meta data givenzorg.debian.apt.InvalidMetaDataNr.r+rrrrys��!�7�rrc��eZdZdZdZd�Zy)rzInvalid proxy givenzorg.debian.apt.InvalidProxyc�6�tj|d|z�y)NzInvalidProxyError: %s)rr)r�proxys  rrzInvalidProxyError.__init__�s������&=��&E�FrN)r&r'r(r)r*rr+rrrr�s���4��Grrc��eZdZdZdZy)rz.Internal error if a transaction was cancelled.z#org.debian.apt.TransactionCancelledNr.r+rrrr�s��8�<�rrc��eZdZdZdZy)rzThe added repository is invalidz org.debian.apt.RepositoryInvalidNr.r+rrrr�s��)�9�rrc��eZdZy)�PolicyKitErrorN)r&r'r(r+rrrNrN�s��rrNc��eZdZdZd�Zy)rz-org.freedesktop.PolicyKit.Error.NotAuthorizedc�j�tjj||�d|���||_||_y)Nr7)rrr�	action_id�subject)rrRrQs   rrzNotAuthorizedError.__init__�s+�����#�#�D�g�y�*I�J�"�����rN)r&r'r(r*rr+rrrr�s
��F��rrc��eZdZdZy)�AuthorizationFailedz&org.freedesktop.PolicyKit.Error.FailedN)r&r'r(r*r+rrrTrT�s��?�rrTc�l���tj��dd\�}}}t����fd��}|S)z�A decorator which maps a raised DBbus exception to a native one.

    This decorator requires introspection to the decorated function. So it
    cannot be used on any already decorated method.
    N�c�H���	|d��fd�|d<	�|i|��S#t$rNt|�}	�jd�}||��fd�||<t|�}n#tt
f$rYnwxYwY�_wxYw#tjj$r}t|��d}~wwxYw)N�
error_handlerc�&���t|��Sr�r��errrXs �r�<lambda>zIconvert_dbus_exception.<locals>._convert_dbus_exception.<locals>.<lambda>�s���-�$�S�)�3+�rc�&���t|��SrrZr[s �rr]zIconvert_dbus_exception.<locals>._convert_dbus_exception.<locals>.<lambda>�s���=�(��-�,/�r)
�KeyError�list�indexr9�
IndexError�
ValueErrorr�
exceptionsrr)r=�kwargs�_argsra�errorrX�argnames�funcs     @��r�_convert_dbus_exceptionz7convert_dbus_exception.<locals>._convert_dbus_exception�s����	+�"�?�3�M�'+�F�?�#�	.���(��(�(���
	$���J�E�
$� ����7�� %�e��
� /��e���U�|����
�+�
��
��
	$�� ���,�,�	.�&�u�-�-��	.�sI��A4�A1�A�A1�A+�(A1�*A+�+A1�0A1�4B!�B�B!)�inspect�getfullargspecr)ri�varargsre�defaultsrjrhs`    @rr
r
�sC���+2�*@�*@��*F�r��*J�'�H�g�v�x�
�4�[�.��.�*#�"rc��t|tj�s|S|j�}|j	�}|t
jk(rt|jdd��S|tjk(rt|jdd��S|tjk(rt|jdd��Sttttttt t"fD]}||jk(s�||�cS|S)z�Map a DBus exception to a native one. This allows to make use of
    try/except on the client side without having to check for the error name.
    �:�)�
isinstancerr�
get_dbus_namer!r
r*�splitrTrrrrrrrrr)rg�	dbus_name�dbus_msg�	error_clss    rrr�s����e�T�/�/�0����#�#�%�I��%�%�'�H��%�6�6�6� �(�.�.��a�"8�9�9�	�)�:�:�	:�"�H�N�N�3��$:�;�;�	�(�9�9�	9�!�8�>�>�#�q�#9�:�:�$�&?�/�1C�*�,=�*�,B�D�'�	��	�2�2�2��X�&�&�'��Lrc��tr t|t�st||d��}|Stst|t�st||d��}|S)zAlways return an unicode.�ignore)�errors)r rr�str�unicode)�text�encodings  rrr�sD���J�t�S�)��4��(�3���K��*�T�7�3��t�X�h�7���Kr)r)r)�
__author__�__all__rk�	functoolsr�sysr�aptdaemon.enumsrA�version_info�majorr rrrrr	rr
rrrrrNrrTr
rrr+rr�<module>r�s���"5�
�#����
���
������!��1�T�'�'�1�*B��B�B��B�E�>�E�B��B�6��6�:8�>�8�G��G�=�>�=�:�^�:�	�T�'�'�	����@�,�@�
#�B�.r

Zerion Mini Shell 1.0