Your IP : 3.140.188.174


Current Path : /opt/alt/python33/lib64/python3.3/email/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/email/__pycache__/_header_value_parser.cpython-33.pyo

�
��fѕc@s�dZddlZddlZddlmZddlmZmZddlm	Z
ddlmZddlmZe
d�Zee
d	�BZe
d
�ZeeBZee
d�Zee
d�Zee
d
�Be
d�ZeeBZee
d�BZeeBZee
d�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gd d!�d!e�Z"Gd"d#�d#e�Z#Gd$d%�d%e�Z$Gd&d'�d'e�Z%Gd(d)�d)e%�Z&Gd*d+�d+e�Z'Gd,d-�d-e�Z(Gd.d/�d/e�Z)Gd0d1�d1e�Z*Gd2d3�d3e�Z+Gd4d5�d5e�Z,Gd6d7�d7e�Z-Gd8d9�d9e�Z.Gd:d;�d;e�Z/Gd<d=�d=e�Z0Gd>d?�d?e�Z1Gd@dA�dAe�Z2GdBdC�dCe�Z3GdDdE�dEe�Z4GdFdG�dGe�Z5GdHdI�dIe�Z6GdJdK�dKe�Z7GdLdM�dMe�Z8GdNdO�dOe�Z9GdPdQ�dQe�Z:GdRdS�dSe�Z;GdTdU�dUe;�Z<GdVdW�dWe�Z=GdXdY�dYe�Z>GdZd[�d[e�Z?Gd\d]�d]e�Z@Gd^d_�d_e�ZAGd`da�daeA�ZBGdbdc�dceA�ZCGddde�dee�ZDGdfdg�dge�ZEGdhdi�die�ZFGdjdk�dkeG�ZHGdldm�dmeH�ZIGdndo�doeH�ZJGdpdq�dqeI�ZKeJddr�ZLeJdsdt�ZMeJdudv�ZNejOdwjPdxjQe���jRZSejOdyjPdxjQe�jTdzd{�jTd|d}���jUZVejOd~�jWZXejOdyjPdxjQe�jTdzd{�jTd|d}���jUZYejOdyjPdxjQe�jTdzd{�jTd|d}���jUZZejOdyjPdxjQe�jTdzd{�jTd|d}���jUZ[dd��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��Zvd�d��Zwd�d��Zxd�d��Zyd�d��Zzd�d��Z{d�d��Z|d�d��Z}d�d��Z~d�d��Zd�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�dS(�ulHeader value parser implementing various email-related RFC parsing rules.

The parsing methods defined in this module implement various email related
parsing rules.  Principal among them is RFC 5322, which is the followon
to RFC 2822 and primarily a clarification of the former.  It also implements
RFC 2047 encoded word decoding.

RFC 5322 goes to considerable trouble to maintain backward compatibility with
RFC 822 in the parse phase, while cleaning up the structure on the generation
phase.  This parser supports correct RFC 5322 generation by tagging white space
as folding white space only when folding is allowed in the non-obsolete rule
sets.  Actually, the parser is even more generous when accepting input than RFC
5322 mandates, following the spirit of Postel's Law, which RFC 5322 encourages.
Where possible deviations from the standard are annotated on the 'defects'
attribute of tokens that deviate.

The general structure of the parser follows RFC 5322, and uses its terminology
where there is a direct correspondence.  Where the implementation requires a
somewhat different structure than that used by the formal grammar, new terms
that mimic the closest existing terms are used.  Thus, it really helps to have
a copy of RFC 5322 handy when studying this code.

Input to the parser is a string that has already been unfolded according to
RFC 5322 rules.  According to the RFC this unfolding is the very first step, and
this parser leaves the unfolding step to a higher level message parser, which
will have already detected the line breaks that need unfolding while
determining the beginning and end of each header.

The output of the parser is a TokenList object, which is a list subclass.  A
TokenList is a recursive data structure.  The terminal nodes of the structure
are Terminal objects, which are subclasses of str.  These do not correspond
directly to terminal objects in the formal grammar, but are instead more
practical higher level combinations of true terminals.

All TokenList and Terminal objects have a 'value' attribute, which produces the
semantically meaningful value of that part of the parse subtree.  The value of
all whitespace tokens (no matter how many sub-tokens they may contain) is a
single space, as per the RFC rules.  This includes 'CFWS', which is herein
included in the general class of whitespace tokens.  There is one exception to
the rule that whitespace tokens are collapsed into single spaces in values: in
the value of a 'bare-quoted-string' (a quoted-string with no leading or
trailing whitespace), any whitespace that appeared between the quotation marks
is preserved in the returned value.  Note that in all Terminal strings quoted
pairs are turned into their unquoted values.

All TokenList and Terminal objects also have a string value, which attempts to
be a "canonical" representation of the RFC-compliant form of the substring that
produced the parsed subtree, including minimal use of quoted pair quoting.
Whitespace runs are not collapsed.

Comment tokens also have a 'content' attribute providing the string found
between the parens (including any nested comments) with whitespace preserved.

All TokenList and Terminal objects have a 'defects' attribute which is a
possibly empty list all of the defects found while creating the token.  Defects
may appear on any token in the tree, and a composite list of all defects in the
subtree is available through the 'all_defects' attribute of any node.  (For
Terminal notes x.defects == x.all_defects.)

Each object in a parse tree is called a 'token', and each has a 'token_type'
attribute that gives the name from the RFC 5322 grammar that it represents.
Not all RFC 5322 nodes are produced, and there is one non-RFC 5322 node that
may be produced: 'ptext'.  A 'ptext' is a string of printable ascii characters.
It is returned in place of lists of (ctext/quoted-pair) and
(qtext/quoted-pair).

XXX: provide complete list of token types.
iN(u	hexdigits(u
namedtupleuOrderedDict(u_encoded_words(uerrors(uutilsu 	u(u
()<>@,:;.\"[]u.u."(u/?=u*'%u%cCs*dt|�jdd�jdd�dS(Nu"u\u\\u\"(ustrureplace(uvalue((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuquote_string_suquote_stringcBs_|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zd
dd�Z	d
S(u_FoldedcCsC||_||_d|_d|_d|_g|_g|_dS(NiT(	umaxlenupolicyulastlenuNoneustickyspaceuTrueu	firstlineudoneucurrent(uselfumaxlenupolicy((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__init__hs						u_Folded.__init__cCsC|jj|j�|jj|jj�|jj�d|_dS(Ni(udoneuextenducurrentuappendupolicyulinesepuclearulastlen(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyunewlineqs
u_Folded.newlinecCs|jr|j�ndS(N(ucurrentunewline(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyufinalizews	u_Folded.finalizecCsdj|j�S(Nu(ujoinudone(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__str__{su_Folded.__str__cCs|jj|�dS(N(ucurrentuappend(uselfustoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuappend~su_Folded.appendcCs�|dkrt|�}nt|�}|jdk	r7t|j�}|j|||jkr�|jj|j�|j|7_|jj|�|j|7_d|_d|_	dS|jr|j�}|dk	r�|jt|�7_|t|�7}n|j
|�dS|r�|d|jkr�|j|}d|koM|knr�||}|jj|jd|��|j|d�|_|}n|j�|jj|j�|jj|�|||_d|_d|_	dS|j	s�|j�n|jj|j�|jj|�d|_d|_	dS|j||jkrp|jj|�|j|7_dS||jkr�|j�|jj|�||_dSdS(NiiFT(uNoneustrulenustickyspaceulastlenumaxlenucurrentuappenduFalseu	firstlineuTrueuhas_fwsupop_leading_fwsu_foldunewline(uselfutokenustokenulustickyspace_lenuwsumarginutrim((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuappend_if_fits�sf			


	

			
		
	u_Folded.append_if_fitsN(
u__name__u
__module__u__qualname__u__init__unewlineufinalizeu__str__uappenduNoneuappend_if_fits(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_Foldedfs	u_Foldedcs1|EeZdZd(Z�fdd�Zdd�Z�fdd�Zedd��Z	ed	d
��Z
edd��Zd
d�Zdd�Z
dd�Zedd��Zdd�Zedd��Zdd�Zdd�Zdd�Zdd �Zd!d"d#�Zd!d$d%�Zd!d&d'�Z�S()u	TokenListcs t�j||�g|_dS(N(usuperu__init__udefects(uselfuargsukw(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__init__�suTokenList.__init__cCsdjdd�|D��S(Nucss|]}t|�VqdS(N(ustr(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�su$TokenList.__str__.<locals>.<genexpr>(ujoin(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__str__�suTokenList.__str__csdj|jjt�j��S(Nu{}({})(uformatu	__class__u__name__usuperu__repr__(uself(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__repr__�suTokenList.__repr__cCsdjdd�|D��S(Nucss!|]}|jr|jVqdS(N(uvalue(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�su"TokenList.value.<locals>.<genexpr>(ujoin(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue�suTokenList.valuecCstdd�|D�|j�S(Ncss|]}|jVqdS(N(uall_defects(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�su(TokenList.all_defects.<locals>.<genexpr>(usumudefects(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuall_defects�suTokenList.all_defectsccs�|j}g}x�|D]�}|j�re|ret|�dkrJ|dn	||�V|j�qen|j�}|j|�|r||�V|g}qqW|r�t|�dkr�|dn	||�VndS(Nii(u	__class__ustartswith_fwsulenuclearupop_trailing_wsuappend(uselfuklassuthisutokenuend_ws((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparts�s	
'
uTokenList.partscCs|dj�S(Ni(ustartswith_fws(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyustartswith_fws	suTokenList.startswith_fwscCs.|djdkr |jd�S|dj�S(Niufws(u
token_typeupopupop_leading_fws(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyupop_leading_fwss
uTokenList.pop_leading_fwscCs.|djdkr |jd�S|dj�S(Niucfwsi����i����i����(u
token_typeupopupop_trailing_ws(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyupop_trailing_wss
uTokenList.pop_trailing_wscCs"x|D]}|jrdSqWdS(NTF(uhas_fwsuTrueuFalse(uselfupart((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuhas_fwss
	uTokenList.has_fwscCs|dj�S(Ni(uhas_leading_comment(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuhas_leading_commentsuTokenList.has_leading_commentcCs+g}x|D]}|j|j�q
W|S(N(uextenducomments(uselfucommentsutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyucomments s
uTokenList.commentscCsE|jptd�}t||�}|j|�|j�t|�S(Nu+inf(umax_line_lengthufloatu_Foldedu_foldufinalizeustr(uselfupolicyumaxlenufolded((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyufold's


uTokenList.foldcCs�g}|j�}|r(|j|�n|djdkrJ|jd�nd}|jtjt|�|��|j|�dj|�S(Niufwsui����i����(upop_leading_fwsuappendu
token_typeupopu_ewuencodeustrujoin(uselfucharseturesuwsutrailer((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuas_encoded_word/s(
uTokenList.as_encoded_wordcCs=g}x'|D]}|j|j||��q
Wdj|�S(Nu(uappendu
cte_encodeujoin(uselfucharsetupolicyuresupart((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
cte_encode;s
uTokenList.cte_encodecCs;x4|jD])}t|�}t|�}yt|�jd�Wn^tk
r�tdd�|jD��rtd}nd}|j||j�}t|�}YnX|j	||�r�q
n|j
�}|dk	rt|jd��|_
|j	|�rq
qn|jr|j|�q
n|j|�|j�q
WdS(Nuus-asciicss!|]}t|tj�VqdS(N(u
isinstanceuerrorsuUndecodableBytesDefect(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>Hsu"TokenList._fold.<locals>.<genexpr>uunknown-8bituutf-8i(upartsustrulenuencodeuUnicodeEncodeErroruanyuall_defectsu
cte_encodeupolicyuappend_if_fitsupop_leading_fwsuNoneupopustickyspaceuhas_fwsu_folduappendunewline(uselfufoldedupartutstrutlenucharsetuws((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_foldAs0
			

uTokenList._folducCs#tdj|jdd���dS(Nu
uindentu(uprintujoinu_pp(uselfuindent((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyupprintcsuTokenList.pprintcCsdj|jdd��S(Nu
uindentu(ujoinu_pp(uselfuindent((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuppstrfsuTokenList.ppstrccs�dj||jj|j�VxU|D]M}t|d�sN|dj|�Vq$x |j|d�D]}|VqbWq$W|jr�dj|j�}nd}dj||�VdS(Nu{}{}/{}(u_ppu*    !! invalid element in token list: {!r}u    u Defects: {}uu{}){}(uformatu	__class__u__name__u
token_typeuhasattru_ppudefects(uselfuindentutokenulineuextra((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_ppis	
	
	u
TokenList._ppN(u__name__u
__module__u__qualname__uNoneu
token_typeu__init__u__str__u__repr__upropertyuvalueuall_defectsupartsustartswith_fwsupop_leading_fwsupop_trailing_wsuhas_fwsuhas_leading_commentucommentsufolduas_encoded_wordu
cte_encodeu_foldupprintuppstru_pp(u
__locals__((u	__class__u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	TokenList�s(+"u	TokenListcBs8|EeZdZedd��Zedd��ZdS(uWhiteSpaceTokenListcCsdS(Nu ((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue~suWhiteSpaceTokenList.valuecCsdd�|D�S(NcSs(g|]}|jdkr|j�qS(ucomment(u
token_typeucontent(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
<listcomp>�s	u0WhiteSpaceTokenList.comments.<locals>.<listcomp>((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyucomments�suWhiteSpaceTokenList.commentsN(u__name__u
__module__u__qualname__upropertyuvalueucomments(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuWhiteSpaceTokenList|suWhiteSpaceTokenListcBs2|EeZdZdZdd�Zdd�ZdS(uUnstructuredTokenListuunstructuredcCs)d}x|jD]}t|�}d	}yt|�jd�Wntk
rUtdd�|jD��rtd}nd}|dk	r<tdj	|j
|d�|g��j|�}tdd�|j
d|�D��}t|�}	t
|	�}
||
|jkr<|j
|d�=|j|	�||
|_wq<n|j|�}d
}YnX|j||�r�|rt
|j
�d}qqn|s�|r�|j|�qn|j�}|dk	r�t|�|_|j|�r�qq�n|jr|j|�qn|j|�|j�d}qWdS(Nuus-asciicss!|]}t|tj�VqdS(N(u
isinstanceuerrorsuUndecodableBytesDefect(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�su.UnstructuredTokenList._fold.<locals>.<genexpr>uunknown-8bituutf-8ucss|]}t|�VqdS(N(ulen(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�siFT(uNoneupartsustruFalseuencodeuUnicodeEncodeErroruanyuall_defectsuget_unstructuredujoinucurrentuas_encoded_wordusumulenumaxlenuappendulastlenuTrueuappend_if_fitsu_fold_as_ewupop_leading_fwsustickyspaceuhas_fwsufoldunewline(uselfufoldedulast_ewupartutstruis_ewucharsetuchunku
oldlastlenuschunkulchunkuws((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_fold�sT
	/&

	
		


uUnstructuredTokenList._foldcCs�g}d}x�|D]�}t|�}y|jd�|j|�Wqtk
r�|dkr�|j|j||��t|�}n9tdj||d�|g��}|j|j	��YqXqWdj|�S(Nuus-asciiu(
uNoneustruencodeuappenduUnicodeEncodeErroru
cte_encodeulenuget_unstructuredujoinuas_encoded_word(uselfucharsetupolicyuresulast_ewupartuspartutl((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
cte_encode�s


&u UnstructuredTokenList.cte_encodeN(u__name__u
__module__u__qualname__u
token_typeu_foldu
cte_encode(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuUnstructuredTokenList�s4uUnstructuredTokenListcBs2|EeZdZdZdd�Zdd�ZdS(uPhraseuphrasecCsXd}xK|jD]@}t|�}t|�}d}yt|�jd�Wn�tk
r�tdd�|jD��r�d}nd}|dk	r�|j	�r�|d
j
dkr�|jr�|jd�}nd}xFt
|�D]8\}	}
|
j
d	kr�t|
dd��||	<q�q�Wtdj|j|d�|g��j|�}t|�}t|�}
||
|jkr�|j|d�=|j|�td
d�|jD��|_wq�n|j|�}t|�}d}YnX|j||�rC|r|jrt|j�d}q|js4|j
dkrd}qqn|j|�qWdS(Nuus-asciicss!|]}t|tj�VqdS(N(u
isinstanceuerrorsuUndecodableBytesDefect(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�suPhrase._fold.<locals>.<genexpr>uunknown-8bituutf-8iucfwsuubare-quoted-stringcss|]}t|�VqdS(N(ulen(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>su
quoted-stringFi����i����T(uNoneupartsustrulenuFalseuencodeuUnicodeEncodeErroruanyuall_defectsuhas_leading_commentu
token_typeucommentsupopu	enumerateuUnstructuredTokenListuget_unstructuredujoinucurrentuas_encoded_wordumaxlenuappendusumulastlenuTrueuappend_if_fitsu_fold(uselfufoldedulast_ewupartutstrutlenuhas_ewucharsetu	remainderuiutokenuchunkuschunkulchunk((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_fold�sL
	!/
		uPhrase._foldc
Cs�g}d}d}x�|D]�}t|�}y|jd�|j|�Wn&tk
rqd}|dkr�|js�t|�}n|j|j	||��n�|j
�sm|d	jdkr�|jr�|jd
�}nd}xFt
|�D]8\}	}
|
jdkr�t|
dd��||	<q�q�Wtdj||d�|g��}|j|�g||d�<nYnX|js�|r|jdkrd}qqWdj|�S(Nuus-asciiiucfwsuubare-quoted-stringu
quoted-stringFTi����i����(uNoneuFalseustruencodeuappenduUnicodeEncodeErroruTrueucommentsulenu
cte_encodeuhas_leading_commentu
token_typeupopu	enumerateuUnstructuredTokenListuget_unstructuredujoinuas_encoded_word(uselfucharsetupolicyuresulast_ewuis_ewupartuspartu	remainderuiutokenutl((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
cte_encodes4


	!&$
uPhrase.cte_encodeN(u__name__u
__module__u__qualname__u
token_typeu_foldu
cte_encode(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuPhrase�s>uPhrasecBs|EeZdZdZdS(uWorduwordN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuWord0suWordcBs&|EeZdZdZdd�ZdS(uCFWSListucfwscCs
t|j�S(N(uboolucomments(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuhas_leading_comment9suCFWSList.has_leading_commentN(u__name__u
__module__u__qualname__u
token_typeuhas_leading_comment(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuCFWSList5suCFWSListcBs|EeZdZdZdS(uAtomuatomN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuAtom=suAtomcBs|EeZdZdZdS(uTokenutokenN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuTokenBsuTokencBs>|EeZdZdZdZdZdZedd��Z	dS(uEncodedWorduencoded-wordcCs3|jdk	r|jStjt|�|j�dS(N(ucteuNoneu_ewuencodeustrucharset(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuencodedNsuEncodedWord.encodedN(
u__name__u
__module__u__qualname__u
token_typeuNoneucteucharsetulangupropertyuencoded(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuEncodedWordGs
uEncodedWordcBsP|EeZdZdZedd��Zedd��Zedd��ZdS(	uQuotedStringu
quoted-stringcCs+x$|D]}|jdkr|jSqWdS(Nubare-quoted-string(u
token_typeuvalue(uselfux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyucontentZs
uQuotedString.contentcCsYg}xC|D];}|jdkr8|jt|��q
|j|j�q
Wdj|�S(Nubare-quoted-stringu(u
token_typeuappendustruvalueujoin(uselfuresux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuquoted_value`s
uQuotedString.quoted_valuecCs+x$|D]}|jdkr|jSqWdS(Nubare-quoted-string(u
token_typeuvalue(uselfutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyustripped_valuejs
uQuotedString.stripped_valueN(u__name__u
__module__u__qualname__u
token_typeupropertyucontentuquoted_valueustripped_value(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuQuotedStringVs
uQuotedStringcBs8|EeZdZdZdd�Zedd��ZdS(uBareQuotedStringubare-quoted-stringcCs tdjdd�|D���S(Nucss|]}t|�VqdS(N(ustr(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>vsu+BareQuotedString.__str__.<locals>.<genexpr>(uquote_stringujoin(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__str__usuBareQuotedString.__str__cCsdjdd�|D��S(Nucss|]}t|�VqdS(N(ustr(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>zsu)BareQuotedString.value.<locals>.<genexpr>(ujoin(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvaluexsuBareQuotedString.valueN(u__name__u
__module__u__qualname__u
token_typeu__str__upropertyuvalue(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuBareQuotedStringqsuBareQuotedStringcBsV|EeZdZdZdd�Zdd�Zedd��Zedd	��Zd
S(uCommentucommentcs8djtdg�fdd��D�dggg��S(Nuu(csg|]}�j|��qS((uquote(u.0ux(uself(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
<listcomp>�s	u#Comment.__str__.<locals>.<listcomp>u)(ujoinusum(uself((uselfu?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__str__�s
		uComment.__str__cCsG|jdkrt|�St|�jdd�jdd�jdd�S(Nucommentu\u\\u(u\(u)u\)(u
token_typeustrureplace(uselfuvalue((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuquote�s

u
Comment.quotecCsdjdd�|D��S(Nucss|]}t|�VqdS(N(ustr(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�su"Comment.content.<locals>.<genexpr>(ujoin(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyucontent�suComment.contentcCs
|jgS(N(ucontent(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyucomments�suComment.commentsN(	u__name__u
__module__u__qualname__u
token_typeu__str__uquoteupropertyucontentucomments(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuComment}s
uCommentcBsP|EeZdZdZedd��Zedd��Zedd��ZdS(	uAddressListuaddress-listcCsdd�|D�S(NcSs%g|]}|jdkr|�qS(uaddress(u
token_type(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
<listcomp>�s	u)AddressList.addresses.<locals>.<listcomp>((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	addresses�suAddressList.addressescCstdd�|D�g�S(Ncss'|]}|jdkr|jVqdS(uaddressN(u
token_typeu	mailboxes(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�su(AddressList.mailboxes.<locals>.<genexpr>(usum(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	mailboxes�suAddressList.mailboxescCstdd�|D�g�S(Ncss'|]}|jdkr|jVqdS(uaddressN(u
token_typeu
all_mailboxes(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>�su,AddressList.all_mailboxes.<locals>.<genexpr>(usum(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
all_mailboxes�suAddressList.all_mailboxesN(u__name__u
__module__u__qualname__u
token_typeupropertyu	addressesu	mailboxesu
all_mailboxes(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuAddressList�suAddressListcBsP|EeZdZdZedd��Zedd��Zedd��ZdS(	uAddressuaddresscCs"|djdkr|djSdS(Niugroup(u
token_typeudisplay_name(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudisplay_name�suAddress.display_namecCs@|djdkr|dgS|djdkr5gS|djS(Niumailboxuinvalid-mailbox(u
token_typeu	mailboxes(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	mailboxes�s
uAddress.mailboxescCsG|djdkr|dgS|djdkr<|dgS|djS(Niumailboxuinvalid-mailbox(u
token_typeu
all_mailboxes(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
all_mailboxes�s
uAddress.all_mailboxesN(u__name__u
__module__u__qualname__u
token_typeupropertyudisplay_nameu	mailboxesu
all_mailboxes(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuAddress�suAddresscBs>|EeZdZdZedd��Zedd��ZdS(uMailboxListumailbox-listcCsdd�|D�S(NcSs%g|]}|jdkr|�qS(umailbox(u
token_type(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
<listcomp>�s	u)MailboxList.mailboxes.<locals>.<listcomp>((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	mailboxes�suMailboxList.mailboxescCsdd�|D�S(NcSs%g|]}|jdkr|�qS(umailboxuinvalid-mailbox(umailboxuinvalid-mailbox(u
token_type(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
<listcomp>�s	u-MailboxList.all_mailboxes.<locals>.<listcomp>((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
all_mailboxes�suMailboxList.all_mailboxesN(u__name__u
__module__u__qualname__u
token_typeupropertyu	mailboxesu
all_mailboxes(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuMailboxList�suMailboxListcBs>|EeZdZdZedd��Zedd��ZdS(u	GroupListu
group-listcCs)|s|djdkrgS|djS(Niumailbox-list(u
token_typeu	mailboxes(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	mailboxes�suGroupList.mailboxescCs)|s|djdkrgS|djS(Niumailbox-list(u
token_typeu
all_mailboxes(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
all_mailboxes�suGroupList.all_mailboxesN(u__name__u
__module__u__qualname__u
token_typeupropertyu	mailboxesu
all_mailboxes(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	GroupList�su	GroupListcBsP|EeZdZdZedd��Zedd��Zedd��ZdS(	uGroupugroupcCs"|djdkrgS|djS(Niu
group-list(u
token_typeu	mailboxes(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	mailboxes�suGroup.mailboxescCs"|djdkrgS|djS(Niu
group-list(u
token_typeu
all_mailboxes(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
all_mailboxes�suGroup.all_mailboxescCs|djS(Ni(udisplay_name(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudisplay_name�suGroup.display_nameN(u__name__u
__module__u__qualname__u
token_typeupropertyu	mailboxesu
all_mailboxesudisplay_name(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuGroup�suGroupcBst|EeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS(
uNameAddru	name-addrcCs!t|�dkrdS|djS(Nii(ulenuNoneudisplay_name(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudisplay_name�suNameAddr.display_namecCs|djS(Nii����(u
local_part(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
local_partsuNameAddr.local_partcCs|djS(Nii����(udomain(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudomainsuNameAddr.domaincCs|djS(Nii����(uroute(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuroute	suNameAddr.routecCs|djS(Nii����(u	addr_spec(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	addr_spec
suNameAddr.addr_specN(
u__name__u
__module__u__qualname__u
token_typeupropertyudisplay_nameu
local_partudomainurouteu	addr_spec(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuNameAddr�suNameAddrcBsb|EeZdZdZedd��Zedd��Zedd��Zedd	��Zd
S(u	AngleAddru
angle-addrcCs+x$|D]}|jdkr|jSqWdS(Nu	addr-spec(u
token_typeu
local_part(uselfux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
local_parts
uAngleAddr.local_partcCs+x$|D]}|jdkr|jSqWdS(Nu	addr-spec(u
token_typeudomain(uselfux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudomains
uAngleAddr.domaincCs+x$|D]}|jdkr|jSqWdS(Nu	obs-route(u
token_typeudomains(uselfux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuroute"s
uAngleAddr.routecCs/x(|D]}|jdkr|jSqWdSdS(Nu	addr-specu<>(u
token_typeu	addr_spec(uselfux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	addr_spec(s
uAngleAddr.addr_specN(	u__name__u
__module__u__qualname__u
token_typeupropertyu
local_partudomainurouteu	addr_spec(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	AngleAddrs
u	AngleAddrcBs,|EeZdZdZedd��ZdS(uObsRouteu	obs-routecCsdd�|D�S(NcSs(g|]}|jdkr|j�qS(udomain(u
token_typeudomain(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
<listcomp>7s	u$ObsRoute.domains.<locals>.<listcomp>((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudomains5suObsRoute.domainsN(u__name__u
__module__u__qualname__u
token_typeupropertyudomains(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuObsRoute1suObsRoutecBst|EeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS(
uMailboxumailboxcCs"|djdkr|djSdS(Niu	name-addr(u
token_typeudisplay_name(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudisplay_name>suMailbox.display_namecCs|djS(Ni(u
local_part(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
local_partCsuMailbox.local_partcCs|djS(Ni(udomain(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudomainGsuMailbox.domaincCs"|djdkr|djSdS(Niu	name-addr(u
token_typeuroute(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyurouteKsu
Mailbox.routecCs|djS(Ni(u	addr_spec(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	addr_specPsuMailbox.addr_specN(
u__name__u
__module__u__qualname__u
token_typeupropertyudisplay_nameu
local_partudomainurouteu	addr_spec(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuMailbox:suMailboxcBs>|EeZdZdZedd��ZeZZZZ	dS(uInvalidMailboxuinvalid-mailboxcCsdS(N(uNone(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudisplay_nameYsuInvalidMailbox.display_nameN(
u__name__u
__module__u__qualname__u
token_typeupropertyudisplay_nameu
local_partudomainurouteu	addr_spec(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuInvalidMailboxUsuInvalidMailboxcs2|EeZdZdZe�fdd��Z�S(uDomainudomaincsdjt�jj��S(Nu(ujoinusuperuvalueusplit(uself(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudomaindsu
Domain.domain(u__name__u
__module__u__qualname__u
token_typeupropertyudomain(u
__locals__((u	__class__u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuDomain`suDomaincBs|EeZdZdZdS(uDotAtomudot-atomN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuDotAtomisuDotAtomcBs|EeZdZdZdS(uDotAtomTextu
dot-atom-textN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuDotAtomTextnsuDotAtomTextcBsb|EeZdZdZedd��Zedd��Zedd��Zedd	��Zd
S(uAddrSpecu	addr-speccCs|djS(Ni(u
local_part(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
local_partwsuAddrSpec.local_partcCs!t|�dkrdS|djS(Niii����(ulenuNoneudomain(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudomain{suAddrSpec.domaincCsJt|�dkr|djS|djj�|dj|djj�S(Niiii(ulenuvalueurstripulstrip(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue�suAddrSpec.valuecCsht|j�}t|�t|t�kr=t|j�}n	|j}|jdk	rd|d|jS|S(Nu@(usetu
local_partulenu
DOT_ATOM_ENDSuquote_stringudomainuNone(uselfunamesetulp((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	addr_spec�s	uAddrSpec.addr_specN(	u__name__u
__module__u__qualname__u
token_typeupropertyu
local_partudomainuvalueu	addr_spec(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuAddrSpecss
uAddrSpeccBs|EeZdZdZdS(uObsLocalPartuobs-local-partN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuObsLocalPart�suObsLocalPartcsD|EeZdZdZedd��Ze�fdd��Z�S(uDisplayNameudisplay-namecCs�t|�}|djdkr/|jd�n8|ddjdkrgt|ddd��|d<n|djdkr�|j�n8|ddjdkr�t|ddd��|d	<n|jS(
Niucfwsii����i����i����i����i����i����(u	TokenListu
token_typeupopuvalue(uselfures((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudisplay_name�s!
!uDisplayName.display_namecs�d}|jrd}n)x&|D]}|jdkrd}qqW|r�d}}|djdks{|ddjdkr�d}n|d	jdks�|d
djdkr�d}n|t|j�|St�jSdS(Nu
quoted-stringuiucfwsu iFTi����i����i����(uFalseudefectsuTrueu
token_typeuquote_stringudisplay_nameusuperuvalue(uselfuquoteuxupreupost(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue�s		


*	*	uDisplayName.value(u__name__u
__module__u__qualname__u
token_typeupropertyudisplay_nameuvalue(u
__locals__((u	__class__u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuDisplayName�suDisplayNamecBs>|EeZdZdZedd��Zedd��ZdS(u	LocalPartu
local-partcCs-|djdkr|djS|djSdS(Niu
quoted-string(u
token_typeuquoted_valueuvalue(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue�suLocalPart.valuec
Cstg}t}d}x�|dtgD]�}|jdkrBq'n|r�|jdkr�|djdkr�t|dd��|d<nt|t�}|r�|jdkr�|djdkr�|jt|dd���n
|j|�|d	}|}q'Wt|dd
��}|jS(NiucfwsudotiFi����i����i����i����i����(uDOTuFalseu
token_typeu	TokenListu
isinstanceuappenduvalue(uselfuresulastu
last_is_tlutokuis_tl((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
local_part�s$	 


uLocalPart.local_partN(u__name__u
__module__u__qualname__u
token_typeupropertyuvalueu
local_part(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	LocalPart�su	LocalPartcsD|EeZdZdZe�fdd��Zedd��Z�S(u
DomainLiteraludomain-literalcsdjt�jj��S(Nu(ujoinusuperuvalueusplit(uself(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyudomain�suDomainLiteral.domaincCs+x$|D]}|jdkr|jSqWdS(Nuptext(u
token_typeuvalue(uselfux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuip�s
uDomainLiteral.ip(u__name__u
__module__u__qualname__u
token_typeupropertyudomainuip(u
__locals__((u	__class__u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
DomainLiteral�su
DomainLiteralcBs&|EeZdZdZdZdZdS(uMIMEVersionumime-versionN(u__name__u
__module__u__qualname__u
token_typeuNoneumajoruminor(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuMIMEVersion�suMIMEVersioncBsP|EeZdZdZdZdZdZedd��Z	edd��Z
dS(	u	Parameteru	parameteruus-asciicCs|jr|djSdS(Nii(u	sectionedunumber(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyusection_number�suParameter.section_numbercCs�x�|D]x}|jdkr#|jS|jdkrxJ|D]?}|jdkr9x'|D]}|jdkrU|jSqUWq9q9WqqWdS(Nuvalueu
quoted-stringubare-quoted-stringu(u
token_typeustripped_value(uselfutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparam_values


uParameter.param_valueNF(u__name__u
__module__u__qualname__u
token_typeuFalseu	sectioneduextendeducharsetupropertyusection_numberuparam_value(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	Parameter�su	ParametercBs|EeZdZdZdS(uInvalidParameteruinvalid-parameterN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuInvalidParametersuInvalidParametercBs,|EeZdZdZedd��ZdS(u	Attributeu	attributecCs.x'|D]}|jjd�r|jSqWdS(Nuattrtext(u
token_typeuendswithuvalue(uselfutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyustripped_values
uAttribute.stripped_valueN(u__name__u
__module__u__qualname__u
token_typeupropertyustripped_value(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	Attributesu	AttributecBs |EeZdZdZdZdS(uSectionusectionN(u__name__u
__module__u__qualname__u
token_typeuNoneunumber(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuSection#suSectioncBs,|EeZdZdZedd��ZdS(uValueuvaluecCsF|d}|jdkr&|d}n|jjd�r?|jS|jS(Niucfwsiu
quoted-stringu	attributeuextended-attribute(u
quoted-stringu	attributeuextended-attribute(u
token_typeuendswithustripped_valueuvalue(uselfutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyustripped_value-s

		uValue.stripped_valueN(u__name__u
__module__u__qualname__u
token_typeupropertyustripped_value(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuValue)suValuecBs8|EeZdZdZedd��Zdd�ZdS(uMimeParametersumime-parametersccst�}x�|D]}}|jjd�s.qn|djdkrGqn|djj�}||krsg||<n||j|j|f�qWxl|j�D]^\}}t|�}g}|ddj	}xt
|�D]\}\}}	||kr|	jjtj
d��n|	j}
|	jr�ytjj|
�}
Wn*tk
rhtjj|
dd�}
Yq�Xy|
j|d�}
Wn$tk
r�|
jd	d�}
YnXtj|
�r�|	jjtj��q�n|j|
�q�Wd
j|�}
||
fVq�WdS(Nu	parameteriu	attributeiu*inconsistent multipart parameter numberinguencodingulatin-1usurrogateescapeuus-asciiu(uOrderedDictu
token_typeuendswithuvalueustripuappendusection_numberuitemsusorteducharsetu	enumerateudefectsuerrorsuInvalidHeaderDefectuparam_valueuextendeduurllibuparseuunquote_to_bytesuUnicodeEncodeErroruunquoteudecodeuLookupErroruutilsu_has_surrogatesuUndecodableBytesDefectujoin(uselfuparamsutokenunameupartsuvalue_partsucharsetuiusection_numberuparamuvalue((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparams<sB	


		

uMimeParameters.paramscCsvg}xL|jD]A\}}|rD|jdj|t|���q|j|�qWdj|�}|rrd|SdS(Nu{}={}u; u u(uparamsuappenduformatuquote_stringujoin(uselfuparamsunameuvalue((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__str__os"uMimeParameters.__str__N(u__name__u
__module__u__qualname__u
token_typeupropertyuparamsu__str__(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuMimeParameters8s3uMimeParameterscBs8|EeZdZedd��Zedd��ZdS(uParameterizedHeaderValuecCs1x*t|�D]}|jdkr
|jSq
WiS(Numime-parameters(ureversedu
token_typeuparams(uselfutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparams|suParameterizedHeaderValue.paramscCsB|r5|djdkr5t|dd�|d�St|�jS(Niumime-parametersi����i����i����(u
token_typeu	TokenListuparts(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparts�suParameterizedHeaderValue.partsN(u__name__u
__module__u__qualname__upropertyuparamsuparts(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuParameterizedHeaderValuezsuParameterizedHeaderValuecBs&|EeZdZdZdZdZdS(uContentTypeucontent-typeutextuplainN(u__name__u
__module__u__qualname__u
token_typeumaintypeusubtype(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuContentType�suContentTypecBs |EeZdZdZdZdS(uContentDispositionucontent-dispositionN(u__name__u
__module__u__qualname__u
token_typeuNoneucontent_disposition(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuContentDisposition�suContentDispositioncBs |EeZdZdZdZdS(uContentTransferEncodingucontent-transfer-encodingu7bitN(u__name__u
__module__u__qualname__u
token_typeucte(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuContentTransferEncoding�suContentTransferEncodingcBs|EeZdZdZdS(uHeaderLabeluheader-labelN(u__name__u
__module__u__qualname__u
token_type(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuHeaderLabel�suHeaderLabelcBs&|EeZdZdZdd�ZdS(uHeaderuheadercCs�|jt|jd���t|jd�|_|djdkrZt|jd��nd|_|jd�}|r�td��n|j	|�dS(NiucfwsuuMalformed Header token list(
uappendustrupopulenucurrentulastlenu
token_typeustickyspaceu
ValueErroru_fold(uselfufoldedurest((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_fold�s1uHeader._foldN(u__name__u
__module__u__qualname__u
token_typeu_fold(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuHeader�suHeadercs�|EeZdZ�fdd�Z�fdd�Zedd��Zd�fdd	�Zd
d�Zdd
�Z	dd�Z
edd��Zdd�Zdd�Z
�S(uTerminalcs+t�j||�}||_g|_|S(N(usuperu__new__u
token_typeudefects(uclsuvalueu
token_typeuself(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__new__�s		uTerminal.__new__csdj|jjt�j��S(Nu{}({})(uformatu	__class__u__name__usuperu__repr__(uself(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__repr__�suTerminal.__repr__cCs
t|j�S(N(ulistudefects(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuall_defects�suTerminal.all_defectsucsIdj||jj|jt�j�|js3dndj|j��gS(Nu
{}{}/{}({}){}uu {}(uformatu	__class__u__name__u
token_typeusuperu__repr__udefects(uselfuindent(u	__class__(u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_pp�s	uTerminal._ppcCsJt|�}y|jd�|SWn"tk
rEtj||�SYnXdS(Nuus-ascii(ustruencodeuUnicodeEncodeErroru_ew(uselfucharsetupolicyuvalue((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
cte_encode�s

uTerminal.cte_encodecCsdS(N(uNone(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyupop_trailing_ws�suTerminal.pop_trailing_wscCsdS(N(uNone(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyupop_leading_fws�suTerminal.pop_leading_fwscCsgS(N((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyucomments�suTerminal.commentscCsdS(NF(uFalse(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuhas_leading_comment�suTerminal.has_leading_commentcCst|�|jfS(N(ustru
token_type(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__getnewargs__�suTerminal.__getnewargs__(u__name__u
__module__u__qualname__u__new__u__repr__upropertyuall_defectsu_ppu
cte_encodeupop_trailing_wsupop_leading_fwsucommentsuhas_leading_commentu__getnewargs__(u
__locals__((u	__class__u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuTerminal�s	uTerminalcBs8|EeZdZedd��Zdd�ZdZdS(uWhiteSpaceTerminalcCsdS(Nu ((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue�suWhiteSpaceTerminal.valuecCsdS(NT(uTrue(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyustartswith_fws�su!WhiteSpaceTerminal.startswith_fwsNT(u__name__u
__module__u__qualname__upropertyuvalueustartswith_fwsuTrueuhas_fws(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuWhiteSpaceTerminal�suWhiteSpaceTerminalcBsD|EeZdZedd��Zdd�ZdZdd�ZdS(	u
ValueTerminalcCs|S(N((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue�suValueTerminal.valuecCsdS(NF(uFalse(uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyustartswith_fwssuValueTerminal.startswith_fwscCstjt|�|�S(N(u_ewuencodeustr(uselfucharset((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuas_encoded_wordsuValueTerminal.as_encoded_wordNF(	u__name__u
__module__u__qualname__upropertyuvalueustartswith_fwsuFalseuhas_fwsuas_encoded_word(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
ValueTerminal�su
ValueTerminalcBsJ|EeZdZedd��Zedd��Zdd�ZdZdS(	uEWWhiteSpaceTerminalcCsdS(Nu((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuvalue
suEWWhiteSpaceTerminal.valuecCs|dd�S(N((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuencodedsuEWWhiteSpaceTerminal.encodedcCsdS(Nu((uself((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu__str__suEWWhiteSpaceTerminal.__str__NT(	u__name__u
__module__u__qualname__upropertyuvalueuencodedu__str__uTrueuhas_fws(u
__locals__((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuEWWhiteSpaceTerminalsuEWWhiteSpaceTerminaludotu,ulist-separatoru@uroute-component-markeru([{}]+)uu[^{}]+u\u\\u]u\]u[\x00-\x20\x7F]cCs]t|�}|r.|jjtj|��ntj|�rY|jjtjd��ndS(u@If input token contains ASCII non-printables, register a defect.u*Non-ASCII characters found in header tokenN(u_non_printable_finderudefectsuappenduerrorsuNonPrintableDefectuutilsu_has_surrogatesuUndecodableBytesDefect(uxtextunon_printables((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_validate_xtextEsu_validate_xtextcCs�t|d�^}}g}d}d}x�tt|��D]k}||dkrq|red}d}qqd}q:n|r�d}n|||kr�Pn|j||�q:W|d}dj|�dj||d�g|�|fS(ukScan printables/quoted-pairs until endchars and return unquoted ptext.

    This function turns a run of qcontent, ccontent-without-comments, or
    dtext-with-quoted-printables into a single string by unquoting any
    quoted printables.  It returns the string, the remaining value, and
    a flag that is True iff there were any quoted printables decoded.

    iu\uNFT(u
_wsp_splitteruFalseurangeulenuTrueuappendujoin(uvalueuendcharsufragmentu	remainderuvcharsuescapeuhad_qpupos((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_get_ptext_to_endcharsOs$			
u_get_ptext_to_endcharscCs?|j�}t|dt|�t|��d�}||fS(u�FWS = 1*WSP

    This isn't the RFC definition.  We're using fws to represent tokens where
    folding can be done, but when we are parsing the *un*folding has already
    been done so we don't need to watch out for CRLF.

    Nufws(ulstripuWhiteSpaceTerminalulen(uvalueunewvalueufws((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_fwsms)uget_fwsc

CsKt�}|jd�s3tjdj|���n|dd�jdd�^}}||dd�kr�tjdj|���ndj|�}t|�dkr�|dtkr�|dtkr�|jdd�^}}|d|}nt|j��dkr$|j	j
tjd	��n||_dj|�}y't
jd|d�\}}}}	Wn-tk
r�tjd
j|j���YnX||_||_|j	j|	�x�|r@|dtkr�t|�\}
}|j
|
�q�nt|d�^}}t|d�}t|�|j
|�dj|�}q�W||fS(uE encoded-word = "=?" charset "?" encoding "?" encoded-text "?="

    u=?u"expected encoded word but found {}iNu?=iuiuwhitespace inside encoded wordu!encoded word format invalid: '{}'uvtext(uEncodedWordu
startswithuerrorsuHeaderParseErroruformatusplitujoinulenu	hexdigitsudefectsuappenduInvalidHeaderDefectucteu_ewudecodeu
ValueErrorucharsetulanguextenduWSPuget_fwsu
_wsp_splitteru
ValueTerminalu_validate_xtext(
uvalueuewutoku	remainderuremstrurestutextucharsetulangudefectsutokenucharsuvtext((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_encoded_wordysH	"2
	'
			


uget_encoded_wordcCs�t�}xq|r||dtkrGt|�\}}|j|�qn|jd�r/yt|�\}}Wntjk
r�Yq/Xd
}t	|�dkr�|dj
dkr�|jjtjd��d}q�n|rt	|�dkr|d
j
dkrt|dd�|d<qn|j|�qnt|d�^}}t|d�}t|�|j|�d	j|�}qW|S(uOunstructured = (*([FWS] vchar) *WSP) / obs-unstruct
       obs-unstruct = *((*LF *CR *(obs-utext) *LF *CR)) / FWS)
       obs-utext = %d0 / obs-NO-WS-CTL / LF / CR

       obs-NO-WS-CTL is control characters except WSP/CR/LF.

    So, basically, we have printable runs, plus control characters or nulls in
    the obsolete syntax, separated by whitespace.  Since RFC 2047 uses the
    obsolete syntax in its specification, but requires whitespace on either
    side of the encoded words, I can see no reason to need to separate the
    non-printable-non-whitespace from the printable runs if they occur, so we
    parse this into xtext tokens separated by WSP tokens.

    Because an 'unstructured' value must by definition constitute the entire
    value, this 'get' routine does not return a remaining value, only the
    parsed TokenList.

    iu=?iufwsu&missing whitespace before encoded wordiuencoded-worduvtextuTi����Fi����i����i����(uUnstructuredTokenListuWSPuget_fwsuappendu
startswithuget_encoded_worduerrorsuHeaderParseErroruTrueulenu
token_typeudefectsuInvalidHeaderDefectuFalseuEWWhiteSpaceTerminalu
_wsp_splitteru
ValueTerminalu_validate_xtextujoin(uvalueuunstructuredutokenuhave_wsutoku	remainderuvtext((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_unstructured�s:		




uget_unstructuredcCs;t|d�\}}}t|d�}t|�||fS(uctext = <printable ascii except \ ( )>

    This is not the RFC ctext, since we are handling nested comments in comment
    and unquoting quoted-pairs here.  We allow anything except the '()'
    characters, but if we find any ASCII other than the RFC defined printable
    ASCII an NonPrintableDefect is added to the token's defects list.  Since
    quoted pairs are converted to their unquoted values, what is returned is
    a 'ptext' token.  In this case it is a WhiteSpaceTerminal, so it's value
    is ' '.

    u()uptext(u_get_ptext_to_endcharsuWhiteSpaceTerminalu_validate_xtext(uvalueuptextu_((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_qp_ctext�s
uget_qp_ctextcCs;t|d�\}}}t|d�}t|�||fS(uoqcontent = qtext / quoted-pair

    We allow anything except the DQUOTE character, but if we find any ASCII
    other than the RFC defined printable ASCII an NonPrintableDefect is
    added to the token's defects list.  Any quoted pairs are converted to their
    unquoted values, so what is returned is a 'ptext' token.  In this case it
    is a ValueTerminal.

    u"uptext(u_get_ptext_to_endcharsu
ValueTerminalu_validate_xtext(uvalueuptextu_((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_qcontent�s

uget_qcontentcCsrt|�}|s-tjdj|���n|j�}|t|�d�}t|d�}t|�||fS(u�atext = <matches _atext_matcher>

    We allow any non-ATOM_ENDS in atext, but add an InvalidATextDefect to
    the token's defects list if we find non-atext characters.
    uexpected atext but found '{}'Nuatext(u_non_atom_end_matcheruerrorsuHeaderParseErroruformatugroupulenu
ValueTerminalu_validate_xtext(uvalueumuatext((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	get_atext�s
u	get_atextcCsT|ddkr+tjdj|���nt�}|dd�}x�|r|ddkr|dtkr�t|�\}}n�|dd�dkr�y/t|�\}}|jjtj	d��Wqtjk
r�t
|�\}}YqXnt
|�\}}|j|�qGW|s@|jjtj	d	��||fS||dd�fS(
u�bare-quoted-string = DQUOTE *([FWS] qcontent) [FWS] DQUOTE

    A quoted-string without the leading or trailing white space.  Its
    value is the text between the quote marks, with whitespace
    preserved and quoted pairs decoded.
    iu"uexpected '"' but found '{}'iNiu=?u!encoded word inside quoted stringu"end of header inside quoted string(uerrorsuHeaderParseErroruformatuBareQuotedStringuWSPuget_fwsuget_encoded_wordudefectsuappenduInvalidHeaderDefectuget_qcontent(uvalueubare_quoted_stringutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_bare_quoted_strings,	

uget_bare_quoted_stringcCs
|r1|ddkr1tjdj|���nt�}|dd�}x�|r�|ddkr�|dtkr�t|�\}}n7|ddkr�t|�\}}nt|�\}}|j|�qMW|s�|j	jtj
d��||fS||dd�fS(u�comment = "(" *([FWS] ccontent) [FWS] ")"
       ccontent = ctext / quoted-pair / comment

    We handle nested comments here, and quoted-pair in our qp-ctext routine.
    iu(uexpected '(' but found '{}'iNu)uend of header inside comment(uerrorsuHeaderParseErroruformatuCommentuWSPuget_fwsuget_commentuget_qp_ctextuappendudefectsuInvalidHeaderDefect(uvalueucommentutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_comment*s"	

uget_commentcCstt�}x^|ri|dtkri|dtkrGt|�\}}nt|�\}}|j|�qW||fS(u,CFWS = (1*([FWS] comment) [FWS]) / FWS

    i(uCFWSListuCFWS_LEADERuWSPuget_fwsuget_commentuappend(uvalueucfwsutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_cfwsCs	uget_cfwscCs�t�}|rA|dtkrAt|�\}}|j|�nt|�\}}|j|�|r�|dtkr�t|�\}}|j|�n||fS(u�quoted-string = [CFWS] <bare-quoted-string> [CFWS]

    'bare-quoted-string' is an intermediate class defined by this
    parser and not by the RFC grammar.  It is the quoted string
    without any attached CFWS.
    i(uQuotedStringuCFWS_LEADERuget_cfwsuappenduget_bare_quoted_string(uvalueu
quoted_stringutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_quoted_stringPs	
uget_quoted_stringc
Cs%t�}|rA|dtkrAt|�\}}|j|�n|rr|dtkrrtjdj|���n|jd�r�yt	|�\}}Wq�tjk
r�t
|�\}}Yq�Xnt
|�\}}|j|�|r|dtkrt|�\}}|j|�n||fS(uPatom = [CFWS] 1*atext [CFWS]

    An atom could be an rfc2047 encoded word.
    iuexpected atom but found '{}'u=?(uAtomuCFWS_LEADERuget_cfwsuappendu	ATOM_ENDSuerrorsuHeaderParseErroruformatu
startswithuget_encoded_wordu	get_atext(uvalueuatomutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_atombs$	
uget_atomcCs�t�}|s |dtkr;tjdj|���nxo|r�|dtkr�t|�\}}|j|�|r>|ddkr>|jt�|dd�}q>q>W|dtkr�tjdjd|���n||fS(u( dot-text = 1*atext *("." 1*atext)

    iu8expected atom at a start of dot-atom-text but found '{}'u.iNu4expected atom at end of dot-atom-text but found '{}'i����(uDotAtomTextu	ATOM_ENDSuerrorsuHeaderParseErroruformatu	get_atextuappenduDOT(uvalueu
dot_atom_textutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_dot_atom_text}s	

uget_dot_atom_textcCs�t�}|dtkr;t|�\}}|j|�n|jd�r�yt|�\}}Wq�tjk
r�t|�\}}Yq�Xnt|�\}}|j|�|r�|dtkr�t|�\}}|j|�n||fS(u� dot-atom = [CFWS] dot-atom-text [CFWS]

    Any place we can have a dot atom, we could instead have an rfc2047 encoded
    word.
    iu=?(	uDotAtomuCFWS_LEADERuget_cfwsuappendu
startswithuget_encoded_worduerrorsuHeaderParseErroruget_dot_atom_text(uvalueudot_atomutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_dot_atom�s	
uget_dot_atomcCs�|dtkr%t|�\}}nd}|ddkrPt|�\}}n=|dtkr{tjdj|���nt|�\}}|dk	r�|g|dd�<n||fS(u�word = atom / quoted-string

    Either atom or quoted-string may start with CFWS.  We have to peel off this
    CFWS first to determine which type of word to parse.  Afterward we splice
    the leading CFWS, if any, into the parsed sub-token.

    If neither an atom or a quoted-string is found before the next special, a
    HeaderParseError is raised.

    The token returned is either an Atom or a QuotedString, as appropriate.
    This means the 'word' level of the formal grammar is not represented in the
    parse tree; this is because having that extra layer when manipulating the
    parse tree is more confusing than it is helpful.

    iu"u1Expected 'atom' or 'quoted-string' but found '{}'N(	uCFWS_LEADERuget_cfwsuNoneuget_quoted_stringuSPECIALSuerrorsuHeaderParseErroruformatuget_atom(uvalueuleaderutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_word�suget_wordcCsIt�}y#t|�\}}|j|�Wn.tjk
r\|jjtjd��YnXx�|r>|dtkr>|ddkr�|jt�|jjtj	d��|dd�}q`yt|�\}}WnVtjk
r-|dt
kr&t|�\}}|jjtj	d��n�YnX|j|�q`W||fS(u� phrase = 1*word / obs-phrase
        obs-phrase = word *(word / "." / CFWS)

    This means a phrase can be a sequence of words, periods, and CFWS in any
    order as long as it starts with at least one word.  If anything other than
    words is detected, an ObsoleteHeaderDefect is added to the token's defect
    list.  We also accept a phrase that starts with CFWS followed by a dot;
    this is registered as an InvalidHeaderDefect, since it is not supported by
    even the obsolete grammar.

    uphrase does not start with wordiu.uperiod in 'phrase'iNucomment found without atom(uPhraseuget_worduappenduerrorsuHeaderParseErrorudefectsuInvalidHeaderDefectuPHRASE_ENDSuDOTuObsoleteHeaderDefectuCFWS_LEADERuget_cfws(uvalueuphraseutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
get_phrase�s.	


u
get_phrasecCs�t�}d}|dtkr4t|�\}}n|sUtjdj|���nyt|�\}}Wnrtjk
r�yt|�\}}WnDtjk
r�|ddkr�|dt	kr��nt
�}YnXYnX|dk	r|g|dd�<n|j|�|r�|ddks5|dt	kr�tt
|�|�\}}|jdkr||jjtjd��n|jjtjd��||d<ny|jjd�Wn+tk
r�|jjtjd	��YnX||fS(
u= local-part = dot-atom / quoted-string / obs-local-part

    iu"expected local-part but found '{}'u\Nuinvalid-obs-local-partu<local-part is not dot-atom, quoted-string, or obs-local-partu,local-part is not a dot-atom (contains CFWS)uasciiu)local-part contains non-ASCII characters)(u	LocalPartuNoneuCFWS_LEADERuget_cfwsuerrorsuHeaderParseErroruformatuget_dot_atomuget_worduPHRASE_ENDSu	TokenListuappenduget_obs_local_partustru
token_typeudefectsuInvalidHeaderDefectuObsoleteHeaderDefectuvalueuencodeuUnicodeEncodeErroruNonASCIILocalPartDefect(uvalueu
local_partuleaderutokenuobs_local_part((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_local_part�sB	 
&



uget_local_partcCs]t�}d}x�|r�|ddks8|dtkr�|ddkr�|rj|jjtjd��n|jt�d}|dd�}qn_|ddkr�|jt	|dd��|dd�}|jjtjd��d}qn|r'|dj
d	kr'|jjtjd
��nyt|�\}}d}Wn=tjk
r�|dt
krl�nt|�\}}YnX|j|�qW|dj
d	ks�|dj
dkr�|dj
d	kr�|jjtjd��n|dj
d	ks"|dj
dkr>|dj
d	kr>|jjtjd��n|jrSd|_
n||fS(u' obs-local-part = word *("." word)
    iu\u.uinvalid repeated '.'iNumisplaced-specialu/'\' character outside of quoted-string/ccontentudotumissing '.' between wordsucfwsu!Invalid leading '.' in local partiu"Invalid trailing '.' in local partuinvalid-obs-local-partFTi����i����i����i����(uObsLocalPartuFalseuPHRASE_ENDSudefectsuappenduerrorsuInvalidHeaderDefectuDOTuTrueu
ValueTerminalu
token_typeuget_worduHeaderParseErroruCFWS_LEADERuget_cfws(uvalueuobs_local_partulast_non_ws_was_dotutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_obs_local_partsV	)







	uget_obs_local_partcCs]t|d�\}}}t|d�}|rI|jjtjd��nt|�||fS(u dtext = <printable ascii except \ [ ]> / obs-dtext
        obs-dtext = obs-NO-WS-CTL / quoted-pair

    We allow anything except the excluded characters, but if we find any
    ASCII other than the RFC defined printable ASCII an NonPrintableDefect is
    added to the token's defects list.  Quoted pairs are converted to their
    unquoted values, so what is returned is a ptext token, in this case a
    ValueTerminal.  If there were quoted-printables, an ObsoleteHeaderDefect is
    added to the returned token's defect list.

    u[]uptextu(quoted printable found in domain-literal(u_get_ptext_to_endcharsu
ValueTerminaludefectsuappenduerrorsuObsoleteHeaderDefectu_validate_xtext(uvalueuptextuhad_qp((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	get_dtextDs

u	get_dtextcCs:|r
dS|jtjd��|jtdd��dS(Nu"end of input inside domain-literalu]udomain-literal-endFT(uFalseuappenduerrorsuInvalidHeaderDefectu
ValueTerminaluTrue(uvalueudomain_literal((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_check_for_early_dl_endXs
u_check_for_early_dl_endcCst�}|dtkr;t|�\}}|j|�n|sStjd��n|ddkr~tjdj|���n|dd�}t||�r�||fS|jtdd��|dt	kr�t
|�\}}|j|�nt|�\}}|j|�t||�r'||fS|dt	krYt
|�\}}|j|�nt||�rr||fS|ddkr�tjd	j|���n|jtdd
��|dd�}|r�|dtkr�t|�\}}|j|�n||fS(uB domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]

    iuexpected domain-literalu[u6expected '[' at start of domain-literal but found '{}'iNudomain-literal-startu]u4expected ']' at end of domain-literal but found '{}'udomain-literal-end(u
DomainLiteraluCFWS_LEADERuget_cfwsuappenduerrorsuHeaderParseErroruformatu_check_for_early_dl_endu
ValueTerminaluWSPuget_fwsu	get_dtext(uvalueudomain_literalutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_domain_literal`sD	



uget_domain_literalcCs�t�}d}|dtkr4t|�\}}n|sUtjdj|���n|ddkr�t|�\}}|dk	r�|g|dd�<n|j|�||fSyt	|�\}}Wn'tjk
r�t
|�\}}YnX|dk	r|g|dd�<n|j|�|r�|ddkr�|jjtjd��|dj
dkrx|d|dd�<nxS|r�|ddkr�|jt�t
|dd��\}}|j|�q{Wn||fS(	u] domain = dot-atom / domain-literal / obs-domain
        obs-domain = atom *("." atom))

    iuexpected domain but found '{}'u[Nu.u(domain is not a dot-atom (contains CFWS)udot-atomi(uDomainuNoneuCFWS_LEADERuget_cfwsuerrorsuHeaderParseErroruformatuget_domain_literaluappenduget_dot_atomuget_atomudefectsuObsoleteHeaderDefectu
token_typeuDOT(uvalueudomainuleaderutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
get_domain�s<	




u
get_domaincCs�t�}t|�\}}|j|�|s?|ddkrb|jjtjd��||fS|jtdd��t|dd��\}}|j|�||fS(u( addr-spec = local-part "@" domain

    iu@u"add-spec local part with no domainuaddress-at-symboliN(uAddrSpecuget_local_partuappendudefectsuerrorsuInvalidHeaderDefectu
ValueTerminalu
get_domain(uvalueu	addr_specutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
get_addr_spec�s	



u
get_addr_speccCs,t�}x�|r�|ddks2|dtkr�|dtkrdt|�\}}|j|�q|ddkr|jt�|dd�}qqW|s�|ddkr�tjdj|���n|jt�t	|dd��\}}|j|�x�|r�|ddkr�|jt�|dd�}|s@Pn|dtkrrt|�\}}|j|�n|ddkr|jt�t	|dd��\}}|j|�qqW|s�tjd��n|ddkrtjd	j|���n|jt
dd
��||dd�fS(u� obs-route = obs-domain-list ":"
        obs-domain-list = *(CFWS / ",") "@" domain *("," [CFWS] ["@" domain])

        Returns an obs-route token with the appropriate sub-tokens (that is,
        there is no obs-domain-list in the parse tree).
    iu,iNu@u(expected obs-route domain but found '{}'u%end of header while parsing obs-routeu:u4expected ':' marking end of obs-route but found '{}'uend-of-obs-route-marker(uObsRouteuCFWS_LEADERuget_cfwsuappendu
ListSeparatoruerrorsuHeaderParseErroruformatuRouteComponentMarkeru
get_domainu
ValueTerminal(uvalueu	obs_routeutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
get_obs_route�sB	)




u
get_obs_routecCs?t�}|dtkr;t|�\}}|j|�n|sR|ddkrmtjdj|���n|jtdd��|dd�}|ddkr�|jtdd��|jjtj	d	��|dd�}||fSyt
|�\}}Wn�tjk
r�y/t|�\}}|jjtjd
��Wn-tjk
rstjdj|���YnX|j|�t
|�\}}YnX|j|�|r�|ddkr�|dd�}n|jjtj	d��|jtdd��|r5|dtkr5t|�\}}|j|�n||fS(
u� angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
        obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS]

    iu<u"expected angle-addr but found '{}'uangle-addr-startiNu>uangle-addr-endunull addr-spec in angle-addru*obsolete route specification in angle-addru.expected addr-spec or obs-route but found '{}'u"missing trailing '>' on angle-addr(
u	AngleAddruCFWS_LEADERuget_cfwsuappenduerrorsuHeaderParseErroruformatu
ValueTerminaludefectsuInvalidHeaderDefectu
get_addr_specu
get_obs_routeuObsoleteHeaderDefect(uvalueu
angle_addrutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_angle_addr�sJ	




uget_angle_addrcCsRt�}t|�\}}|j|dd��|jdd�|_||fS(u� display-name = phrase

    Because this is simply a name-rule, we don't return a display-name
    token containing a phrase, but rather a display-name token with
    the content of the phrase.

    N(uDisplayNameu
get_phraseuextendudefects(uvalueudisplay_nameutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_display_names
	uget_display_namecCsJt�}d}|dtkrUt|�\}}|sUtjdj|���qUn|ddkr�|dtkr�tjdj|���nt|�\}}|s�tjdj|���n|dk	r�|g|ddd�<d}n|j	|�nt
|�\}}|dk	r3|g|dd�<n|j	|�||fS(u, name-addr = [display-name] angle-addr

    iu!expected name-addr but found '{}'u<N(uNameAddruNoneuCFWS_LEADERuget_cfwsuerrorsuHeaderParseErroruformatuPHRASE_ENDSuget_display_nameuappenduget_angle_addr(uvalueu	name_addruleaderutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
get_name_addr!s0		
u
get_name_addrcCs�t�}yt|�\}}Wn[tjk
r|yt|�\}}Wn-tjk
rwtjdj|���YnXYnXtdd�|jD��r�d|_n|j	|�||fS(u& mailbox = name-addr / addr-spec

    uexpected mailbox but found '{}'css!|]}t|tj�VqdS(N(u
isinstanceuerrorsuInvalidHeaderDefect(u.0ux((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	<genexpr>Nsuget_mailbox.<locals>.<genexpr>uinvalid-mailbox(
uMailboxu
get_name_addruerrorsuHeaderParseErroru
get_addr_specuformatuanyuall_defectsu
token_typeuappend(uvalueumailboxutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_mailbox?s	
uget_mailboxcCs�t�}xv|r�|d|kr�|dtkr_|jt|dd��|dd�}qt|�\}}|j|�qW||fS(u� Read everything up to one of the chars in endchars.

    This is outside the formal grammar.  The InvalidMailbox TokenList that is
    returned acts like a Mailbox, but the data attributes are None.

    iumisplaced-specialiN(uInvalidMailboxuPHRASE_ENDSuappendu
ValueTerminalu
get_phrase(uvalueuendcharsuinvalid_mailboxutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_invalid_mailboxTs	
uget_invalid_mailboxcCsYt�}xC|rN|ddkrNy#t|�\}}|j|�Wnftjk
r�d}|dtkr t|�\}}|s�|ddkr�|j|�|jjtj	d��q�t
|d�\}}|dk	r�|g|dd�<n|j|�|jjtjd��n�|ddkrL|jjtj	d��n]t
|d�\}}|dk	r�|g|dd�<n|j|�|jjtjd��YnX|r|ddkr|d
}d	|_t
|d�\}}|j
|�|jjtjd��n|r|ddkr|jt�|dd�}qqW||fS(uJ mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
        obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS])

    For this routine we go outside the formal grammar in order to improve error
    handling.  We recognize the end of the mailbox list only at the end of the
    value or at a ';' (the group terminator).  This is so that we can turn
    invalid mailboxes into InvalidMailbox tokens and continue parsing any
    remaining valid mailboxes.  We also allow all mailbox entries to be null,
    and this condition is handled appropriately at a higher level.

    iu;u,;uempty element in mailbox-listNuinvalid mailbox in mailbox-listu,iuinvalid-mailboxi����(uMailboxListuget_mailboxuappenduerrorsuHeaderParseErroruNoneuCFWS_LEADERuget_cfwsudefectsuObsoleteHeaderDefectuget_invalid_mailboxuInvalidHeaderDefectu
token_typeuextendu
ListSeparator(uvalueumailbox_listutokenuleaderumailbox((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_mailbox_listfsN	






	


uget_mailbox_listcCslt�}|s2|jjtjd��||fSd}|r�|dtkr�t|�\}}|s�|jjtjd��|j|�||fS|ddkr�|j|�||fSnt|�\}}t	|j
�dkr3|dk	r|j|�n|j|�|jjtjd��||fS|dk	rU|g|dd�<n|j|�||fS(ug group-list = mailbox-list / CFWS / obs-group-list
        obs-group-list = 1*([CFWS] ",") [CFWS]

    uend of header before group-listiuend of header in group-listu;ugroup-list with empty entriesN(
u	GroupListudefectsuappenduerrorsuInvalidHeaderDefectuNoneuCFWS_LEADERuget_cfwsuget_mailbox_listulenu
all_mailboxesuextenduObsoleteHeaderDefect(uvalueu
group_listuleaderutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_group_list�s8	










uget_group_listcCs�t�}t|�\}}|s2|ddkrMtjdj|���n|j|�|jtdd��|dd�}|r�|ddkr�|jtdd��||dd�fSt|�\}}|j|�|s|jjtj	d	��n|ddkr,tjd
j|���n|jtdd��|dd�}|r�|dt
kr�t|�\}}|j|�n||fS(u7 group = display-name ":" [group-list] ";" [CFWS]

    iu:u8expected ':' at end of group display name but found '{}'ugroup-display-name-terminatoriNu;ugroup-terminatoruend of header in groupu)expected ';' at end of group but found {}(uGroupuget_display_nameuerrorsuHeaderParseErroruformatuappendu
ValueTerminaluget_group_listudefectsuInvalidHeaderDefectuCFWS_LEADERuget_cfws(uvalueugrouputoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	get_group�s2	


u	get_groupcCs�t�}yt|�\}}Wn[tjk
r|yt|�\}}Wn-tjk
rwtjdj|���YnXYnX|j|�||fS(u� address = mailbox / group

    Note that counter-intuitively, an address can be either a single address or
    a list of addresses (a group).  This is why the returned Address object has
    a 'mailboxes' attribute which treats a single address as a list of length
    one.  When you need to differentiate between to two cases, extract the single
    element, which is either a mailbox or a group token.

    uexpected address but found '{}'(uAddressu	get_groupuerrorsuHeaderParseErroruget_mailboxuformatuappend(uvalueuaddressutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_address�s	
uget_addresscCskt�}xU|r`y#t|�\}}|j|�Wn�tjk
r�}zhd}|dtkrt|�\}}|s�|ddkr�|j|�|jjtj	d��q�t
|d�\}}|dk	r�|g|dd�<n|jt|g��|jjtjd��n�|ddkrJ|jjtj	d��nft
|d�\}}|dk	r�|g|dd�<n|jt|g��|jjtjd��WYdd}~XnX|r.|ddkr.|d
d}d|_
t
|d�\}}|j|�|jjtjd��n|r|jtdd	��|dd�}qqW||fS(u� address_list = (address *("," address)) / obs-addr-list
        obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])

    We depart from the formal grammar here by continuing to parse until the end
    of the input, assuming the input to be entirely composed of an
    address-list.  This is always true in email parsing, and allows us
    to skip invalid addresses to parse additional valid ones.

    iu,u"address-list entry with no contentNuinvalid address in address-listuempty element in address-listiuinvalid-mailboxulist-separatori����(uAddressListuget_addressuappenduerrorsuHeaderParseErroruNoneuCFWS_LEADERuget_cfwsudefectsuObsoleteHeaderDefectuget_invalid_mailboxuAddressuInvalidHeaderDefectu
token_typeuextendu
ValueTerminal(uvalueuaddress_listutokenuerruleaderumailbox((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_address_list�sN
		



	

uget_address_listcCs�t�}|s,|jjtjd��|S|dtkr�t|�\}}|j|�|s�|jjtjd��q�nd}xH|r�|ddkr�|dtkr�||d7}|dd�}q�W|j�s|jjtjdj	|���|jt
|d	��n%t|�|_|jt
|d
��|ru|dtkrut|�\}}|j|�n|s�|ddkr�|jdk	r�|jjtjd��n|r�|jt
|d	��n|S|jt
dd��|dd�}|r8|dtkr8t|�\}}|j|�n|sm|jdk	ri|jjtjd��n|Sd}x8|r�|dtkr�||d7}|dd�}qvW|j�s�|jjtjd
j	|���|jt
|d	��n%t|�|_|jt
|d
��|rR|dtkrRt|�\}}|j|�n|r�|jjtjd��|jt
|d	��n|S(uE mime-version = [CFWS] 1*digit [CFWS] "." [CFWS] 1*digit [CFWS]

    u%Missing MIME version number (eg: 1.0)iu0Expected MIME version number but found only CFWSuu.iNu1Expected MIME major version number but found {!r}uxtextudigitsu0Incomplete MIME version; found only major numberuversion-separatoru1Expected MIME minor version number but found {!r}u'Excess non-CFWS text after MIME version(uMIMEVersionudefectsuappenduerrorsuHeaderMissingRequiredValueuCFWS_LEADERuget_cfwsuisdigituInvalidHeaderDefectuformatu
ValueTerminaluintumajoruNoneuminor(uvalueumime_versionutokenudigits((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparse_mime_version=	sv	

)


uparse_mime_versioncCs�t�}xv|r�|ddkr�|dtkr_|jt|dd��|dd�}qt|�\}}|j|�qW||fS(u� Read everything up to the next ';'.

    This is outside the formal grammar.  The InvalidParameter TokenList that is
    returned acts like a Parameter, but the data attributes are None.

    iu;umisplaced-specialiN(uInvalidParameteruPHRASE_ENDSuappendu
ValueTerminalu
get_phrase(uvalueuinvalid_parameterutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_invalid_parameter�	s	
uget_invalid_parametercCsrt|�}|s-tjdj|���n|j�}|t|�d�}t|d�}t|�||fS(u8ttext = <matches _ttext_matcher>

    We allow any non-TOKEN_ENDS in ttext, but add defects to the token's
    defects list if we find non-ttext characters.  We also register defects for
    *any* non-printables even though the RFC doesn't exclude all of them,
    because we follow the spirit of RFC 5322.

    uexpected ttext but found '{}'Nuttext(u_non_token_end_matcheruerrorsuHeaderParseErroruformatugroupulenu
ValueTerminalu_validate_xtext(uvalueumuttext((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	get_ttext�	s	
u	get_ttextcCs�t�}|rA|dtkrAt|�\}}|j|�n|rr|dtkrrtjdj|���nt|�\}}|j|�|r�|dtkr�t|�\}}|j|�n||fS(u�token = [CFWS] 1*ttext [CFWS]

    The RFC equivalent of ttext is any US-ASCII chars except space, ctls, or
    tspecials.  We also exclude tabs even though the RFC doesn't.

    The RFC implies the CFWS but is not explicit about it in the BNF.

    iuexpected token but found '{}'(	uTokenuCFWS_LEADERuget_cfwsuappendu
TOKEN_ENDSuerrorsuHeaderParseErroruformatu	get_ttext(uvalueumtokenutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	get_token�	s		
u	get_tokencCsrt|�}|s-tjdj|���n|j�}|t|�d�}t|d�}t|�||fS(uQattrtext = 1*(any non-ATTRIBUTE_ENDS character)

    We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the
    token's defects list if we find non-attrtext characters.  We also register
    defects for *any* non-printables even though the RFC doesn't exclude all of
    them, because we follow the spirit of RFC 5322.

    u expected attrtext but found {!r}Nuattrtext(u_non_attribute_end_matcheruerrorsuHeaderParseErroruformatugroupulenu
ValueTerminalu_validate_xtext(uvalueumuattrtext((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_attrtext�	s	
uget_attrtextcCs�t�}|rA|dtkrAt|�\}}|j|�n|rr|dtkrrtjdj|���nt|�\}}|j|�|r�|dtkr�t|�\}}|j|�n||fS(uH [CFWS] 1*attrtext [CFWS]

    This version of the BNF makes the CFWS explicit, and as usual we use a
    value terminal for the actual run of characters.  The RFC equivalent of
    attrtext is the token characters, with the subtraction of '*', "'", and '%'.
    We include tab in the excluded set just as we do for token.

    iuexpected token but found '{}'(	u	AttributeuCFWS_LEADERuget_cfwsuappenduATTRIBUTE_ENDSuerrorsuHeaderParseErroruformatuget_attrtext(uvalueu	attributeutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
get_attribute�	s		
u
get_attributecCsrt|�}|s-tjdj|���n|j�}|t|�d�}t|d�}t|�||fS(u�attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%')

    This is a special parsing routine so that we get a value that
    includes % escapes as a single string (which we decode as a single
    string later).

    u)expected extended attrtext but found {!r}Nuextended-attrtext(u#_non_extended_attribute_end_matcheruerrorsuHeaderParseErroruformatugroupulenu
ValueTerminalu_validate_xtext(uvalueumuattrtext((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_extended_attrtext�	s
uget_extended_attrtextcCs�t�}|rA|dtkrAt|�\}}|j|�n|rr|dtkrrtjdj|���nt|�\}}|j|�|r�|dtkr�t|�\}}|j|�n||fS(u� [CFWS] 1*extended_attrtext [CFWS]

    This is like the non-extended version except we allow % characters, so that
    we can pick up an encoded value as a single string.

    iuexpected token but found '{}'(	u	AttributeuCFWS_LEADERuget_cfwsuappenduEXTENDED_ATTRIBUTE_ENDSuerrorsuHeaderParseErroruformatuget_extended_attrtext(uvalueu	attributeutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_extended_attribute�	s	
uget_extended_attributecCs<t�}|s |ddkr;tjdj|���n|jtdd��|dd�}|sy|dj�r�tjdj|���nd}x8|r�|dj�r�||d7}|dd�}q�W|dd	kr
|d	kr
|jjtjd
��nt	|�|_
|jt|d��||fS(u6 '*' digits

    The formal BNF is more complicated because leading 0s are not allowed.  We
    check for that and add a defect.  We also assume no CFWS is allowed between
    the '*' and the digits, though the RFC is not crystal clear on that.
    The caller should already have dealt with leading CFWS.

    iu*uExpected section but found {}usection-markeriNu$Expected section number but found {}uu0u&section numberhas an invalid leading 0udigits(uSectionuerrorsuHeaderParseErroruformatuappendu
ValueTerminaluisdigitudefectsuInvalidHeaderErroruintunumber(uvalueusectionudigits((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuget_section
s$		uget_sectioncCs�t�}|s!tjd��nd}|dtkrLt|�\}}n|smtjdj|���n|ddkr�t|�\}}nt|�\}}|dk	r�|g|dd�<n|j	|�||fS(u  quoted-string / attribute

    u&Expected value but found end of stringiu Expected value but found only {}u"N(
uValueuerrorsuHeaderParseErroruNoneuCFWS_LEADERuget_cfwsuformatuget_quoted_stringuget_extended_attributeuappend(uvalueuvuleaderutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu	get_value-
s 	
u	get_valuecCs�t�}t|�\}}|j|�|s?|ddkrk|jjtjdj|���||fS|ddkry,t|�\}}d|_	|j|�Wntj
k
r�YnX|s�tj
d��n|ddkr|jtdd��|dd�}d|_qn|dd	kr>tj
d
��n|jtd	d��|dd�}d}|r�|dtkr�t|�\}}|j|�nd}|}|jr|r|ddkrt|�\}}|j}d}|jdkrP|r|dd
krd}q�t|�\}}	|	r�|	dd
kr�d}q�n0yt|�\}}	WnYnX|	s�d}n|r�|jjtjd��|j|�x7|D]/}
|
jdkr�g|
dd�<|
}Pq�q�W|}qd}|jjtjd��n|r0|dd
kr0d}nt|�\}}|js[|jdkr�|sr|dd
kr�|j|�|dk	r�|}n||fS|jjtjd��n|s�|jjtjd��|j|�|dkrE||fSnF|dk	rXx!|D]}
|
jdkrPqqW|
jdk|j|
�|
j|_n|dd
kr�tj
dj|���n|jtd
d��|dd�}|r|dd
krt|�\}}|j|�|j|_|s|dd
krtj
dj|���qn|jtd
d��|dd�}|dk	r�t�}xN|r�|dtkr�t|�\}}nt|�\}}|j|�q]W|}nt|�\}}|j|�|dk	r�|}n||fS(uY attribute [section] ["*"] [CFWS] "=" value

    The CFWS is implied by the RFC but not made explicit in the BNF.  This
    simplified form of the BNF from the RFC is made to conform with the RFC BNF
    through some extra checks.  We do it this way because it makes both error
    recovery and working with the resulting parse tree easier.
    iu;u)Parameter contains name ({}) but no valueu*uIncomplete parameteruextended-parameter-markeriNu=uParameter not followed by '='uparameter-separatoru"u'u5Quoted string value for extended parameter is invalidubare-quoted-stringuZParameter marked as extended but appears to have a quoted string value that is non-encodeducApparent initial-extended-value but attribute was not marked as extended or was not initial sectionu(Missing required charset/lang delimitersuextended-attrtextuattrtextu=Expected RFC2231 char/lang encoding delimiter, but found {!r}uRFC2231 delimiteru;Expected RFC2231 char/lang encoding delimiter, but found {}TF(u	Parameteru
get_attributeuappendudefectsuerrorsuInvalidHeaderDefectuformatuget_sectionuTrueu	sectioneduHeaderParseErroru
ValueTerminaluextendeduNoneuCFWS_LEADERuget_cfwsuget_quoted_stringustripped_valueuFalseusection_numberuget_attrtextuget_extended_attrtextu
token_typeu	get_valueuvalueucharsetulanguValueuWSPuget_fwsuget_qcontent(uvalueuparamutokenuleaderu	remainderuappendtouqstringuinner_valueu
semi_validurestutuv((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu
get_parameterC
s�	


				


	
	
	








			
	u
get_parametercCs�t�}x�|r�y#t|�\}}|j|�Wntjk
rF}z�d}|dtkrxt|�\}}n|s�|j|�|S|ddkr�|dk	r�|j|�n|jjtj	d��n]t
|�\}}|r|g|dd�<n|j|�|jjtj	dj|���WYdd}~XnX|r�|ddkr�|d
}d|_t
|�\}}|j
|�|jjtj	dj|���n|r|jtdd	��|dd�}qqW|S(u! parameter *( ";" parameter )

    That BNF is meant to indicate this routine should only be called after
    finding and handling the leading ';'.  There is no corresponding rule in
    the formal RFC grammar, but it is more convenient for us for the set of
    parameters to be treated as its own TokenList.

    This is 'parse' routine because it consumes the reminaing value, but it
    would never be called to parse a full header.  Instead it is called to
    parse everything after the non-parameter value of a specific MIME header.

    iu;uparameter entry with no contentNuinvalid parameter {!r}iuinvalid-parameteru)parameter with invalid trailing text {!r}uparameter-separatori����(uMimeParametersu
get_parameteruappenduerrorsuHeaderParseErroruNoneuCFWS_LEADERuget_cfwsudefectsuInvalidHeaderDefectuget_invalid_parameteruformatu
token_typeuextendu
ValueTerminal(uvalueumime_parametersutokenuerruleaderuparam((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparse_mime_parameters�
sD
		


&
	
uparse_mime_parameterscCs�xv|rx|ddkrx|dtkrV|jt|dd��|dd�}qt|�\}}|j|�qW|s�dS|jtdd��|jt|dd���dS(uBDo our best to find the parameters in an invalid MIME header

    iu;umisplaced-specialiNuparameter-separator(uPHRASE_ENDSuappendu
ValueTerminalu
get_phraseuparse_mime_parameters(u	tokenlistuvalueutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu_find_mime_parameterssu_find_mime_parameterscCs>t�}d
}|s2|jjtjd��|Syt|�\}}WnHtjk
r�|jjtjdj	|���t
||�|SYnX|j|�|s�|ddkr�|jjtjd��|r�t
||�n|S|jj�j
�|_|jtdd��|dd�}yt|�\}}WnHtjk
r�|jjtjd	j	|���t
||�|SYnX|j|�|jj�j
�|_|s�|S|dd
kr|jjtjdj	|���|`|`t
||�|S|jtd
d��|jt|dd���|S(u� maintype "/" subtype *( ";" parameter )

    The maintype and substype are tokens.  Theoretically they could
    be checked against the official IANA list + x-token, but we
    don't do that.
    u"Missing content type specificationu(Expected content maintype but found {!r}iu/uInvalid content typeucontent-type-separatoriNu'Expected content subtype but found {!r}u;u<Only parameters are valid after content type, but found {!r}uparameter-separatorF(uContentTypeuFalseudefectsuappenduerrorsuHeaderMissingRequiredValueu	get_tokenuHeaderParseErroruInvalidHeaderDefectuformatu_find_mime_parametersuvalueustripulowerumaintypeu
ValueTerminalusubtypeuparse_mime_parameters(uvalueuctypeurecoverutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyuparse_content_type_headersX	

	


	


uparse_content_type_headerc
Cs6t�}|s,|jjtjd��|Syt|�\}}WnHtjk
r�tjjtjdj	|���t
||�|SYnX|j|�|jj�j
�|_|s�|S|ddkr�|jjtjdj	|���t
||�|S|jtdd��|jt|dd���|S(	u* disposition-type *( ";" parameter )

    uMissing content dispositionu+Expected content disposition but found {!r}iu;uCOnly parameters are valid after content disposition, but found {!r}uparameter-separatoriN(uContentDispositionudefectsuappenduerrorsuHeaderMissingRequiredValueu	get_tokenuHeaderParseErroructypeuInvalidHeaderDefectuformatu_find_mime_parametersuvalueustripulowerucontent_dispositionu
ValueTerminaluparse_mime_parameters(uvalueudisp_headerutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu parse_content_disposition_headerKs2	

	


u parse_content_disposition_headercCs1t�}|s,|jjtjd��|Syt|�\}}Wn7tjk
r{tjjtjdj	|���Yn&X|j|�|j
j�j�|_
|s�|Sx|r,|jjtjd��|dtkr
|jt|dd��|dd�}q�t|�\}}|j|�q�W|S(u mechanism

    u!Missing content transfer encodingu1Expected content trnasfer encoding but found {!r}u*Extra text after content transfer encodingiumisplaced-specialiN(uContentTransferEncodingudefectsuappenduerrorsuHeaderMissingRequiredValueu	get_tokenuHeaderParseErroructypeuInvalidHeaderDefectuformatuvalueustripuloweructeuPHRASE_ENDSu
ValueTerminalu
get_phrase(uvalueu
cte_headerutoken((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu&parse_content_transfer_encoding_headeris.	

	
u&parse_content_transfer_encoding_header(�u__doc__ureuurllibustringu	hexdigitsucollectionsu
namedtupleuOrderedDictuemailu_encoded_wordsu_ewuerrorsuutilsusetuWSPuCFWS_LEADERuSPECIALSu	ATOM_ENDSu
DOT_ATOM_ENDSuPHRASE_ENDSu	TSPECIALSu
TOKEN_ENDSu	ASPECIALSuATTRIBUTE_ENDSuEXTENDED_ATTRIBUTE_ENDSuquote_stringu_Foldedulistu	TokenListuWhiteSpaceTokenListuUnstructuredTokenListuPhraseuWorduCFWSListuAtomuTokenuEncodedWorduQuotedStringuBareQuotedStringuCommentuAddressListuAddressuMailboxListu	GroupListuGroupuNameAddru	AngleAddruObsRouteuMailboxuInvalidMailboxuDomainuDotAtomuDotAtomTextuAddrSpecuObsLocalPartuDisplayNameu	LocalPartu
DomainLiteraluMIMEVersionu	ParameteruInvalidParameteru	AttributeuSectionuValueuMimeParametersuParameterizedHeaderValueuContentTypeuContentDispositionuContentTransferEncodinguHeaderLabeluHeaderustruTerminaluWhiteSpaceTerminalu
ValueTerminaluEWWhiteSpaceTerminaluDOTu
ListSeparatoruRouteComponentMarkerucompileuformatujoinusplitu
_wsp_splitterureplaceumatchu_non_atom_end_matcherufindallu_non_printable_finderu_non_token_end_matcheru_non_attribute_end_matcheru#_non_extended_attribute_end_matcheru_validate_xtextu_get_ptext_to_endcharsuget_fwsuget_encoded_worduget_unstructureduget_qp_ctextuget_qcontentu	get_atextuget_bare_quoted_stringuget_commentuget_cfwsuget_quoted_stringuget_atomuget_dot_atom_textuget_dot_atomuget_wordu
get_phraseuget_local_partuget_obs_local_partu	get_dtextu_check_for_early_dl_enduget_domain_literalu
get_domainu
get_addr_specu
get_obs_routeuget_angle_addruget_display_nameu
get_name_addruget_mailboxuget_invalid_mailboxuget_mailbox_listuget_group_listu	get_groupuget_addressuget_address_listuparse_mime_versionuget_invalid_parameteru	get_ttextu	get_tokenuget_attrtextu
get_attributeuget_extended_attrtextuget_extended_attributeuget_sectionu	get_valueu
get_parameteruparse_mime_parametersu_find_mime_parametersuparse_content_type_headeru parse_content_disposition_headeru&parse_content_transfer_encoding_header(((u?/opt/alt/python33/lib64/python3.3/email/_header_value_parser.pyu<module>Ds


T�J_		 '#
B3$000!
*8
&'/'$).9%>D�49

?>