?????????????? ?????????????? ?????????????? ?????????????? ó zfc@sîdZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl Zddl Z y(ej dkr¥e ‚nddlZWne k rËeZnXddlZejƒ�0ejrejddeƒnddlZWdQXdddd d d d d dddddddddgZdfd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd„ƒYZd efd„ƒYZd efd „ƒYZd ejj fd!„ƒYZ d e fd"„ƒYZ!d#e fd$„ƒYZ"de"fd%„ƒYZ#de fd&„ƒYZ$de fd'„ƒYZ%de"fd(„ƒYZ&d)fd*„ƒYZ'd+e'fd,„ƒYZ(e)d-„Z*d.„Z+d/„Z,d0„Z-d1„Z.d2„Z/d3fd4„ƒYZ0de0fd5„ƒYZ1de1fd6„ƒYZ2de0fd7„ƒYZ3dfd8„ƒYZ4de0fd9„ƒYZ5d:e6fd;„ƒYZ7d<e7fd=„ƒYZ8d>e7fd?„ƒYZ9d@e7fdA„ƒYZ:dBe7fdC„ƒYZ;dS(DsDRead/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.iÿÿÿÿNtos2emxtignores.*rfc822 has been removedtMailboxtMaildirtmboxtMHtBabyltMMDFtMessagetMaildirMessaget mboxMessaget MHMessaget BabylMessaget MMDFMessaget UnixMailboxtPortableUnixMailboxt MmdfMailboxt MHMailboxt BabylMailboxcBs4eZdZded„Zd„Zd„Zd„Zd„Z d„Z dd„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zdd„Zd„Zd„Zd„Z d„Z!e"Z#e"d„Z$RS( s*A group of messages in a particular place.cCs.tjjtjj|ƒƒ|_||_dS(sInitialize a Mailbox instance.N(tostpathtabspatht expandusert_patht_factory(tselfRtfactorytcreate((s/usr/lib64/python2.7/mailbox.pyt__init__+s!cCstdƒ‚dS(s$Add message and return assigned key.s&Method must be implemented by subclassN(tNotImplementedError(Rtmessage((s/usr/lib64/python2.7/mailbox.pytadd0scCstdƒ‚dS(s=Remove the keyed message; raise KeyError if it doesn't exist.s&Method must be implemented by subclassN(R(Rtkey((s/usr/lib64/python2.7/mailbox.pytremove4scCs|j|ƒdS(N(R!(RR ((s/usr/lib64/python2.7/mailbox.pyt __delitem__8scCs)y|j|ƒWntk r$nXdS(s'If the keyed message exists, remove it.N(R!tKeyError(RR ((s/usr/lib64/python2.7/mailbox.pytdiscard;s cCstdƒ‚dS(s>Replace the keyed message; raise KeyError if it doesn't exist.s&Method must be implemented by subclassN(R(RR R((s/usr/lib64/python2.7/mailbox.pyt __setitem__BscCs*y|j|ƒSWntk r%|SXdS(s9Return the keyed message, or default if it doesn't exist.N(t __getitem__R#(RR tdefault((s/usr/lib64/python2.7/mailbox.pytgetFs cCs0|js|j|ƒS|j|j|ƒƒSdS(s=Return the keyed message; raise KeyError if it doesn't exist.N(Rt get_messagetget_file(RR ((s/usr/lib64/python2.7/mailbox.pyR&Ms  cCstdƒ‚dS(s4Return a Message representation or raise a KeyError.s&Method must be implemented by subclassN(R(RR ((s/usr/lib64/python2.7/mailbox.pyR)TscCstdƒ‚dS(s3Return a string representation or raise a KeyError.s&Method must be implemented by subclassN(R(RR ((s/usr/lib64/python2.7/mailbox.pyt get_stringXscCstdƒ‚dS(s6Return a file-like representation or raise a KeyError.s&Method must be implemented by subclassN(R(RR ((s/usr/lib64/python2.7/mailbox.pyR*\scCstdƒ‚dS(sReturn an iterator over keys.s&Method must be implemented by subclassN(R(R((s/usr/lib64/python2.7/mailbox.pytiterkeys`scCst|jƒƒS(sReturn a list of keys.(tlistR,(R((s/usr/lib64/python2.7/mailbox.pytkeysdsccsEx>|jƒD]0}y||}Wntk r7q nX|Vq WdS(s%Return an iterator over all messages.N(R,R#(RR tvalue((s/usr/lib64/python2.7/mailbox.pyt itervalueshs  cCs |jƒS(N(R0(R((s/usr/lib64/python2.7/mailbox.pyt__iter__qscCst|jƒƒS(s,Return a list of messages. Memory intensive.(R-R0(R((s/usr/lib64/python2.7/mailbox.pytvaluestsccsKxD|jƒD]6}y||}Wntk r7q nX||fVq WdS(s.Return an iterator over (key, message) tuples.N(R,R#(RR R/((s/usr/lib64/python2.7/mailbox.pyt iteritemsxs  cCst|jƒƒS(s9Return a list of (key, message) tuples. Memory intensive.(R-R3(R((s/usr/lib64/python2.7/mailbox.pytitems�scCstdƒ‚dS(s9Return True if the keyed message exists, False otherwise.s&Method must be implemented by subclassN(R(RR ((s/usr/lib64/python2.7/mailbox.pythas_key…scCs |j|ƒS(N(R5(RR ((s/usr/lib64/python2.7/mailbox.pyt __contains__‰scCstdƒ‚dS(s*Return a count of messages in the mailbox.s&Method must be implemented by subclassN(R(R((s/usr/lib64/python2.7/mailbox.pyt__len__ŒscCs(x!|jƒD]}|j|ƒq WdS(sDelete all messages.N(R,R$(RR ((s/usr/lib64/python2.7/mailbox.pytclear�scCs4y||}Wntk r"|SX|j|ƒ|S(s3Delete the keyed message and return it, or default.(R#R$(RR R'tresult((s/usr/lib64/python2.7/mailbox.pytpop•s   cCs7x0|jƒD]}||j|ƒfSWtdƒ‚dS(s6Delete an arbitrary (key, message) pair and return it.sNo messages in mailboxN(R,R:R#(RR ((s/usr/lib64/python2.7/mailbox.pytpopitemžscCs t|dƒr|jƒ}n$t|dƒr<|jƒ}n|}t}x<|D]4\}}y|||From treadtsFrom s>From isInvalid message type: %sN(t isinstancetemailRRtStringIOt generatort GeneratortflattentseekRGtreplaceRtlineseptwritet_append_newlinetendswithtstrR<tNoneR>treadlinet startswitht TypeErrorttype( RRttargett mangle_from_tbuffertgentdatatlastlinetline((s/usr/lib64/python2.7/mailbox.pyt _dump_messageÉs<          "N(%t__name__t __module__t__doc__RVR>RRR!R"R$R%R(R&R)R+R*R,R.R0R1R2R3R4R5R6R7R8R:R;RBRCRDRERFR=RSRb(((s/usr/lib64/python2.7/mailbox.pyR(s@                         cBsûeZdZdZejed„Zd„Zd„Z d„Z d„Z d„Z d„Z d „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZdZd„Zd„Zd„Zd„ZRS(sA qmail-style Maildir mailbox.t:cCs tj||||ƒitjj|jdƒd6tjj|jdƒd6tjj|jdƒd6|_tjj|jƒs×|rÅtj|jdƒx9|jj ƒD]}tj|dƒq¨Wq×t |jƒ‚ni|_ idd6dd6|_ d|_ d|_dS(sInitialize a Maildir instance.ttmptnewtcuriÀigš™™™™™¹?N(RRRRtjoinRt_pathstexiststmkdirR2tNoSuchMailboxErrort_toct _toc_mtimest _last_readt _skewfactor(RtdirnameRRR((s/usr/lib64/python2.7/mailbox.pyR÷s  cCsÒ|jƒ}y|j||ƒWn.tk rP|jƒtj|jƒ‚nXt|ƒt|t ƒr¤|j ƒ}|j |j ƒ}||j kr°d}q°n d}d}tj j|jƒj|j ƒd}tj j|j|||ƒ}t|t ƒr4tj|jtj j|jƒ|jƒfƒnyLttdƒrltj|j|ƒtj|jƒntj|j|ƒWnKtk rÍ}tj|jƒ|jtjkrÇtd|ƒ‚q΂nX|S(s$Add message and return assigned key.RHRhitlinks$Name clash with existing message: %s(t _create_tmpRbt BaseExceptionRFRR!tnamet _sync_closeRIR t get_subdirtcolontget_infoRtbasenametsplitRjRtutimetgetatimetget_dateR<RttrenametOSErrorterrnotEEXISTtExternalClashError(RRttmp_filetsubdirtsuffixtuniqtdestte((s/usr/lib64/python2.7/mailbox.pyR s@      % % cCs,tjtjj|j|j|ƒƒƒdS(s=Remove the keyed message; raise KeyError if it doesn't exist.N(RR!RRjRt_lookup(RR ((s/usr/lib64/python2.7/mailbox.pyR!4scCsSy|j|ƒWn;tk r$n+tk rN}|jtjkrO‚qOnXdS(s'If the keyed message exists, remove it.N(R!R#R‚RƒtENOENT(RR R‹((s/usr/lib64/python2.7/mailbox.pyR$8s c Cs$|j|ƒ}|j|ƒ}|j|ƒ}t|tƒrE|}n|}tjj|ƒ}|j|krŒ|j|j|jƒd}nd}|j |ƒtjj |j |ƒ} tjj |j |||ƒ} t|tƒrtj | tjj | ƒ|jƒfƒntj| | ƒdS(s>Replace the keyed message; raise KeyError if it doesn't exist.iÿÿÿÿRHN(RŒRRIR RRRsRzR}R$RjRR~RR€R�( RR Rt old_subpathttemp_keyt temp_subpathtdominant_subpathR‡Rˆttmp_pathtnew_path((s/usr/lib64/python2.7/mailbox.pyR%Cs"    "cCsì|j|ƒ}ttjj|j|ƒdƒ}z+|jrN|j|ƒ}n t|ƒ}Wd|jƒXtjj |ƒ\}}|j |ƒ|j |kr½|j |j |j ƒdƒn|j tjjtjj|j|ƒƒƒ|S(s4Return a Message representation or raise a KeyError.trNiÿÿÿÿ(RŒtopenRRRjRRR RFR}t set_subdirRztset_infotset_datetgetmtime(RR tsubpathtftmsgR‡Rw((s/usr/lib64/python2.7/mailbox.pyR)^s!    +cCsJttjj|j|j|ƒƒdƒ}z|jƒSWd|jƒXdS(s3Return a string representation or raise a KeyError.R”N(R•RRRjRRŒRGRF(RR R›((s/usr/lib64/python2.7/mailbox.pyR+ps*cCs4ttjj|j|j|ƒƒdƒ}t|ƒS(s6Return a file-like representation or raise a KeyError.trb(R•RRRjRRŒt _ProxyFile(RR R›((s/usr/lib64/python2.7/mailbox.pyR*xs*ccsO|jƒx>|jD]3}y|j|ƒWntk rAqnX|VqWdS(sReturn an iterator over keys.N(t_refreshRoRŒR#(RR ((s/usr/lib64/python2.7/mailbox.pyR,}s  cCs|jƒ||jkS(s9Return True if the keyed message exists, False otherwise.(RŸRo(RR ((s/usr/lib64/python2.7/mailbox.pyR5‡s cCs|jƒt|jƒS(s*Return a count of messages in the mailbox.(RŸtlenRo(R((s/usr/lib64/python2.7/mailbox.pyR7Œs cCsdS(s"Write any pending changes to disk.N((R((s/usr/lib64/python2.7/mailbox.pyRC‘scCsdS(sLock the mailbox.N((R((s/usr/lib64/python2.7/mailbox.pyRD—scCsdS(s#Unlock the mailbox if it is locked.N((R((s/usr/lib64/python2.7/mailbox.pyRE›scCsdS(sFlush and close the mailbox.N((R((s/usr/lib64/python2.7/mailbox.pyRFŸscCs�g}xttj|jƒD]`}t|ƒdkr|ddkrtjjtjj|j|ƒƒr|j|dƒqqW|S(sReturn a list of folder names.iit.(RtlistdirRR RtisdirRjtappend(RR9tentry((s/usr/lib64/python2.7/mailbox.pyt list_folders£s "$cCs/ttjj|jd|ƒd|jdtƒS(s/Return a Maildir instance for the named folder.R¡RR(RRRRjRRR=(Rtfolder((s/usr/lib64/python2.7/mailbox.pyt get_folder¬s cCs…tjj|jd|ƒ}t|d|jƒ}tjj|dƒ}tjj|ƒs�tjtj|tj tj Bdƒƒn|S(s>Create a folder and return a Maildir instance representing it.R¡Rt maildirfolderi¶( RRRjRRRRlRFR•tO_CREATtO_WRONLY(RR§RR9tmaildirfolder_path((s/usr/lib64/python2.7/mailbox.pyt add_folder²s cCs¢tjj|jd|ƒ}xwtjtjj|dƒƒtjtjj|dƒƒD];}t|ƒdks|ddkrWtd|ƒ‚qWqWWxutj|ƒD]d}|dkr¦|dkr¦|dkr¦tjjtjj||ƒƒr¦td||fƒ‚q¦q¦Wx€tj|d t ƒD]i\}}}x*|D]"}tj tjj||ƒƒq:Wx*|D]"}tj tjj||ƒƒqgWq$Wtj |ƒd S( s-Delete the named folder, which must be empty.R¡RhRiiisFolder contains message(s): %sRgs%Folder contains subdirectory '%s': %sttopdownN( RRRjRR¢R t NotEmptyErrorR£twalkR=R!trmdir(RR§RR¥troottdirstfiles((s/usr/lib64/python2.7/mailbox.pyt remove_folder¼s #"$!%   $cCsƒtjƒ}xptjtjj|jdƒƒD]M}tjj|jd|ƒ}|tjj|ƒdkr.tj|ƒq.q.WdS(sDelete old files in "tmp".Rgi@úN(ttimeRR¢RRjRRR!(RtnowR¥R((s/usr/lib64/python2.7/mailbox.pytcleanÏs  (icCsItjƒ}tjƒ}d|kr9|jddƒ}nd|krZ|jddƒ}ndt|ƒt|ddƒtjƒtj|f}tj j |j d|ƒ}ytj |ƒWnvt k r4}|jtjkr.tjd7_yt|ƒSWq1t k r*}|jtjkr+‚q+q1Xq5‚nXtd |ƒ‚d S( s=Create a file in the tmp subdirectory and open and return it.t/s\057Rfs\072s%s.M%sP%sQ%s.%sig€„.ARgs&Name clash prevented file creation: %sN(R¶tsockett gethostnameRPtintRtgetpidRt_countRRjRtstatR‚RƒR�t_create_carefullyR„R…(RR·thostnameR‰RR‹((s/usr/lib64/python2.7/mailbox.pyRuÙs,    & cCs?tjƒ|jd|jkr‰t}xS|jD]H}tjj|j|ƒ}||j|krkt }n||j|RoR¢RjR£R}Rz(RtrefreshR‡tmtimeRR¥tpR‰((s/usr/lib64/python2.7/mailbox.pyRŸõs&    $cCs�y:tjjtjj|j|j|ƒƒr9|j|SWntk rMnX|jƒy|j|SWn!tk rŠtd|ƒ‚nXdS(s=Use TOC to return subpath for given key, or raise a KeyError.sNo message with key: %sN(RRRlRjRRoR#RŸ(RR ((s/usr/lib64/python2.7/mailbox.pyRŒs+   cCsot|dƒs!|jƒ|_nxGtrjy||jjƒSWq$tk rSdStk rfq$q$Xq$WdS(s0Return the next message in a one-time iteration.t _onetime_keysN(R<R,RÅR>tnextt StopIterationRVR#(R((s/usr/lib64/python2.7/mailbox.pyRÆ's   ( RcRdReRztrfc822RR>RRR!R$R%R)R+R*R,R5R7RCRDRERFR¦R¨R­RµR¸R¾RuRŸRŒRÆ(((s/usr/lib64/python2.7/mailbox.pyRòs6 )                $ t_singlefileMailboxcBs§eZdZded„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zdd„Zd„ZRS(sA single-file mailbox.cCs÷tj||||ƒyt|jdƒ}Wn…tk r³}|jtjkr}|rkt|jdƒ}q°t|jƒ‚q´|jtjtj fkr­t|jdƒ}q´‚nX||_ d|_ d|_ t|_t|_t|_d|_dS(s!Initialize a single-file mailbox.srb+swb+R�iN(RRR•RtIOErrorRƒR�RntEACCEStEROFSt_fileRVRot _next_keyR=t_pendingt _pending_synct_lockedt _file_length(RRRRR›R‹((s/usr/lib64/python2.7/mailbox.pyR7s$      cCsF|jƒ|j|ƒ|j|j<|jd7_t|_|jdS(s$Add message and return assigned key.i(RŒt_append_messageRoRÎR>RÐ(RR((s/usr/lib64/python2.7/mailbox.pyRNs   cCs$|j|ƒ|j|=t|_dS(s=Remove the keyed message; raise KeyError if it doesn't exist.N(RŒRoR>RÏ(RR ((s/usr/lib64/python2.7/mailbox.pyR!Xs  cCs0|j|ƒ|j|ƒ|j|Replace the keyed message; raise KeyError if it doesn't exist.N(RŒRÓRoR>RÏ(RR R((s/usr/lib64/python2.7/mailbox.pyR%^s ccs-|jƒx|jjƒD] }|VqWdS(sReturn an iterator over keys.N(RŒRoR.(RR ((s/usr/lib64/python2.7/mailbox.pyR,ds cCs|jƒ||jkS(s9Return True if the keyed message exists, False otherwise.(RŒRo(RR ((s/usr/lib64/python2.7/mailbox.pyR5js cCs|jƒt|jƒS(s*Return a count of messages in the mailbox.(RŒR Ro(R((s/usr/lib64/python2.7/mailbox.pyR7os cCs&|js"t|jƒt|_ndS(sLock the mailbox.N(RÑt _lock_fileRÍR>(R((s/usr/lib64/python2.7/mailbox.pyRDts  cCs&|jr"t|jƒt|_ndS(s#Unlock the mailbox if it is locked.N(RÑt _unlock_fileRÍR=(R((s/usr/lib64/python2.7/mailbox.pyREzs  c CsÊ|js/|jr+t|jƒt|_ndS|jjddƒ|jjƒ}||jkr|td|j|fƒ‚nt |j ƒ}y÷i}|j |ƒxÎt |j jƒƒD]·}|j |\}}|jj|ƒ|j|ƒ|jƒ}xOtrJ|jjtd||jjƒƒƒ}|dkr:Pn|j|ƒqüW||jƒf||<|j|ƒq·W|jƒ|_Wn$|jƒtj|jƒ‚nXt|ƒ|jjƒtj|j ƒj} tj|j| ƒytj|j|j ƒWnrtk rv} | jtj ksGtjdkrp| jtj!krptj|j ƒtj|j|j ƒqw‚nXt"|j dƒ|_||_ t|_t|_|j#rÆt$|jd tƒndS( s"Write any pending changes to disk.Niis4Size of mailbox file changed (expected %i, found %i)iRHtos2srb+tdotlock(%RÏRÐt _sync_flushRÍR=ROttellRÒR…t_create_temporaryRt_pre_mailbox_hooktsortedRoR.t_pre_message_hookR>RGtminRRt_post_message_hookRFRR!RwRxR¿tst_modetchmodR�R‚RƒR„RËR•RÑRÔ( Rtcur_lentnew_filetnew_tocR tstarttstopt new_startR]tmodeR‹((s/usr/lib64/python2.7/mailbox.pyRC€sd             !    cCsdS(s,Called before writing the mailbox to file f.N((RR›((s/usr/lib64/python2.7/mailbox.pyRÛÄscCsdS(s-Called before writing each message to file f.N((RR›((s/usr/lib64/python2.7/mailbox.pyRÝÈscCsdS(s,Called after writing each message to file f.N((RR›((s/usr/lib64/python2.7/mailbox.pyRßÌscCsAz|jƒWdz|jr*|jƒnWd|jjƒXXdS(sFlush and close the mailbox.N(RCRÑRERÍRF(R((s/usr/lib64/python2.7/mailbox.pyRFÐs  cCsb|jdkr|jƒn|dk r^y|j|SWq^tk rZtd|ƒ‚q^XndS(s'Return (start, stop) or raise KeyError.sNo message with key: %sN(RoRVt _generate_tocR#(RR ((s/usr/lib64/python2.7/mailbox.pyRŒÛs   cCsÑ|jjddƒ|jjƒ}t|jƒdkrT|j rT|j|jƒny3|j|jƒ|j|ƒ}|j |jƒWn$t k r­|jj |ƒ‚nX|jj ƒ|jjƒ|_ |S(s;Append message to mailbox and return (start, stop) offsets.ii(RÍRORÙR RoRÏRÛRÝt_install_messageRßRvttruncateRCRÒ(RRtbeforetoffsets((s/usr/lib64/python2.7/mailbox.pyRÓås  N(RcRdReRVR>RRR!R%R,R5R7RDRERCRÛRÝRßRFRŒRÓ(((s/usr/lib64/python2.7/mailbox.pyRÉ4s"        D    t _mboxMMDFcBs>eZdZeZd„Zed„Zed„Zd„Z RS(sAn mbox or MMDF mailbox.cCs•|j|ƒ\}}|jj|ƒ|jjƒjtjdƒ}|jj||jjƒƒ}|j |jtjdƒƒ}|j |dƒ|S(s4Return a Message representation or raise a KeyError.RHs i( RŒRÍRORWRPRRQRGRÙt_message_factorytset_from(RR RåRæt from_linetstringRœ((s/usr/lib64/python2.7/mailbox.pyR)scCsm|j|ƒ\}}|jj|ƒ|s;|jjƒn|jj||jjƒƒ}|jtjdƒS(s3Return a string representation or raise a KeyError.s ( RŒRÍRORWRGRÙRPRRQ(RR tfrom_RåRæRò((s/usr/lib64/python2.7/mailbox.pyR+ s cCsW|j|ƒ\}}|jj|ƒ|s;|jjƒnt|j|jjƒ|ƒS(s6Return a file-like representation or raise a KeyError.(RŒRÍRORWt _PartialFileRÙ(RR RóRåRæ((s/usr/lib64/python2.7/mailbox.pyR*s cCs/d}t|tƒri|jdƒri|jdƒ}|dkrZ|| }||d}q¯|}d}nFt|tƒr‹d|jƒ}n$t|tjj ƒr¯|j ƒ}n|dkr×dt j t j ƒƒ}n|jjƒ}|jj|tjƒ|j||j|jƒ|jjƒ}||fS(s1Format a message and blindly write to self._file.sFrom s iÿÿÿÿiRHsFrom MAILER-DAEMON %sN(RVRIRURXtfindt_mboxMMDFMessagetget_fromRJRRt get_unixfromR¶tasctimetgmtimeRÍRÙRRRRQRbt _mangle_from_(RRRñtnewlineRåRæ((s/usr/lib64/python2.7/mailbox.pyRês&    ( RcRdReR>RûR)R=R+R*Rê(((s/usr/lib64/python2.7/mailbox.pyRîüs  cBs;eZdZeZeZded„Zd„Zd„Z RS(sA classic mbox mailbox.cCs#t|_tj||||ƒdS(sInitialize an mbox mailbox.N(R RïRîR(RRRR((s/usr/lib64/python2.7/mailbox.pyR=s cCs|jtjƒdS(s,Called after writing each message to file f.N(RRRRQ(RR›((s/usr/lib64/python2.7/mailbox.pyRßBscCs\gg}}t}|jjdƒxðtr|jjƒ}|jjƒ}|jdƒrºt|ƒt|ƒkr¤|r”|j|tt j ƒƒq¤|j|ƒn|j|ƒt}q&|sô|rã|j|tt j ƒƒn |j|ƒPq&|t j kr t}q&t}q&Wt t t ||ƒƒƒ|_t|jƒ|_|jjƒ|_dS(s0Generate key-to-(start, stop) table of contents.isFrom N(R=RÍROR>RÙRWRXR R¤RRQtdictt enumeratetzipRoRÎRÒ(Rtstartststopstlast_was_emptytline_posRa((s/usr/lib64/python2.7/mailbox.pyRéFs0       N( RcRdReR>RûRSRVRRßRé(((s/usr/lib64/python2.7/mailbox.pyR4s  cBs8eZdZded„Zd„Zd„Zd„ZRS(sAn MMDF mailbox.cCs#t|_tj||||ƒdS(sInitialize an MMDF mailbox.N(R RïRîR(RRRR((s/usr/lib64/python2.7/mailbox.pyRks cCs|jdtjƒdS(s-Called before writing each message to file f.sN(RRRRQ(RR›((s/usr/lib64/python2.7/mailbox.pyRÝpscCs|jtjdtjƒdS(s,Called after writing each message to file f.sN(RRRRQ(RR›((s/usr/lib64/python2.7/mailbox.pyRßtscCsbgg}}|jjdƒd}xãtr|}|jjƒ}|jjƒ}|jdtjƒrõ|j|ƒx�trñ|}|jjƒ}|jjƒ}|dtjkrÑ|j|t tjƒƒPqv|dkrv|j|ƒPqvqvWq&|dkr&Pq&q&Wt t t ||ƒƒƒ|_ t |j ƒ|_|jjddƒ|jjƒ|_dS(s0Generate key-to-(start, stop) table of contents.isRHiN(RÍROR>RWRÙRXRRQR¤R RýRþRÿRoRÎRÒ(RRRtnext_posRRa((s/usr/lib64/python2.7/mailbox.pyRéxs2        N( RcRdReRVR>RRÝRßRé(((s/usr/lib64/python2.7/mailbox.pyRhs   cBsÚeZdZded„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sAn MH mailbox.cCs¥tj||||ƒtjj|jƒs˜|r†tj|jdƒtjtjtjj |jdƒtj tj Btj Bdƒƒq˜t |jƒ‚nt|_dS(sInitialize an MH instance.iÀs .mh_sequencesi€N(RRRRRlRRmRFR•RjRªtO_EXCLR«RnR=RÑ(RRRR((s/usr/lib64/python2.7/mailbox.pyR˜s!!cCs:|jƒ}t|ƒdkr'd}nt|ƒd}tjj|jt|ƒƒ}t|ƒ}t }z¸|j r€t |ƒnz„y|j ||ƒWnGt k rà|j r½t|ƒnt|ƒt}tj|ƒ‚nXt|tƒr|j||ƒnWd|j rt|ƒnXWd|s5t|ƒnX|S(s$Add message and return assigned key.iiN(R.R tmaxRRRjRRURÀR=RÑRÔRbRvRÕRxR>R!RIR t_dump_sequences(RRR.tnew_keyR“R›tclosed((s/usr/lib64/python2.7/mailbox.pyR¤s6           cCsŠtjj|jt|ƒƒ}yt|dƒ}Wn;tk rn}|jtjkrht d|ƒ‚q†‚nX|j ƒtj |ƒdS(s=Remove the keyed message; raise KeyError if it doesn't exist.srb+sNo message with key: %sN( RRRjRRUR•RÊRƒR�R#RFR!(RR RR›R‹((s/usr/lib64/python2.7/mailbox.pyR!Æs cCstjj|jt|ƒƒ}yt|dƒ}Wn;tk rn}|jtjkrht d|ƒ‚qo‚nXz�|j rˆt |ƒnzYtj tj|tj tjBƒƒ|j||ƒt|tƒrà|j||ƒnWd|j rút|ƒnXWdt|ƒXdS(s>Replace the keyed message; raise KeyError if it doesn't exist.srb+sNo message with key: %sN(RRRjRRUR•RÊRƒR�R#RÑRÔRFR«tO_TRUNCRbRIR RRÕRx(RR RRR›R‹((s/usr/lib64/python2.7/mailbox.pyR%Ôs$  # cCs1y^|jr6ttjj|jt|ƒƒdƒ}n'ttjj|jt|ƒƒdƒ}Wn;tk r›}|jtj kr•t d|ƒ‚qœ‚nXzD|jrµt |ƒnzt |ƒ}Wd|jrÞt |ƒnXWd|jƒXx<|jƒjƒD](\}}||kr|j|ƒqqW|S(s4Return a Message representation or raise a KeyError.sr+R”sNo message with key: %sN(RÑR•RRRjRRURÊRƒR�R#RÔR RÕRFt get_sequencesR3t add_sequence(RR R›R‹RœRwtkey_list((s/usr/lib64/python2.7/mailbox.pyR)ìs( *+     cCsðy^|jr6ttjj|jt|ƒƒdƒ}n'ttjj|jt|ƒƒdƒ}Wn;tk r›}|jtj kr•t d|ƒ‚qœ‚nXzB|jrµt |ƒnz|j ƒSWd|jrÜt |ƒnXWd|jƒXdS(s3Return a string representation or raise a KeyError.sr+R”sNo message with key: %sN(RÑR•RRRjRRURÊRƒR�R#RÔRGRÕRF(RR R›R‹((s/usr/lib64/python2.7/mailbox.pyR+s  *+   cCssy+ttjj|jt|ƒƒdƒ}Wn;tk rh}|jtjkrbt d|ƒ‚qi‚nXt |ƒS(s6Return a file-like representation or raise a KeyError.R�sNo message with key: %s( R•RRRjRRURÊRƒR�R#Rž(RR R›R‹((s/usr/lib64/python2.7/mailbox.pyR*s+cCs&ttd„tj|jƒDƒƒƒS(sReturn an iterator over keys.css'|]}|jƒrt|ƒVqdS(N(tisdigitR¼(t.0R¥((s/usr/lib64/python2.7/mailbox.pys +s(titerRÜRR¢R(R((s/usr/lib64/python2.7/mailbox.pyR,)scCs(tjjtjj|jt|ƒƒƒS(s9Return True if the keyed message exists, False otherwise.(RRRlRjRRU(RR ((s/usr/lib64/python2.7/mailbox.pyR5.scCstt|jƒƒƒS(s*Return a count of messages in the mailbox.(R R-R,(R((s/usr/lib64/python2.7/mailbox.pyR72scCsJ|jsFttjj|jdƒdƒ|_t|jƒt|_ndS(sLock the mailbox.s .mh_sequencessrb+N( RÑR•RRRjRRÍRÔR>(R((s/usr/lib64/python2.7/mailbox.pyRD6s $ cCs9|jr5t|jƒt|jƒ|`t|_ndS(s#Unlock the mailbox if it is locked.N(RÑRÕRÍRxR=(R((s/usr/lib64/python2.7/mailbox.pyRE=s    cCsdS(s&Write any pending changes to the disk.N((R((s/usr/lib64/python2.7/mailbox.pyRCEscCs|jr|jƒndS(sFlush and close the mailbox.N(RÑRE(R((s/usr/lib64/python2.7/mailbox.pyRFIs cCs[g}xNtj|jƒD]:}tjjtjj|j|ƒƒr|j|ƒqqW|S(sReturn a list of folder names.(RR¢RRR£RjR¤(RR9R¥((s/usr/lib64/python2.7/mailbox.pyR¦Ns $cCs+ttjj|j|ƒd|jdtƒS(s+Return an MH instance for the named folder.RR(RRRRjRRR=(RR§((s/usr/lib64/python2.7/mailbox.pyR¨VscCs%ttjj|j|ƒd|jƒS(s:Create a folder and return an MH instance representing it.R(RRRRjRR(RR§((s/usr/lib64/python2.7/mailbox.pyR­[scCsˆtjj|j|ƒ}tj|ƒ}|dgkrUtjtjj|dƒƒn"|gkrdntd|jƒ‚tj|ƒdS(s-Delete the named folder, which must be empty.s .mh_sequencessFolder not empty: %sN(RRRjRR¢R!R¯R±(RR§Rtentries((s/usr/lib64/python2.7/mailbox.pyRµ`s c Csmi}ttjj|jdƒdƒ}z4t|jƒƒ}x|D]}yã|jdƒ\}}tƒ}xo|jƒD]a}|jƒrŸ|j t |ƒƒqwd„|jdƒDƒ\} } |j t | | dƒƒqwWgt |ƒD]} | |kré| ^qé||zst-iis"Invalid sequence specification: %sN(R•RRRjRtsetR.R}RRR¼RBtrangeRÜR t ValueErrort FormatErrortrstripRF( RtresultsR›tall_keysRaRwtcontentsR.tspecRåRæR ((s/usr/lib64/python2.7/mailbox.pyR ls,!     cCsettjj|jdƒdƒ}z2tjtj|jtjtjBƒƒx|j ƒD]÷\}}t |ƒdkr{qWn|j d|ƒd }t }x†tt|ƒƒD]r}|d|krà|st}|j dƒqn7|rt }|j d||fƒn|j d|ƒ|}q«W|rA|j t|ƒd ƒqW|j d ƒqWWWd t|ƒXd S( s:Set sequences using the given name-to-key-list dictionary.s .mh_sequencessr+is%s:iRs%s %ss %ss N(R•RRRjRRFRwR«R R3R RRRVR=RÜRR>RURx(Rt sequencesR›RwR.tprevt completingR ((s/usr/lib64/python2.7/mailbox.pyt set_sequences‡s.!& c Cs¬|jƒ}d}g}x|jƒD]ù}|d|kr|j||dfƒttdƒrÍtjtjj|jt |ƒƒtjj|jt |dƒƒƒtj tjj|jt |ƒƒƒqtj tjj|jt |ƒƒtjj|jt |dƒƒƒn|d7}q%W|d|_ t |ƒdkrEdSxS|jƒD]E\}}x6|D].\}}||kre|||j|ƒRRR!R%R)R+R*R,R5R7RDRERCRFR¦R¨R­RµR R R%R(((s/usr/lib64/python2.7/mailbox.pyR•s. "                 cBs•eZdZedƒZded„Zd „Zd „Z d „Z d „Z d „Z d„Z d„Zd„Zd„Zd„Zd„Zd„ZRS(sAn Rmail-style Babyl mailbox.tunseentdeletedtfiledtansweredt forwardedteditedtresentcCs#tj||||ƒi|_dS(sInitialize a Babyl mailbox.N(RÉRt_labels(RRRR((s/usr/lib64/python2.7/mailbox.pyRÒscCs;tj||ƒ}t|tƒr7|jƒ|j|Replace the keyed message; raise KeyError if it doesn't exist.N(RÉR%RIR R1R0(RR R((s/usr/lib64/python2.7/mailbox.pyR%äsc Cs}|j|ƒ\}}|jj|ƒ|jjƒtjƒ}xXtr˜|jjƒ}|dtjksu|dkryPn|j|j tjdƒƒqAWtjƒ}xTtrû|jjƒ}|tjksØ|dkrÜPn|j|j tjdƒƒq¨W|jj ||jj ƒƒj tjdƒ}t |j ƒ|ƒ}|j|j ƒƒ||jkry|j|j|ƒn|S(s4Return a Message representation or raise a KeyError.s *** EOOH ***RHs (RŒRÍRORWRKR>RRQRRRPRGRÙR tgetvaluet set_visibleR0t set_labels( RR RåRætoriginal_headersRatvisible_headerstbodyRœ((s/usr/lib64/python2.7/mailbox.pyR)ês,       % cCs |j|ƒ\}}|jj|ƒ|jjƒtjƒ}xXtr˜|jjƒ}|dtjksu|dkryPn|j|j tjdƒƒqAWx8trÓ|jjƒ}|tjksÌ|dkrœPqœqœW|j ƒ|jj ||jj ƒƒj tjdƒS(s3Return a string representation or raise a KeyError.s *** EOOH ***RHs ( RŒRÍRORWRKR>RRQRRRPR2RGRÙ(RR RåRæR5Ra((s/usr/lib64/python2.7/mailbox.pyR+s       %cCs%tj|j|ƒjdtjƒƒS(s6Return a file-like representation or raise a KeyError.s (RKR+RPRRQ(RR ((s/usr/lib64/python2.7/mailbox.pyR*scCsT|jƒtƒ}x$|jjƒD]}|j|ƒq#W|j|jƒt|ƒS(s4Return a list of user-defined labels in the mailbox.(RŒRR0R2RBtdifference_updatet_special_labelsR-(Rtlabelst label_list((s/usr/lib64/python2.7/mailbox.pyR1s   c Csõgg}}|jjdƒd}g}x[tr†|}|jjƒ}|jjƒ}|dtjkrt|ƒt|ƒkrž|j|ttjƒƒn|j|ƒg|jjƒdj dƒD]$}|j ƒdkrÈ|j ƒ^qÈ}|j|ƒq,|dks!|dtjkrYt|ƒt|ƒkrƒ|j|ttjƒƒqƒq,|dkr,|j|ttjƒƒPq,q,Wt t t ||ƒƒƒ|_t t |ƒƒ|_t|jƒ|_|jjddƒ|jjƒ|_dS( s0Generate key-to-(start, stop) table of contents.is it,RHsiN(RÍROR>RWRÙRRQR R¤R}tstripRýRþRÿRoR0RÎRÒ( RRRRt label_listsRRatlabelR:((s/usr/lib64/python2.7/mailbox.pyRé$s6    $  cCs9|jdtjtjdj|jƒƒtjfƒdS(s,Called before writing the mailbox to file f.s(BABYL OPTIONS:%sVersion: 5%sLabels:%s%sR<N(RRRRQRjR1(RR›((s/usr/lib64/python2.7/mailbox.pyRÛBs cCs|jdtjƒdS(s-Called before writing each message to file f.s N(RRRRQ(RR›((s/usr/lib64/python2.7/mailbox.pyRÝHscCs|jtjdƒdS(s,Called after writing each message to file f.sN(RRRRQ(RR›((s/usr/lib64/python2.7/mailbox.pyRßLscCs,|jjƒ}t|tƒrñg}g}x@|jƒD]2}||jkr\|j|ƒq7|j|ƒq7W|jjdƒx"|D]}|jjd|ƒq„W|jjdƒx&|D]}|jjd|dƒq¹W|jjtj ƒn|jjdtj ƒt|t j j ƒrt j ƒ}t jj|tdƒ}|j|ƒ|jdƒxQtr®|jƒ}|jj|jdtj ƒƒ|dks§|d kr^Pq^q^W|jjd tj ƒt|tƒrct j ƒ} t jj| tdƒ} | j|jƒƒxµtr_| jƒ}|jj|jdtj ƒƒ|dksX|d krPqqWna|jdƒxQtrÃ|jƒ}|jj|jdtj ƒƒ|dks¼|d krsPqsqsWxLtr|jd ƒ} | d krìPn|jj| jdtj ƒƒqÇWnt|tƒr|jd ƒd } | d dkrÇ|jj|| jdtj ƒƒ|jjd tj ƒ|jj|| jdtj ƒƒ|jj|| jdtj ƒƒq|jjd tj tj ƒ|jj|jdtj ƒƒn t|dƒrý|jƒ} t}x„tr®|jƒ}|jj|jdtj ƒƒ|dkst|d kr+|r§t}|jjd tj ƒ|j| ƒq«Pq+q+Wxatrù|jd ƒ} | d kr×Pn|jj| jdtj ƒƒq²Wntdt|ƒƒ‚|jjƒ}||fS(s0Write message contents and return (start, stop).t1s, s,,t R<s1,,is RHs *** EOOH ***is iiÿÿÿÿRWsInvalid message type: %s(RÍRÙRIR R1R9R¤RRRRQRJRRRKRLRMR=RNROR>RWRPt get_visibleRGRURõR<RYRZ(RRRåtspecial_labelsR:R?t orig_buffertorig_generatorRat vis_buffert vis_generatorR]t body_startt original_post first_passRæ((s/usr/lib64/python2.7/mailbox.pyRêPsž                &  "     &(R)R*R+R,R-R.R/N(RcRdRet frozensetR9RVR>RRR!R%R)R+R*R1RéRÛRÝRßRê(((s/usr/lib64/python2.7/mailbox.pyRÌs            cBs,eZdZdd„Zd„Zd„ZRS(s0Message with mailbox-format-specific properties.cCsÙt|tjjƒrM|jtj|ƒƒt|tƒrÕ|j|ƒqÕnˆt|tƒru|jtj |ƒƒn`t |dƒr�|jtj |ƒƒn8|dkr¿tjjj |ƒntdt|ƒƒ‚dS(sInitialize a Message instance.RGsInvalid message type: %sN(RIRJRRt_become_messagetcopytdeepcopyt _explain_toRUtmessage_from_stringR<tmessage_from_fileRVRRYRZ(RR((s/usr/lib64/python2.7/mailbox.pyR¬s cCs)x"d D]}|j||j|ntdt|ƒƒ‚dS(s;Copy Maildir-specific state to message insofar as possible.tStRRitOtTtDtFtAs MAILER-DAEMONR)trepliedtflaggedR*R,tPR-s$Cannot convert to specified type: %sN(RIR R`R^R–RyR˜R€RöRRbRðR¶RúR R R t add_labelRRYRZ(RRR_((s/usr/lib64/python2.7/mailbox.pyROsN    "       N(RcRdReRVRRyR–R^R`RbRcR€R˜R{R—RO(((s/usr/lib64/python2.7/mailbox.pyR És           RöcBs\eZdZd d„Zd„Zd d„Zd„Zd„Zd„Z d„Z d„Z RS( s/Message with mbox- or MMDF-specific properties.cCsw|jdtƒt|tjjƒrc|jƒ}|dk rc|jdƒrc|j|dƒqcntj ||ƒdS(s'Initialize an mboxMMDFMessage instance.s MAILER-DAEMONsFrom iN( RðR>RIRJRRRøRVRXR(RRtunixfrom((s/usr/lib64/python2.7/mailbox.pyR7s  cCs|jS(s Return contents of "From " line.(t_from(R((s/usr/lib64/python2.7/mailbox.pyR÷@scCsN|dk rA|tkr'tjƒ}n|dtj|ƒ7}n||_dS(s>Set "From " line, formatting and appending time_ if specified.RAN(RVR>R¶RúRùRs(RRóttime_((s/usr/lib64/python2.7/mailbox.pyRðDs   cCs |jddƒ|jddƒS(s*Return as a string the flags that are set.tStatusRHsX-Status(R((R((s/usr/lib64/python2.7/mailbox.pyR^LscCst|ƒ}d \}}x4d D],}||kr||7}|j|ƒqqWx4d D],}||krV||7}|j|ƒqVqVW|djt|ƒƒ7}y|jd|ƒWn!tk rÖ|jd|ƒnXy|jd|ƒWn!tk r|jd|ƒnXd S( s)Set the given flags and unset all others.RHRhRiRkRlRmRusX-StatusN(RHRH(RhRi(RkRlRm(RR!RjRÜtreplace_headerR#t add_header(RR_t status_flagst xstatus_flagsRa((s/usr/lib64/python2.7/mailbox.pyR`Ps&          cCs0|jdjt|jƒƒt|ƒBƒƒdS(s.Set the given flag(s) without changing others.RHN(R`RjRR^(RRa((s/usr/lib64/python2.7/mailbox.pyRbfscCsKd|ksd|krG|jdjt|jƒƒt|ƒƒƒndS(s7Unset the given string flag(s) without changing others.RusX-StatusRHN(R`RjRR^(RRa((s/usr/lib64/python2.7/mailbox.pyRcjscCs�t|tƒrt|jƒƒ}d|kr=|jdƒnd|krY|jdƒnd|kru|jdƒnd|kr‘|jdƒnd|kr­|jdƒn|d =|d =d j|jƒjƒd ƒ}y&|j t j t j |d ƒƒƒWq‰ttfk rq‰Xnlt|tƒrU|j|jƒƒ|j|jƒƒn4t|tƒrÛt|jƒƒ}d|kr’|jdƒnd|kr®|jdƒnd|krÊ|jdƒn|d =|d =n®t|tƒrat|jƒƒ}d|kr|jdƒnd|kr4|jdƒnd|krP|jdƒn|d =|d =n(t|tƒrsntdt|ƒƒ‚dS(sACopy mbox- or MMDF-specific state to message insofar as possible.RiRiRlRmRhRgRkRjtstatussx-statusRAiûÿÿÿs%a %b %d %H:%M:%S %YR)RnRoR*R,s$Cannot convert to specified type: %sN(RIR RR^R–RbRjR÷R}R˜tcalendarttimegmR¶tstrptimeRt OverflowErrorRöR`RðR R R RqRRYRZ(RRR_t maybe_date((s/usr/lib64/python2.7/mailbox.pyROos^             N( RcRdReRVRR÷RðR^R`RbRcRO(((s/usr/lib64/python2.7/mailbox.pyRö4s      cBseZdZRS(s&Message with mbox-specific properties.(RcRdRe(((s/usr/lib64/python2.7/mailbox.pyR £scBsGeZdZdd„Zd„Zd„Zd„Zd„Zd„Z RS(s$Message with MH-specific properties.cCsg|_tj||ƒdS(s!Initialize an MHMessage instance.N(t _sequencesRR(RR((s/usr/lib64/python2.7/mailbox.pyRªs cCs|jS(s4Return a list of sequences that include the message.(R€(R((s/usr/lib64/python2.7/mailbox.pyR ¯scCst|ƒ|_dS(s3Set the list of sequences that include the message.N(R-R€(RR((s/usr/lib64/python2.7/mailbox.pyR ³scCsNt|tƒr4||jkrJ|jj|ƒqJntdt|ƒƒ‚dS(s8Add sequence to list of sequences including the message.ssequence must be a string: %sN(RIRUR€R¤RYRZ(RR(((s/usr/lib64/python2.7/mailbox.pyR ·scCs,y|jj|ƒWntk r'nXdS(sARemove sequence from the list of sequences including the message.N(R€R!R(RR(((s/usr/lib64/python2.7/mailbox.pytremove_sequence¿s cCsÕt|tƒr’t|jƒƒ}d|kr=|jdƒn|jdƒ|jdƒd|krs|jdƒnd|krÑ|jdƒqÑn?t|tƒrt|jƒƒ}d|krÏ|jdƒn |jd ƒd|krø|jdƒnd|krÑ|jd ƒqÑnºt|tƒrMx¨|jƒD]}|j|ƒq3Wn„t|t ƒr©t|jƒƒ}d|krŠ|j dƒnd|krÑ|j d ƒqÑn(t|t ƒr»nt d t |ƒƒ‚d S(s6Copy MH-specific state to message insofar as possible.R)RiRgRoRlRnRhtRORiRmR,s$Cannot convert to specified type: %sN(RIR RR R–RbRöR R R RqRRYRZ(RRRR(((s/usr/lib64/python2.7/mailbox.pyROÆs@           N( RcRdReRVRR R R R�RO(((s/usr/lib64/python2.7/mailbox.pyR §s     cBsbeZdZd d„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z RS( s'Message with Babyl-specific properties.cCs)g|_tƒ|_tj||ƒdS(s#Initialize a BabylMessage instance.N(R0Rt_visibleR(RR((s/usr/lib64/python2.7/mailbox.pyRðs  cCs|jS(s'Return a list of labels on the message.(R0(R((s/usr/lib64/python2.7/mailbox.pyR1öscCst|ƒ|_dS(s&Set the list of labels on the message.N(R-R0(RR:((s/usr/lib64/python2.7/mailbox.pyR4úscCsNt|tƒr4||jkrJ|jj|ƒqJntdt|ƒƒ‚dS(s+Add label to list of labels on the message.slabel must be a string: %sN(RIRUR0R¤RYRZ(RR?((s/usr/lib64/python2.7/mailbox.pyRqþscCs,y|jj|ƒWntk r'nXdS(s4Remove label from the list of labels on the message.N(R0R!R(RR?((s/usr/lib64/python2.7/mailbox.pyt remove_labels cCs t|jƒS(s3Return a Message representation of visible headers.(RRƒ(R((s/usr/lib64/python2.7/mailbox.pyRB scCst|ƒ|_dS(s2Set the Message representation of visible headers.N(RRƒ(Rtvisible((s/usr/lib64/python2.7/mailbox.pyR3scCsŽxG|jjƒD]6}||kr<|jj|||ƒq|j|=qWx=dD]5}||krQ||jkrQ|||j|t|dƒr:t|jdƒr1|jjƒn|`ndS(sClose the file.RÍRFN(R<RÍRF(R((s/usr/lib64/python2.7/mailbox.pyRF{scCsJ|dkrd}n|jj|jƒ||ƒ}|jjƒ|_|S(s"Read size bytes using read_method.iÿÿÿÿN(RVRÍROR�RÙ(RR�t read_methodR9((s/usr/lib64/python2.7/mailbox.pyR�‚s    N( RcRdReRVRRGRWR’R1RÙRORFR�(((s/usr/lib64/python2.7/mailbox.pyRžNs       RôcBsDeZdZddd„Zd„Zdd„Zd„Zd„ZRS(s&A read-only wrapper of part of a file.cCs)tj|||ƒ||_||_dS(sInitialize a _PartialFile.N(RžRt_startt_stop(RR›RåRæ((s/usr/lib64/python2.7/mailbox.pyR�s cCstj|ƒ|jS(s*Return the position with respect to start.(RžRÙR–(R((s/usr/lib64/python2.7/mailbox.pyRÙ•sicCsY|dkr!|j|_d}n!|dkrB|j|_d}ntj|||ƒdS(s8Change position, possibly with respect to start or stop.iiiN(R–R�R—RžRO(RR“R”((s/usr/lib64/python2.7/mailbox.pyRO™s      cCs`|j|j}|dkr dS|dksD|dksD||krM|}ntj|||ƒS(s;Read size bytes using read_method, honoring start and stop.iRHN(R—R�RVRžR�(RR�R•t remaining((s/usr/lib64/python2.7/mailbox.pyR�£s  $ cCst|dƒr|`ndS(NRÍ(R<RÍ(R((s/usr/lib64/python2.7/mailbox.pyRF¬sN( RcRdReRVRRÙROR�RF(((s/usr/lib64/python2.7/mailbox.pyRôŒs   cCst}yµtr€ytj|tjtjBƒWq€tk r|}|jtjtjtj fkrvt d|j ƒ‚q}‚q€Xn|rºy!t |j dƒ}|j ƒWn5tk rÞ}|jtjtj fkrØdS‚nXyfttdƒr$tj|j |j dƒt}tj|j ƒn tj|j |j dƒt}Wqºtk r¶}|jtjksŠtj dkr°|jtjkr°tj|j ƒt d|j ƒ‚q·‚qºXnWnCtrÝtj|tjƒn|rútj|j dƒn‚nXdS(s(Lock file f using lockf and dot locking.slockf: lock unavailable: %ss.lockNRtRÖsdot lock unavailable: %s(R=tfcntltlockftLOCK_EXtLOCK_NBRÊRƒtEAGAINRËRÌR…RwRÚRFR<RRtR>R!R�R‚R„R!tLOCK_UN(R›R×t dotlock_doneR‹tpre_lock((s/usr/lib64/python2.7/mailbox.pyRÔ³sL!  !cCsPtrtj|tjƒntjj|jdƒrLtj|jdƒndS(s*Unlock file f using lockf and dot locking.s.lockN(R™RšRžRRRlRwR!(R›((s/usr/lib64/python2.7/mailbox.pyRÕàscCsLtj|tjtjBtjBdƒ}zt|dƒSWdtj|ƒXdS(sCCreate a file if it doesn't exist and open for reading and writing.i¶srb+N(RR•RªRtO_RDWRRF(Rtfd((s/usr/lib64/python2.7/mailbox.pyRÀçs&cCs2td|ttjƒƒtjƒtjƒfƒS(sBCreate a temp file based on path and open for reading and writing.s %s.%s.%s.%s(RÀR¼R¶RºR»RR½(R((s/usr/lib64/python2.7/mailbox.pyRÚïs cCs3|jƒttdƒr/tj|jƒƒndS(s0Ensure changes to file f are physically on disk.tfsyncN(RCR<RR£tfileno(R›((s/usr/lib64/python2.7/mailbox.pyRØõs cCst|ƒ|jƒdS(s:Close file f, ensuring all changes are physically on disk.N(RØRF(R›((s/usr/lib64/python2.7/mailbox.pyRxûs t_MailboxcBs)eZejd„Zd„Zd„ZRS(cCs||_d|_||_dS(Ni(tfptseekpR(RR¦R((s/usr/lib64/python2.7/mailbox.pyRs  cCst|jdƒS(N(RRÆRV(R((s/usr/lib64/python2.7/mailbox.pyR1 scCsªx‹|jj|jƒy|jƒWn$tk rJ|jjƒ|_dSX|jjƒ}|jƒ|jjƒ|_}||krPqqW|jt |j||ƒƒS(N( R¦ROR§t _search_starttEOFErrorRÙRVt _search_endRRô(RRåRæ((s/usr/lib64/python2.7/mailbox.pyRÆs   (RcRdRÈRRR1RÆ(((s/usr/lib64/python2.7/mailbox.pyR¥s cBs>eZd„Zd„ZdZdZd„Zd„ZeZ RS(cCskxd|jjƒ}|jjƒ}|s0t‚n|d dkr|j|ƒr|jj|ƒdSqWdS(NisFrom (R¦RÙRWR©t_isrealfromlineRO(RRŽRa((s/usr/lib64/python2.7/mailbox.pyR¨!s cCss|jjƒx_|jjƒ}|jjƒ}|s8dS|d dkr|j|ƒr|jj|ƒdSqWdS(NisFrom (R¦RWRÙR«RO(RRŽRa((s/usr/lib64/python2.7/mailbox.pyRª+s saFrom \s*[^\s]+\s+\w\w\w\s+\w\w\w\s+\d?\d\s+\d?\d:\d\d(:\d\d)?(\s+[^\s]+)?\s+\d\d\d\d\s*[^\s]*\s*$cCs=|js-ddl}|j|jƒ|_n|jj|ƒS(Niÿÿÿÿ(t_regexptretcompilet_fromlinepatterntmatch(RRaR­((s/usr/lib64/python2.7/mailbox.pyt_strict_isrealfromlineUs  cCstS(N(R>(RRa((s/usr/lib64/python2.7/mailbox.pyt_portable_isrealfromline[sN( RcRdR¨RªR¯RVR¬R±R²R«(((s/usr/lib64/python2.7/mailbox.pyRs $  cBseZejZRS((RcRdRR²R«(((s/usr/lib64/python2.7/mailbox.pyRascBseZd„Zd„ZRS(cCs=x6|jjƒ}|s!t‚n|d dkrdSqWdS(Nis (R¦RWR©(RRa((s/usr/lib64/python2.7/mailbox.pyR¨gs  cCsSxL|jjƒ}|jjƒ}|s+dS|dkr|jj|ƒdSqWdS(Ns (R¦RÙRWRO(RRŽRa((s/usr/lib64/python2.7/mailbox.pyRªos (RcRdR¨Rª(((s/usr/lib64/python2.7/mailbox.pyRes cBs)eZejd„Zd„Zd„ZRS(cCs�ddl}|jdƒ}||_tj|jƒ}t|j|ƒ}tt|ƒ}|j ƒtt |ƒ|_ |j j ƒ||_ dS(Niÿÿÿÿs ^[1-9][0-9]*$(R­R®RsRR¢tfilterR°tmaptlongtsortRUtboxestreverseR(RRsRR­tpatR-((s/usr/lib64/python2.7/mailbox.pyR|s    cCst|jdƒS(N(RRÆRV(R((s/usr/lib64/python2.7/mailbox.pyR1ŒscCst|js dS|jjƒ}ttjj|j|ƒƒ}|j|ƒ}y ||_ Wnt t fk ronX|S(N( R·RVR:R•RRRjRsRt _mh_msgnotAttributeErrorRY(RtfnR¦Rœ((s/usr/lib64/python2.7/mailbox.pyRÆ�s  (RcRdRÈRRR1RÆ(((s/usr/lib64/python2.7/mailbox.pyRzs cBseZd„Zd„ZRS(cCs9x2|jjƒ}|s!t‚n|dkrdSqWdS(Ns *** EOOH *** (R¦RWR©(RRa((s/usr/lib64/python2.7/mailbox.pyR¨žs   cCs_xX|jjƒ}|jjƒ}|s+dS|dksC|dkr|jj|ƒdSqWdS(Ns s(R¦RÙRWRO(RRŽRa((s/usr/lib64/python2.7/mailbox.pyRª¦s(RcRdR¨Rª(((s/usr/lib64/python2.7/mailbox.pyRœs tErrorcBseZdZRS(s"Raised for module-specific errors.(RcRdRe(((s/usr/lib64/python2.7/mailbox.pyR½³sRncBseZdZRS(s:The specified mailbox does not exist and won't be created.(RcRdRe(((s/usr/lib64/python2.7/mailbox.pyRn¶sR¯cBseZdZRS(s>The specified mailbox is not empty and deletion was requested.(RcRdRe(((s/usr/lib64/python2.7/mailbox.pyR¯¹sR…cBseZdZRS(s)Another process caused an action to fail.(RcRdRe(((s/usr/lib64/python2.7/mailbox.pyR…¼sRcBseZdZRS(s)A file appears to have an invalid format.(RcRdRe(((s/usr/lib64/python2.7/mailbox.pyR¿s(<RetsysRR¶R{RºRƒRMRJt email.messagetemail.generatorRKtplatformt ImportErrorR™RVtwarningstcatch_warningst py3kwarningtfilterwarningstDeprecationWarningRÈt__all__RRRÉRîRRRRRRR RöR R R R RžRôR>RÔRÕRÀRÚRØRxR¥RRRRRt ExceptionR½RnR¯R…R(((s/usr/lib64/python2.7/mailbox.pyts~                     ÊÿCÈ84-ÿ8Ý koF]>' -     B"