AlkantarClanX12

Your IP : 18.188.205.95


Current Path : /usr/lib64/python3.6/site-packages/gpg/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/site-packages/gpg/__pycache__/errors.cpython-36.pyc

3

e�\c�@sddlmZmZmZddlmZddlmZ[[[dZdZej	de
��[Gdd�de�ZGd	d
�d
e�Z
d!dd�ZGd
d�de
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZdS)"�)�absolute_import�print_function�unicode_literals�)�gpgme)�utilNZGPG_ERR_c@sReZdZdZddd�Zedd��Zedd��Zed	d
��Zedd��Z	d
d�Z
dS)�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.

    NcCs||_||_||_dS)N)�error�context�results)�selfr	r
r�r
�/usr/lib64/python3.6/errors.py�__init__=szGpgError.__init__cCs|jdkrdStj|j�S)N)r	rZgpgme_err_code)rr
r
r�codeBs
z
GpgError.codecCs|jdkrdStj|j�S)N)r	r�gpgme_strerror)rr
r
r�code_strHs
zGpgError.code_strcCs|jdkrdStj|j�S)N)r	rZgpgme_err_source)rr
r
r�sourceNs
zGpgError.sourcecCs|jdkrdStj|j�S)N)r	rZgpgme_strsource)rr
r
r�
source_strTs
zGpgError.source_strcCsFg}|jdk	r|j|j�|jdk	r<|j|j�|j|j�dj|�S)Nz: )r
�appendr	rr�join)rZmsgsr
r
r�__str__Zs

zGpgError.__str__)NNN)�__name__�
__module__�__qualname__�__doc__r�propertyrrrrrr
r
r
rr#s
rc@s@eZdZdZedd��Zedd��Zdd�Zdd	�Z	d
d�Z
dS)
�
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.

    cCs|tj��S)N)rZgpgme_err_code_from_syserror)�clsr
r
r�fromSyserrormszGPGMEError.fromSyserrorcCs|jS)N)r
)rr
r
r�messageqszGPGMEError.messagecCst|�S)N)�str)rr
r
r�	getstringuszGPGMEError.getstringcCs|jS)N)r)rr
r
r�getcodexszGPGMEError.getcodecCs|jS)N)r)rr
r
r�	getsource{szGPGMEError.getsourceN)rrrr�classmethodrrr r"r#r$r
r
r
rrdsrcCs|rt||��dS)N)r)ZretvalZ	extradatar
r
r�
errorchecksr&c@s eZdZdZdd�Zdd�ZdS)�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.

    cCs||_tj|t�dS)N)�keystrrr�EOF)rr(r
r
rr�szKeyNotFound.__init__cCs|jS)N)r()rr
r
rr�szKeyNotFound.__str__N)rrrrrrr
r
r
rr'�sr'c@seZdZdS)�EncryptionErrorN)rrrr
r
r
rr*�sr*c@seZdZdd�Zdd�ZdS)�InvalidRecipientscKstj|f|�||_dS)N)r*r�
recipients)rr,�kwargsr
r
rr�szInvalidRecipients.__init__cCsdjdd�|jD��S)Nz, css$|]}dj|jtj|j��VqdS)z{}: {}N)�format�fprrr�reason)�.0�rr
r
r�	<genexpr>�sz,InvalidRecipients.__str__.<locals>.<genexpr>)rr,)rr
r
rr�s
zInvalidRecipients.__str__N)rrrrrr
r
r
rr+�sr+c@seZdZdS)�DecryptionErrorN)rrrr
r
r
rr4�sr4c@seZdZdd�Zdd�ZdS)�UnsupportedAlgorithmcKstj|f|�||_dS)N)r4r�	algorithm)rr6r-r
r
rr�szUnsupportedAlgorithm.__init__cCs|jS)N)r6)rr
r
rr�szUnsupportedAlgorithm.__str__N)rrrrrr
r
r
rr5�sr5c@seZdZdS)�SigningErrorN)rrrr
r
r
rr7�sr7c@seZdZdd�Zdd�ZdS)�InvalidSignerscKstj|f|�||_dS)N)r7r�signers)rr9r-r
r
rr�szInvalidSigners.__init__cCsdjdd�|jD��S)Nz, css$|]}dj|jtj|j��VqdS)z{}: {}N)r.r/rrr0)r1�sr
r
rr3�sz)InvalidSigners.__str__.<locals>.<genexpr>)rr9)rr
r
rr�s
zInvalidSigners.__str__N)rrrrrr
r
r
rr8�sr8c@seZdZdd�ZdS)�VerificationErrorcKstj|f|�||_dS)N)rr�result)rr<r-r
r
rr�szVerificationError.__init__N)rrrrr
r
r
rr;�sr;c@seZdZdd�ZdS)�
BadSignaturescCsdjdd�|jjD��S)Nz, css.|]&}|jtkrdj|jtj|j��VqdS)z{}: {}N)Zstatus�NO_ERRORr.r/rr)r1r:r
r
rr3�sz(BadSignatures.__str__.<locals>.<genexpr>)rr<Z
signatures)rr
r
rr�s
zBadSignatures.__str__N)rrrrr
r
r
rr=�sr=c@seZdZdd�Zdd�ZdS)�MissingSignaturescKstj||f|�||_dS)N)r;r�missing)rr<r@r-r
r
rr�szMissingSignatures.__init__cCsdjdd�|jD��S)Nz, css|]}|jdjVqdS)rN)Zsubkeysr/)r1�kr
r
rr3�sz,MissingSignatures.__str__.<locals>.<genexpr>)rr@)rr
r
rr�szMissingSignatures.__str__N)rrrrrr
r
r
rr?�sr?)N)Z
__future__rrr�rrr>r)Zprocess_constants�globals�	Exceptionrrr&�KeyErrorr'r*r+r4r5r7r8r;r=r?r
r
r
r�<module>s(A