Your IP : 18.216.156.226
3
\O � @ sf d dl mZ d dlmZ d dlmZ d dlmZ G dd� d�ZG dd� d�ZG d d
� d
e �Z
dd� ZG d
d� d�ZG dd� de�Z
G dd� d�ZG dd� de�ZG dd� d�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� d�ZG dd � d �ZG d!d"� d"e�ZG d#d$� d$e�ZG d%d&� d&�Ze
eeeeeeeeeeeeeeeeeed'�ZG d(d)� d)�Zd*S )+� )�MappingProxyType)�utils)�errors)�_header_value_parserc @ s^ e Zd Zddd�Zedd� �Zedd� �Zed d
� �Zedd� �Zd
d� Z dd� Z
dd� ZdS )�Address� Nc C sl |d k rV|s|rt d��tj|�\}}|r:tdj||���|jrJ|jd �|j}|j}|| _|| _ || _
d S )Nz=addrspec specified when username and/or domain also specifiedz6Invalid addr_spec; only '{}' could be parsed from '{}'r )� TypeError�parserZ
get_addr_spec�
ValueError�format�all_defects�
local_part�domain�
_display_name� _username�_domain)�self�display_name�usernamer � addr_specZa_s�rest� r �,/usr/lib64/python3.6/email/headerregistry.py�__init__ s
zAddress.__init__c C s | j S )N)r )r r r r r 7 s zAddress.display_namec C s | j S )N)r )r r r r r ; s zAddress.usernamec C s | j S )N)r )r r r r r ? s zAddress.domainc C sT t | j�}t|�t|tj �kr.tj| j�}n| j}| jrH|d | j S |sPdS |S )N�@z<>)�setr �lenr Z
DOT_ATOM_ENDS�quote_stringr )r �namesetZlpr r r r C s
zAddress.addr_specc C s dj | jj| j| j| j�S )Nz1{}(display_name={!r}, username={!r}, domain={!r}))r � __class__�__name__r r r )r r r r �__repr__S s zAddress.__repr__c C s^ t | j�}t|�t|tj �kr.tj| j�}n| j}|rX| jdkrFdn| j}dj||�S | jS )Nz<>r z{} <{}>)r r r r �SPECIALSr r r )r r �dispr r r r �__str__X s
zAddress.__str__c C s8 t |�t | �krdS | j|jko6| j|jko6| j|jkS )NF)�typer r r )r �otherr r r �__eq__c s
zAddress.__eq__)r r r N)r �
__module__�__qualname__r �propertyr r r r r! r$ r'