Your IP : 3.149.29.192
3
e�\c � @ s d dl mZmZmZ ddlmZ ddlmZ [[[dZdZej de
� � [G dd� de�ZG d d
� d
e�Z
d!dd�ZG d
d� de
e�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZdS )"� )�absolute_import�print_function�unicode_literals� )�gpgme)�utilNZGPG_ERR_c @ sR e Zd ZdZddd�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.
Nc C s || _ || _|| _d S )N)�error�context�results)�selfr r
r � r
�/usr/lib64/python3.6/errors.py�__init__= s zGpgError.__init__c C s | j d krd S tj| j �S )N)r r Zgpgme_err_code)r r
r
r �codeB s
z
GpgError.codec C s | j d krd S tj| j �S )N)r r �gpgme_strerror)r r
r
r �code_strH s
zGpgError.code_strc C s | j d krd S tj| j �S )N)r r Zgpgme_err_source)r r
r
r �sourceN s
zGpgError.sourcec C s | j d krd S tj| j �S )N)r r Zgpgme_strsource)r r
r
r �
source_strT s
zGpgError.source_strc C sF g }| j d k r|j| j � | jd k r<|j| j� |j| j� dj|�S )Nz: )r
�appendr r r �join)r Zmsgsr
r
r �__str__Z s
zGpgError.__str__)NNN)�__name__�
__module__�__qualname__�__doc__r �propertyr r r r r r
r
r
r r # s
r c @ s@ e Zd ZdZedd� �Zedd� �Zdd� Zdd � Z d
d� Z
dS )
�
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 C s | t j� �S )N)r Zgpgme_err_code_from_syserror)�clsr
r
r �fromSyserrorm s zGPGMEError.fromSyserrorc C s | j S )N)r
)r r
r
r �messageq s zGPGMEError.messagec C s t | �S )N)�str)r r
r
r � getstringu s zGPGMEError.getstringc C s | j S )N)r )r r
r
r �getcodex s zGPGMEError.getcodec C s | j S )N)r )r r
r
r � getsource{ s zGPGMEError.getsourceN)r r r r �classmethodr r r r"