a eö\cã@sddlmZmZmZddlmZddlmZ[[[dZdZe  de ƒ¡[Gdd„de ƒZ Gd d „d e ƒZ d!d d „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 „ƒZed d „ƒ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ú0/usr/lib64/python3.9/site-packages/gpg/errors.pyÚ__init__=szGpgError.__init__cCs|jdurdSt |j¡Sr )r rZgpgme_err_code©r rrrÚcodeBs z GpgError.codecCs|jdurdSt |j¡Sr )r rÚgpgme_strerrorrrrrÚcode_strHs zGpgError.code_strcCs|jdurdSt |j¡Sr )r rZgpgme_err_sourcerrrrÚsourceNs zGpgError.sourcecCs|jdurdSt |j¡Sr )r rZgpgme_strsourcerrrrÚ source_strTs zGpgError.source_strcCsFg}|jdur| |j¡|jdur<| |j¡| |j¡d |¡S)Nz: )r Úappendr rrÚjoin)r ZmsgsrrrÚ__str__Zs     zGpgError.__str__)NNN) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚpropertyrrrrrrrrrr#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 |t ¡ƒSr )rZgpgme_err_code_from_syserror)ÚclsrrrÚ fromSyserrormszGPGMEError.fromSyserrorcCs|jSr )r rrrrÚmessageqszGPGMEError.messagecCst|ƒSr )ÚstrrrrrÚ getstringuszGPGMEError.getstringcCs|jSr )rrrrrÚgetcodexszGPGMEError.getcodecCs|jSr )rrrrrÚ getsource{szGPGMEError.getsourceN) rrrrÚ classmethodr!rr"r$r%r&rrrrrds  rcCs|rt||ƒ‚dSr )r)ZretvalZ extradatarrrÚ 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||_t |t¡dSr )ÚkeystrrrÚEOF)r r*rrrrszKeyNotFound.__init__cCs|jSr )r*rrrrr‘szKeyNotFound.__str__N)rrrrrrrrrrr)„sr)c@s eZdZdS)ÚEncryptionErrorN©rrrrrrrr,˜sr,c@seZdZdd„Zdd„ZdS)ÚInvalidRecipientscKstj|fi|¤Ž||_dSr )r,rÚ recipients)r r/ÚkwargsrrrrszInvalidRecipients.__init__cCsd dd„|jDƒ¡S)Nú, css$|]}d |jt |j¡¡VqdS©z{}: {}N©ÚformatÚfprrrÚreason)Ú.0ÚrrrrÚ ¢sÿz,InvalidRecipients.__str__..)rr/rrrrr¡s ÿzInvalidRecipients.__str__N©rrrrrrrrrr.œsr.c@s eZdZdS)ÚDecryptionErrorNr-rrrrr;¦sr;c@seZdZdd„Zdd„ZdS)ÚUnsupportedAlgorithmcKstj|fi|¤Ž||_dSr )r;rÚ algorithm)r r=r0rrrr«szUnsupportedAlgorithm.__init__cCs|jSr )r=rrrrr¯szUnsupportedAlgorithm.__str__Nr:rrrrr<ªsr<c@s eZdZdS)Ú SigningErrorNr-rrrrr>³sr>c@seZdZdd„Zdd„ZdS)ÚInvalidSignerscKstj|fi|¤Ž||_dSr )r>rÚsigners)r r@r0rrrr¸szInvalidSigners.__init__cCsd dd„|jDƒ¡S)Nr1css$|]}d |jt |j¡¡VqdSr2r3©r7Úsrrrr9½sÿz)InvalidSigners.__str__..)rr@rrrrr¼s ÿzInvalidSigners.__str__Nr:rrrrr?·sr?c@seZdZdd„ZdS)ÚVerificationErrorcKstj|fi|¤Ž||_dSr )rrÚresult)r rDr0rrrrÂszVerificationError.__init__N)rrrrrrrrrCÁsrCc@seZdZdd„ZdS)Ú BadSignaturescCsd dd„|jjDƒ¡S)Nr1css.|]&}|jtkrd |jt |j¡¡VqdSr2)ÚstatusÚNO_ERRORr4r5rrrArrrr9És þz(BadSignatures.__str__..)rrDZ signaturesrrrrrÈs ÿzBadSignatures.__str__N)rrrrrrrrrEÇsrEc@seZdZdd„Zdd„ZdS)ÚMissingSignaturescKstj||fi|¤Ž||_dSr )rCrÚmissing)r rDrIr0rrrrÏszMissingSignatures.__init__cCsd dd„|jDƒ¡S)Nr1css|]}|jdjVqdS)rN)Zsubkeysr5)r7Úkrrrr9Ôóz,MissingSignatures.__str__..)rrIrrrrrÓszMissingSignatures.__str__Nr:rrrrrHÎsrH)N)Z __future__rrrÚrrrGr+Zprocess_constantsÚglobalsÚ Exceptionrrr(ÚKeyErrorr)r,r.r;r<r>r?rCrErHrrrrÚs(  A