b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / email /
Filename/usr/lib64/python2.6/email/utils.pyo
Size8.86 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 07:45
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sdZddddddddd d
d d d
g
ZddkZddkZddkZddkZddkZddkZddkZddk Z ddk
l Z ddk
l Z
ddk
lZddk
lZddk
lZddklZddklZlZdZdZdZdZdZeid�Zeid�Z d�Z!d�Z"d �Z#d!�Z$d"�Z%eid#ei&ei'B�Z(de*e*d$�Z+dd%�Z,d&�Zd'�Zd(�Z-d)�Z.d*�Z/ddd+�Z0eid,�Z1d-�Z2d.d/d0�Z3dS(1sMiscellaneous utilities.tcollapse_rfc2231_valuet
decode_paramstdecode_rfc2231tencode_rfc2231t
formataddrt
formatdatet getaddressest
make_msgidt mktime_tzt parseaddrt parsedatet parsedate_tztunquoteiÿÿÿÿN(tquote(t AddressList(R(R
(R (t decodestring(t_bencodet_qencodes, tus
t's[][\\()<>@,:;".]s [][\\()"]cCs|S(N((ts((s#/usr/lib64/python2.6/email/utils.pyt _identity:scCsI|p|Sti|�}|id� o|id�o |d S|S(Ns
iÿÿÿÿ(tbase64Rtendswith(Rtvalue((s#/usr/lib64/python2.6/email/utils.pyt_bdecode>s ! cCs.tidt|�}tidt|�}|S(s+Replace all line-ending characters with
.s (?<!\r)\ns\r(?!\n)(tretsubtCRLF(R((s#/usr/lib64/python2.6/email/utils.pytfix_eolsJscCs^|\}}|oGd}ti|�o
d}ntid|�}d||||fS|S(sThe inverse of parseaddr(), this takes a 2-tuple of the form
(realname, email_address) and returns the string value suitable
for an RFC 2822 From, To or Cc header.

If the first element of pair is false, then the second element is
returned unmodified.
Rt"s\\\g<0>s %s%s%s <%s>(t
specialsretsearcht escapesreR(tpairtnametaddresstquotes((s#/usr/lib64/python2.6/email/utils.pyRTs 
cCs"ti|�}t|�}|iS(s7Return a list of (REALNAME, EMAIL) for each fieldvalue.(t
COMMASPACEtjoint _AddressListt addresslist(t fieldvaluestallta((s#/usr/lib64/python2.6/email/utils.pyRgs s_
=\? # literal =?
(?P<charset>[^?]*?) # non-greedy up to the next ? is the charset
\? # literal ?
(?P<encoding>[qb]) # either a "q" or a "b", case insensitive
\? # literal ?
(?P<atom>.*?) # non-greedy up to the next ?= is the atom
\?= # literal ?=
c CsX|d$joti�}n|o�ti|�}tio|do
ti}n
ti}tt|�d�\}}|djo
d}nd}d|||df}n'ti|�}|o
d}nd }d
d d d
ddddg|d|dddddddddddddg |d d |d|d!|d"|d#|fS(%s�Returns a date string as specified by RFC 2822, e.g.:

Fri, 09 Nov 2001 01:08:47 -0000

Optional timeval if given is a floating point time value as accepted by
gmtime() and localtime(), otherwise the current time is used.

Optional localtime is a flag that when True, interprets timeval, and
returns a date relative to the local timezone instead of UTC, properly
taking daylight savings time into account.

Optional argument usegmt means that the timezone is written out as
an ascii string, not numeric one (so "GMT" instead of "+0000"). This
is needed for HTTP, and is only used when localtime==False.
iÿÿÿÿiit-t+s
%s%02d%02di<tGMTs-0000s"%s, %02d %s %04d %02d:%02d:%02d %stMontTuetWedtThutFritSattSuniitJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDeciiiiN( tNonettimet localtimetdaylighttaltzonettimezonetdivmodtabstgmtime( ttimevalREtusegmttnowtoffsetthourstminutestsigntzone((s#/usr/lib64/python2.6/email/utils.pyR{s.

 


 !cCs�ti�}tidti|��}ti�}tid�}|djo
d}n d|}ti �}d|||||f}|S(sèReturns a string suitable for RFC 2822 compliant Message-ID, e.g:

<[email protected]>

Optional idstring if given is a string used to strengthen the
uniqueness of the message id.
s %Y%m%d%H%M%Si �Rt.s<%s.%s.%s%s@%s>N(
RDtstrftimeRKtostgetpidtrandomt randrangeRCtsockettgetfqdn(tidstringRLtutcdatetpidtrandinttidhosttmsgid((s#/usr/lib64/python2.6/email/utils.pyR°s  


 cCs|pdSt|�S(N(RCt
_parsedate(tdata((s#/usr/lib64/python2.6/email/utils.pyR
ÉscCs|pdSt|�S(N(RCt
_parsedate_tz(Rc((s#/usr/lib64/python2.6/email/utils.pyR ÏscCs#t|�i}|pdS|dS(NRi(RR(R(R)(taddrtaddrs((s#/usr/lib64/python2.6/email/utils.pyR ÕscCs�t|�djot|id�o4|id�o$|dd!idd�idd�S|id�o|id�o |dd!Sn|S( sRemove quotes from a string.iRiÿÿÿÿs\\s\s\"t<t>(tlent
startswithRtreplace(tstr((s#/usr/lib64/python2.6/email/utils.pyR Ýs  $ cCs7|itd�}t|�djodd|fS|S(s#Decode string according to RFC 2231iN(tsplittTICKRiRC(Rtparts((s#/usr/lib64/python2.6/email/utils.pyRéscCshddk}|i|dd�}|djo|djo|S|djo
d}nd|||fS(sÜEncode string according to RFC 2231.

If neither charset nor language is given, then s is returned as-is. If
charset is given but not language, the string is encoded using the empty
string for language.
iÿÿÿÿNtsafeRs%s'%s'%s(turllibR
RC(RtcharsettlanguageRq((s#/usr/lib64/python2.6/email/utils.pyRñs 

s&^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$c

Cs|}g}h}|id�\}}|i||f�xÛ|oÓ|id�\}}|id�o
t}nt}t|�}ti|�}|o[|idd�\}}|dj ot
|�}n|i |g�i|||f�q>|i|dt |�f�q>W|oêxç|i
�D]Õ\}}g}t} |i�xD|D]<\}}
}|oti|
�}
t} n|i|
�qVWt ti|��}| o9t|�\} } }|i|| | d|ff�q-|i|d|f�q-Wn|S(sDecode parameters list according to RFC 2231.

params is a sequence of 2-tuples containing (param name, string value).
it*R#tnums"%s"N(tpoptappendRtTruetFalseR trfc2231_continuationtmatchtgroupRCtintt
setdefaultR
titemstsortRqt EMPTYSTRINGR'R(
tparamst
new_paramstrfc2231_paramsR#RtencodedtmoRut
continuationstextendedRRrRs((s#/usr/lib64/python2.6/email/utils.pyRsJ
 
&"


$Rksus-asciicCszt|t�o\t|d�}|dpd}yt|||�SWqvtj
ot|||�SXn t|�SdS(Niisus-ascii(t
isinstancettupleR tunicodet LookupError(Rterrorstfallback_charsettrawvalRr((s#/usr/lib64/python2.6/email/utils.pyR8s(4t__doc__t__all__RVRRDRRXRZRqtwarningstemail._parseaddrR
RR(RR
RbR RdtquopriRt_qdecodetemail.encodersRRR&R�t UEMPTYSTRINGRRntcompileRR!RRRRRtVERBOSEt
IGNORECASEtecreRCRyRRR R RRRzRR(((s#/usr/lib64/python2.6/email/utils.pyt<module>sl          
 5      5