Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/offlineimap/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/offlineimap/imaputil.pyo
�
��Vc@s�ddlZddlZddlmZd Zejd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d!d"d#d$d%gZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS(&i����N(tgetglobaluisX-LabeltKeywordss
&[^-]*-|\+cGsJg}x!|D]}|jt|��q
Wt�jddj|��dS(Ntimapt (tappendtstrRtdebugtjoin(targstmsgtarg((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pyt__debug s
cCs\|rX|jd�rX|jd�rX|dd!}|jdd�}|jdd�}n|S(s�Takes string which may or may not be quoted and unquotes it.

    It only considers double quotes. This function does NOT consider
    parenthised lists to be quoted.t"ii����s\"s\\s\(t
startswithtendswithtreplace(ts((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytdequote&s
$
cCs,|jdd�}|jdd�}d|S(s�Takes an unquoted string and quotes it.

    It only adds double quotes. This function does NOT consider
    parenthised lists to be quoted.Rs\"s\s\\s"%s"(R(R((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytquote2scCsD|ddks |ddkr3td|��nt|dd!�S(s�Converts a string of IMAP flags to a list

    :returns: E.g. '(\Draft \Deleted)' returns  ['\Draft','\Deleted'].
        (FLAGS (\Seen Old) UID 4807) returns
        ['FLAGS,'(\Seen Old)','UID', '4807']
    it(i����t)s Passed s '%s' is not a flag listi(t
ValueErrort	imapsplit(R((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pyt	flagsplit<s cCsVi}d}x6|t|�krD||d|||<|d7}qWtd|�|S(s-convert list [1,2,3,4,5,6] to {1:2, 3:4, 5:6}iiis__options2hash returning:(tlenR(tlisttretvaltcounter((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pyt__options2hashHs
cCstt|��S(s�Converts IMAP response string from eg IMAP4.fetch() to a hash.

    E.g. '(FLAGS (\Seen Old) UID 4807)' leads to
    {'FLAGS': '(\Seen Old)', 'UID': '4807'}(RR(tflags((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pyt
flags2hashVscCszt|t�std�g}x�tt|��D]�}|dr�||}|jdd�}|jdd�}d|}td||f�|j|�q2||}tjd	d
|�}td||f�|j	t
|��q2Wtdt|��|S|j�}g}xat|�ru|d
dkr�d}d}xN|r�||dkrc|d8}n||dkr�|d7}n|d7}q@W|d
|!}||j
�}|j|�q|d
dkr�t|�\}}	|j|�|	}qtj|dd�}
t|
�}|dkrA|j|
d
�|
d}qq|dkrb|j|
d
�Pq|d
krPqqW|S(s�Takes a string from an IMAP conversation and returns a list containing
    its components.  One example string is:

    (\HasNoChildren) "." "INBOX.Sent"

    The result from parsing this will be:

    ['(\HasNoChildren)', '"."', '"INBOX.Sent"']s3imapsplit() got a non-string input; working around.is\s\\Rs\"s"%s"s)imapsplit() non-string [%d]: Appending %ss\{\d+\}$ts4imapsplit() non-string [%d]: Feeding %s to recursions$imapsplit() non-string: returning %siRiRtmaxsplit(t
isinstancet
basestringRtrangeRRRtretsubtextendRRtstriptlstript__split_quotedtstringtsplit(t
imapstringRtiR
tworkstrtrparenctrparenit	parenlisttquotedtresttsplitst	splitslen((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pyR^sb





	



	
s\SeentSs	\AnsweredtRs\FlaggedtFs\DeletedtTs\DrafttDcCsSt�}|dd!j�}x0tD](\}}||kr#|j|�q#q#W|S(s8Convert string '(\Draft \Deleted)' into a flags set(DR).ii����(tsetR+tflagmaptadd(t
flagstringRtimapflaglisttimapflagtmaildirflag((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytflagsimap2maildir�s	cCsFt|dd!j��}tgtD]\}}|^q#�}||S(snConvert string '(\Draft \Deleted somekeyword otherkeyword)' into a
    keyword set (somekeyword otherkeyword).ii����(R;R+R<(R>timapflagsettflagtct
serverflagset((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytflagsimap2keywords�s%cCsTg}x0tD](\}}||kr
|j|�q
q
Wddjt|��dS(s>Convert set of flags ([DR]) into a string '(\Deleted \Draft)'.RRR(R<RRtsorted(tmaildirflaglistRR@RA((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytflagsmaildir2imap�s
cCs�d�}t|�sdSd\}}g}ttt|��}xxt|�D]j}t|�}|dkr{||}}qM||dkr�|}qM|j|||��||}}qMW|j|||��dj|�S(s�Collapse UID lists into shorter sequence sets

    [1,2,3,4,5,10,12,13] will return "1:5,10,12:13".  This function sorts
    the list, and only collapses if subsequent entries form a range.
    :returns: The collapsed UID list as string.cSs$||krt|�Sd||fS(Ns%s:%s(R(tstarttend((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytgetrange�s
Rit,N(NN(RtNoneRHtmaptinttiterRR(tuidlistRMRKRLRtsorted_uidstitem((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytuid_sequence�s 		cCs�t|�dkrdS|d}}|d}x�tr�|j|�}|dkrktd||f��nt}|d}x1|dkr�||dkr�|d8}|}q~W||d|d!7}||d}|s1||j�fSq1WdS(	s{Looks for the ending quote character in the string that starts
    with quote character, splitting out quoted component and the
    rest of the string (without possible space between these two
    parts.

    First character of the string is taken to be quote character.

    Examples:
     - "this is " a test" (\None) => ("this is " a test", (\None))
     - "\" => ("\", )
    iRii����s$can't find ending quote '%s' in '%s's\N(RR(RtTruetfindRtFalseR((RtqR2R3tnext_qt
is_escapedR-((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pyR)�s"

	

cCs(|tkrd}nd}|j|�S(s:Formats labels for embedding into a message,
    with format according to header name.

    Headers from SPACE_SEPARATED_LABEL_HEADERS keep space-separated list
    of labels, the rest uses comma (',') as the separator.

    Also see parse_labels_string() and modify it accordingly
    if logics here gets changed.RRN(tSPACE_SEPARATED_LABEL_HEADERSR(theadertlabelstsep((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytformat_labels_strings
	cCs_|tkrd}nd}|j�j|�}tg|D]}|j�r:|j�^q:�S(s~Parses a string into a set of labels, with a format according to
    the name of the header.

    See __format_labels_string() for explanation on header handling
    and keep these two functions synced with each other.

    TODO: add test to ensure that
    - format_labels_string * parse_labels_string is unity
    and
    - parse_labels_string * format_labels_string is unity
    RRN(R]R'R+R;(R^t
labels_strR`R_tl((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytparse_labels_string.s

	cCs%|rt||�}n	t�}|S(sHelper that builds label set from the corresponding header value.

    Arguments:
    - header_name: name of the header that keeps labels;
    - header_value: value of the said header, can be None

    Returns: set of labels parsed from the header (or empty set).
    (RdR;(theader_nametheader_valueR_((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytlabels_from_headerEs
	cCsNd�}tj||�}y|jd�jd�SWntk
rI|SXdS(s�Decodes a modified UTF-7 mailbox name.

    If the string cannot be decoded, it is returned unmodified.

    See RFC 3501, sec. 5.1.3.

    Arguments:
    - name: string, possibly encoded with modified UTF-7

    Returns: decoded UTF-8 string.
    cSs;|j�}|dkrdSd|dd!jdd�dS(Nt+s+-ii����RNt/t-(tgroupR(tmR((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytdemodifycssutf-7sutf-8N(tMUTF7_SHIFT_RER%tdecodetencodetUnicodeEncodeError(tnameRmtret((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pytdecode_mailbox_nameWs	
(sX-LabelR(s\SeenR6(s	\AnsweredR7(s\FlaggedR8(s\DeletedR9(s\DraftR:(R$R*tofflineimap.uiRR]tcompileRnRRRRRRRR<RBRGRJRVR)RaRdRgRt(((s8/usr/lib/python2.7/site-packages/offlineimap/imaputil.pyt<module>s2			
				X		
				 	%			

Spamworldpro Mini