%PDF- %PDF-
Mini Shell

Mini Shell

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

�

e�\c���ddlmZmZmZddlmZddlmZ[[[dZdZejde
��[Gd�de�ZGd	�d
e�Z
d d�ZGd�d
e
e�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�Zy)!�)�absolute_import�print_function�unicode_literals�)�gpgme)�utilN�GPG_ERR_c�^�eZdZdZd	d�Zed��Zed��Zed��Zed��Z	d�Z
y)
�GpgErrora>A GPG Error

    This is the base of all errors thrown by this library.

    If the error originated from GPGME, then additional information
    can be found by looking at 'code' for the error code, and 'source'
    for the errors origin.  Suitable constants for comparison are
    defined in this module.  'code_str' and 'source_str' are
    human-readable versions of the former two properties.

    If 'context' is not None, then it contains a human-readable hint
    as to where the error originated from.

    If 'results' is not None, it is a tuple containing results of the
    operation that failed.  The tuples elements are the results of the
    function that raised the error.  Some operations return results
    even though they signal an error.  Of course this information must
    be taken with a grain of salt.  But often, this information is
    useful for diagnostic uses or to give the user feedback.  Since
    the normal control flow is disrupted by the exception, the callee
    can no longer return results, hence we attach them to the
    exception objects.

    Nc�.�||_||_||_y�N)�error�context�results)�selfrrrs    �,/usr/lib/python3/dist-packages/gpg/errors.py�__init__zGpgError.__init__=s����
�������c�Z�|j�ytj|j�Sr
)rr�gpgme_err_code�rs r�codez
GpgError.codeB�$���:�:����#�#�D�J�J�/�/rc�Z�|j�ytj|j�Sr
)rr�gpgme_strerrorrs r�code_strzGpgError.code_strHrrc�Z�|j�ytj|j�Sr
)rr�gpgme_err_sourcers r�sourcezGpgError.sourceNs$���:�:����%�%�d�j�j�1�1rc�Z�|j�ytj|j�Sr
)rr�gpgme_strsourcers r�
source_strzGpgError.source_strTs$���:�:����$�$�T�Z�Z�0�0rc��g}|j�|j|j�|j�6|j|j�|j|j�dj|�S)Nz: )r�appendrr"r�join)r�msgss  r�__str__zGpgError.__str__ZsY�����<�<�#��K�K����%��:�:�!��K�K����(��K�K��
�
�&��y�y���r)NNN)�__name__�
__module__�__qualname__�__doc__r�propertyrrrr"r'�rrrr#sa���2�
�0��0�
�0��0�
�2��2�
�1��1�
rrc�B�eZdZdZed��Zed��Zd�Zd�Z	d�Z
y)�
GPGMEErrorz�Generic error

    This is a generic error that wraps the underlying libraries native
    error type.  It is thrown when the low-level API is invoked and
    returns an error.  This is the error that was used in PyME.

    c�6�|tj��Sr
)r�gpgme_err_code_from_syserror)�clss r�fromSyserrorzGPGMEError.fromSyserrorms���5�5�5�7�8�8rc��|jSr
)rrs r�messagezGPGMEError.messageqs���|�|�rc��t|�Sr
)�strrs r�	getstringzGPGMEError.getstringus���4�y�rc��|jSr
)rrs r�getcodezGPGMEError.getcodexs���y�y�rc��|jSr
)rrs r�	getsourcezGPGMEError.getsource{����{�{�rN)r(r)r*r+�classmethodr3r,r5r8r:r<r-rrr/r/ds>����9��9�������rr/c� �|rt||��yr
)r/)�retval�	extradatas  r�
errorcheckrBs��
����+�+�rc��eZdZdZd�Zd�Zy)�KeyNotFoundz�Raised if a key was not found

    GPGME indicates this condition with EOF, which is not very
    idiomatic.  We raise this error that is both a GPGMEError
    indicating EOF, and a KeyError.

    c�F�||_tj|t�yr
)�keystrr/r�EOF)rrFs  rrzKeyNotFound.__init__�s��������D�#�&rc��|jSr
)rFrs rr'zKeyNotFound.__str__�r=rN)r(r)r*r+rr'r-rrrDrD�s���'�rrDc��eZdZy)�EncryptionErrorN�r(r)r*r-rrrJrJ����rrJc��eZdZd�Zd�Zy)�InvalidRecipientsc�>�tj|fi|��||_yr
)rJr�
recipients)rrP�kwargss   rrzInvalidRecipients.__init__�s��� � ��0��0�$��rc�F�djd�|jD��S)N�, c3�K�|]=}dj|jtj|j�����?y�w�z{}: {}N��format�fprrr�reason)�.0�rs  r�	<genexpr>z,InvalidRecipients.__str__.<locals>.<genexpr>�s6����3��"�������0D�0D�Q�X�X�0N�O�3���AA)r%rPrs rr'zInvalidRecipients.__str__�s$���y�y�3�"&�/�/�3�3�	3rN�r(r)r*rr'r-rrrNrN�s��%�3rrNc��eZdZy)�DecryptionErrorNrKr-rrr`r`�rLrr`c��eZdZd�Zd�Zy)�UnsupportedAlgorithmc�>�tj|fi|��||_yr
)r`r�	algorithm)rrdrQs   rrzUnsupportedAlgorithm.__init__�s��� � ��0��0�"��rc��|jSr
)rdrs rr'zUnsupportedAlgorithm.__str__�s���~�~�rNr^r-rrrbrb�s��#�rrbc��eZdZy)�SigningErrorNrKr-rrrgrg�rLrrgc��eZdZd�Zd�Zy)�InvalidSignersc�>�tj|fi|��||_yr
)rgr�signers)rrkrQs   rrzInvalidSigners.__init__�s�����d�-�f�-���rc�F�djd�|jD��S)NrSc3�K�|]=}dj|jtj|j�����?y�wrUrV�rZ�ss  rr\z)InvalidSigners.__str__.<locals>.<genexpr>�s6����0��"�������0D�0D�Q�X�X�0N�O�0�r])r%rkrs rr'zInvalidSigners.__str__�s$���y�y�0�"&�,�,�0�0�	0rNr^r-rrriri�s���0rric��eZdZd�Zy)�VerificationErrorc�>�tj|fi|��||_yr
)rr�result)rrsrQs   rrzVerificationError.__init__�s�����$�)�&�)���rN)r(r)r*rr-rrrqrq�s��rrqc��eZdZd�Zy)�
BadSignaturesc�Z�djd�|jjD��S)NrSc3�K�|]P}|jtk7r;dj|jt	j
|j�����Ry�wrU)�status�NO_ERRORrWrXrrrns  rr\z(BadSignatures.__str__.<locals>.<genexpr>�sB����2���H�H��0�"�������0D�0D�Q�X�X�0N�O�2�s�AA)r%rs�
signaturesrs rr'zBadSignatures.__str__�s*���y�y�2�"&�+�+�"8�"8�2�2�	2rN)r(r)r*r'r-rrruru�s��2rruc��eZdZd�Zd�Zy)�MissingSignaturesc�@�tj||fi|��||_yr
)rqr�missing)rrsr~rQs    rrzMissingSignatures.__init__�s���"�"�4��:�6�:���rc�F�djd�|jD��S)NrSc3�NK�|]}|jdj���y�w)rN)�subkeysrX)rZ�ks  rr\z,MissingSignatures.__str__.<locals>.<genexpr>�s����@�a����1��)�)�@�s�#%)r%r~rs rr'zMissingSignatures.__str__�s���y�y�@�4�<�<�@�@�@rNr^r-rrr|r|�s
���Arr|r
)�
__future__rrr�rrryrG�process_constants�globals�	Exceptionrr/rB�KeyErrorrDrJrNr`rbrgrirqrur|r-rr�<module>r�s���&I�H����^�%5���
������z�7�9�-��>�y�>�B���6,�
�*�h��(	�h�	�3��3�	�h�	��?��	�8�	�0�\�0����2�%�2�A�)�Ar

Zerion Mini Shell 1.0