Hacked By AnonymousFox

Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/mailbox.cpython-33.pyc

�
��f�4c@sTdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z	ddlZ	ddlZddl
Z
y(ejdkr�e�nddlZWnek
r�eZYnXdddddd	d
ddd
ddgZejjd�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGdd�de�ZGdd�de�ZGdd
�d
e	jj�ZGdd�de�ZGdd�de�Z Gdd�de �Z!Gd d
�d
e�Z"Gd!d�de�Z#Gd"d�de �Z$Gd#d$�d$�Z%Gd%d&�d&e%�Z&e'd'd(�Z(d)d*�Z)d+d,�Z*d-d.�Z+d/d0�Z,d1d2�Z-Gd3d4�d4e.�Z/Gd5d6�d6e/�Z0Gd7d8�d8e/�Z1Gd9d:�d:e/�Z2Gd;d<�d<e/�Z3dS(=uDRead/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.iNuos2emxuMailboxuMaildirumboxuMHuBabyluMMDFuMessageuMaildirMessageumboxMessageu	MHMessageuBabylMessageuMMDFMessageuasciicBs�|EeZdZdZd@dAdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zd@dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd@d.d/�Zd0d1�Zd@d2d3�Zd4d5�Zd6d7�Z d8d9�Z!d:d;�Z"d<d=�Z#dBZ%dBd>d?�Z&d@S(CuMailboxu*A group of messages in a particular place.cCs.tjjtjj|��|_||_dS(uInitialize a Mailbox instance.N(uosupathuabspathu
expanduseru_pathu_factory(uselfupathufactoryucreate((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__'s!uMailbox.__init__cCstd��dS(u$Add message and return assigned key.u&Method must be implemented by subclassN(uNotImplementedError(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuadd,suMailbox.addcCstd��dS(u=Remove the keyed message; raise KeyError if it doesn't exist.u&Method must be implemented by subclassN(uNotImplementedError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremove0suMailbox.removecCs|j|�dS(N(uremove(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__delitem__4suMailbox.__delitem__cCs*y|j|�Wntk
r%YnXdS(u'If the keyed message exists, remove it.N(uremoveuKeyError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyudiscard7s
uMailbox.discardcCstd��dS(u>Replace the keyed message; raise KeyError if it doesn't exist.u&Method must be implemented by subclassN(uNotImplementedError(uselfukeyumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__setitem__>suMailbox.__setitem__cCs.y|j|�SWntk
r)|SYnXdS(u9Return the keyed message, or default if it doesn't exist.N(u__getitem__uKeyError(uselfukeyudefault((u,/opt/alt/python33/lib64/python3.3/mailbox.pyugetBs
uMailbox.getc	CsH|js|j|�Stj|j|���}|j|�SWdQXdS(u=Return the keyed message; raise KeyError if it doesn't exist.N(u_factoryuget_messageu
contextlibuclosinguget_file(uselfukeyufile((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__getitem__Is	
uMailbox.__getitem__cCstd��dS(u4Return a Message representation or raise a KeyError.u&Method must be implemented by subclassN(uNotImplementedError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_messageQsuMailbox.get_messagecCstj|j|��j�S(u�Return a string representation or raise a KeyError.

        Uses email.message.Message to create a 7bit clean string
        representation of the message.(uemailumessage_from_bytesu	get_bytesu	as_string(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_stringUsuMailbox.get_stringcCstd��dS(u8Return a byte string representation or raise a KeyError.u&Method must be implemented by subclassN(uNotImplementedError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	get_bytes\suMailbox.get_bytescCstd��dS(u6Return a file-like representation or raise a KeyError.u&Method must be implemented by subclassN(uNotImplementedError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_file`suMailbox.get_filecCstd��dS(uReturn an iterator over keys.u&Method must be implemented by subclassN(uNotImplementedError(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuiterkeysdsuMailbox.iterkeyscCst|j��S(uReturn a list of keys.(ulistuiterkeys(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyukeyshsuMailbox.keysccsFx?|j�D]1}y||}Wntk
r8w
YnX|Vq
WdS(u%Return an iterator over all messages.N(ukeysuKeyError(uselfukeyuvalue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
itervaluesls
uMailbox.itervaluescCs
|j�S(N(u
itervalues(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__iter__usuMailbox.__iter__cCst|j��S(u,Return a list of messages. Memory intensive.(ulistu
itervalues(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuvaluesxsuMailbox.valuesccsLxE|j�D]7}y||}Wntk
r8w
YnX||fVq
WdS(u.Return an iterator over (key, message) tuples.N(ukeysuKeyError(uselfukeyuvalue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	iteritems|s
uMailbox.iteritemscCst|j��S(u9Return a list of (key, message) tuples. Memory intensive.(ulistu	iteritems(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuitems�su
Mailbox.itemscCstd��dS(u9Return True if the keyed message exists, False otherwise.u&Method must be implemented by subclassN(uNotImplementedError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__contains__�suMailbox.__contains__cCstd��dS(u*Return a count of messages in the mailbox.u&Method must be implemented by subclassN(uNotImplementedError(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__len__�suMailbox.__len__cCs(x!|j�D]}|j|�q
WdS(uDelete all messages.N(ukeysudiscard(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclear�su
Mailbox.clearcCs8y||}Wntk
r&|SYnX|j|�|S(u3Delete the keyed message and return it, or default.(uKeyErrorudiscard(uselfukeyudefaulturesult((u,/opt/alt/python33/lib64/python3.3/mailbox.pyupop�s
	
uMailbox.popcCs7x0|j�D]}||j|�fSWtd��dS(u6Delete an arbitrary (key, message) pair and return it.uNo messages in mailboxN(ukeysupopuKeyError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyupopitem�suMailbox.popitemcCs�t|d�r|j�}n$t|d�r<|j�}n|}d}x=|D]5\}}y|||<WqOtk
r�d}YqOXqOW|r�td��ndS(u4Change the messages that correspond to certain keys.u	iteritemsuitemsuNo message with key(s)NFT(uhasattruitemsuFalseuKeyErroruTrue(uselfuargusourceubad_keyukeyumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuupdate�s
uMailbox.updatecCstd��dS(u&Write any pending changes to the disk.u&Method must be implemented by subclassN(uNotImplementedError(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuflush�su
Mailbox.flushcCstd��dS(uLock the mailbox.u&Method must be implemented by subclassN(uNotImplementedError(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyulock�suMailbox.lockcCstd��dS(u#Unlock the mailbox if it is locked.u&Method must be implemented by subclassN(uNotImplementedError(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuunlock�suMailbox.unlockcCstd��dS(uFlush and close the mailbox.u&Method must be implemented by subclassN(uNotImplementedError(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclose�su
Mailbox.closecCs6y|jd�SWntk
r1td��YnXdS(Nuasciiu?String input must be ASCII-only; use bytes or a Message instead(uencodeuUnicodeErroru
ValueError(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_string_to_bytes�s
uMailbox._string_to_bytesc	Cs�t|tjj�r�tj�}tjj||d�}|j|�|j	d�|j
�}|jdt�}|j
|�|jr�|jt�r�|j
t�q�nt|tttjf�r�t|tj�r�tjdtd�|j�}nt|t�r|j|�}n|r5|jdd�}n|jdt�}|j
|�|jr�|jt�r�|j
t�q�nDt|d�r�t|d�r�tjd	td�|j}nd}x�|j�}|jd
�r�|dd�d}n&|jd
�r|dd�d}n|s(Pn|rT|jd�rTd|dd�}n|jdt�}|j
|�|}q�|jr�|r�|jt�r�|j
t�q�ntdt|���dS(u%Dump message contents to target file.is
u8Use of StringIO input is deprecated, use BytesIO insteadis
From s
>From ureadubufferuDUse of text mode files is deprecated, use a binary mode file insteads
Nis
isFrom s>From iuInvalid message type: %si����i����(u
isinstanceuemailumessageuMessageuiouBytesIOu	generatoruBytesGeneratoruflattenuseekureadureplaceulinesepuwriteu_append_newlineuendswithustrubytesuStringIOuwarningsuwarnuDeprecationWarningugetvalueu_string_to_bytesuhasattrubufferuNoneureadlineu
startswithu	TypeErrorutype(	uselfumessageutargetumangle_from_ubufferugenudataulastlineuline((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
_dump_message�sZ


	

	

	uMailbox._dump_messageNTF('u__name__u
__module__u__qualname__u__doc__uNoneuTrueu__init__uadduremoveu__delitem__udiscardu__setitem__ugetu__getitem__uget_messageu
get_stringu	get_bytesuget_fileuiterkeysukeysu
itervaluesu__iter__uvaluesu	iteritemsuitemsu__contains__u__len__uclearupopupopitemuupdateuflushulockuunlockucloseu_string_to_bytesuFalseu_append_newlineu
_dump_message(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuMailbox$sB			cBsL|EeZdZdZdZd4d5dd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4S(6uMaildiruA qmail-style Maildir mailbox.u: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(uInitialize a Maildir instance.utmpunewucuri�ig�������?N(uMailboxu__init__uosupathujoinu_pathu_pathsuexistsumkdiruvaluesuNoSuchMailboxErroru_tocu_toc_mtimesu
_last_readu_skewfactor(uselfudirnameufactoryucreateupath((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__s		uMaildir.__init__cCs�|j�}y|j||�Wn/tk
rQ|j�tj|j��YnXt|�t|t	�r�|j
�}|j|j�}||jkr�d}q�nd}d}tj
j|j�j|j�d}tj
j|j|||�}t|t	�r5tj|jtj
j|j�|j�f�nyLttd�rmtj|j|�tj|j�ntj|j|�Wn]tk
r�}z=tj|j�|jtjkr�td|��n�WYdd}~XnX|S(u$Add message and return assigned key.uunewiulinku$Name clash with existing message: %sN(u_create_tmpu
_dump_messageu
BaseExceptionucloseuosuremoveunameu_sync_closeu
isinstanceuMaildirMessageu
get_subdirucolonuget_infoupathubasenameusplitujoinu_pathuutimeugetatimeuget_dateuhasattrulinkurenameuOSErroruerrnouEEXISTuExternalClashError(uselfumessageutmp_fileusubdirusuffixuuniqudestue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuadd$s@


%%
uMaildir.addcCs,tjtjj|j|j|���dS(u=Remove the keyed message; raise KeyError if it doesn't exist.N(uosuremoveupathujoinu_pathu_lookup(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremoveMsuMaildir.removecCsfy|j|�WnNtk
r%Yn=tk
ra}z|jtjkrO�nWYdd}~XnXdS(u'If the keyed message exists, remove it.N(uremoveuKeyErroruOSErroruerrnouENOENT(uselfukeyue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyudiscardQs
uMaildir.discardcCs$|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(u>Replace the keyed message; raise KeyError if it doesn't exist.iuNi����(u_lookupuaddu
isinstanceuMaildirMessageuosupathudirnameucolonusplitudiscardujoinu_pathuutimeugetatimeuget_dateurename(uselfukeyumessageuold_subpathutemp_keyutemp_subpathudominant_subpathusubdirusuffixutmp_pathunew_path((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__setitem__\s"	 
	"uMaildir.__setitem__c
Cs�|j|�}ttjj|j|�d�}z+|jrN|j|�}nt|�}Wd|j�Xtjj	|�\}}|j
|�|j|kr�|j|j	|j�d�n|j
tjjtjj|j|���|S(u4Return a Message representation or raise a KeyError.urbNii����(u_lookupuopenuosupathujoinu_pathu_factoryuMaildirMessageucloseusplitu
set_subdirucolonuset_infouset_dateugetmtime(uselfukeyusubpathufumsgusubdiruname((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_messagews!	
 +uMaildir.get_messagec
CsVttjj|j|j|��d�}z|j�jtd�SWd|j	�XdS(u2Return a bytes representation or raise a KeyError.urbs
N(
uopenuosupathujoinu_pathu_lookupureadureplaceulinesepuclose(uselfukeyuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	get_bytes�s*uMaildir.get_bytescCs4ttjj|j|j|��d�}t|�S(u6Return a file-like representation or raise a KeyError.urb(uopenuosupathujoinu_pathu_lookupu
_ProxyFile(uselfukeyuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_file�s*uMaildir.get_fileccsP|j�x?|jD]4}y|j|�Wntk
rBwYnX|VqWdS(uReturn an iterator over keys.N(u_refreshu_tocu_lookupuKeyError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuiterkeys�s

uMaildir.iterkeyscCs|j�||jkS(u9Return True if the keyed message exists, False otherwise.(u_refreshu_toc(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__contains__�s
uMaildir.__contains__cCs|j�t|j�S(u*Return a count of messages in the mailbox.(u_refreshulenu_toc(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__len__�s
uMaildir.__len__cCsdS(u"Write any pending changes to disk.N((uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuflush�su
Maildir.flushcCsdS(uLock the mailbox.N((uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyulock�suMaildir.lockcCsdS(u#Unlock the mailbox if it is locked.N((uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuunlock�suMaildir.unlockcCsdS(uFlush and close the mailbox.N((uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclose�su
Maildir.closecCs�g}xztj|j�D]f}t|�dkr|ddkrtjjtjj|j|��r|j|dd��qqW|S(uReturn a list of folder names.iiu.N(uosulistdiru_pathulenupathuisdirujoinuappend(uselfuresultuentry((u,/opt/alt/python33/lib64/python3.3/mailbox.pyulist_folders�s"$uMaildir.list_folderscCs/ttjj|jd|�d|jdd�S(u/Return a Maildir instance for the named folder.u.ufactoryucreateF(uMaildiruosupathujoinu_pathu_factoryuFalse(uselfufolder((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_folder�s	uMaildir.get_foldercCs�tjj|jd|�}t|d|j�}tjj|d�}tjj|�s�tjtj|tj	tj
Bd��n|S(u>Create a folder and return a Maildir instance representing it.u.ufactoryu
maildirfolderi�(uosupathujoinu_pathuMaildiru_factoryuexistsucloseuopenuO_CREATuO_WRONLY(uselfufolderupathuresultumaildirfolder_path((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
add_folder�s
uMaildir.add_foldercCs�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	d�D]i\}}}x*|D]"}tj
tjj||��q:Wx*|D]"}tjtjj||��qgWq$Wtj|�d
S(u-Delete the named folder, which must be empty.u.unewucuriiuFolder contains message(s): %sutmpu%Folder contains subdirectory '%s': %sutopdownNF(uosupathujoinu_pathulistdirulenu
NotEmptyErroruisdiruwalkuFalseuremoveurmdir(uselfufolderupathuentryurootudirsufiles((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
remove_folder�s #"$!%
 
$uMaildir.remove_foldercCs�tj�}xptjtjj|jd��D]M}tjj|jd|�}|tjj|�dkr.tj|�q.q.WdS(uDelete old files in "tmp".utmpi@�N(utimeuosulistdirupathujoinu_pathugetatimeuremove(uselfunowuentryupath((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclean�s
(u
Maildir.cleanicCsmtj�}tj�}d|kr9|jdd�}nd|krZ|jdd�}ndt|�t|dd�tj�tj|f}tj	j
|jd|�}ytj|�Wn�t
k
rX}zz|jtjkrCtjd7_yt|�SWqFt
k
r?}z|jtjkr-�nWYd	d	}~XqFXn�WYd	d	}~XnXtd
|��d	S(u=Create a file in the tmp subdirectory and open and return it.u/u\057u:u\072u%s.M%sP%sQ%s.%sig��.AutmpNu&Name clash prevented file creation: %s(utimeusocketugethostnameureplaceuintuosugetpiduMaildiru_countupathujoinu_pathustatuOSErroruerrnouENOENTu_create_carefullyuEEXISTuExternalClashError(uselfunowuhostnameuuniqupathue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_create_tmp�s,&uMaildir._create_tmpcCs?tj�|jd|jkr�d}xS|jD]H}tjj|j|�}||j|krkd}n||j|<q0W|s�dSni|_
x�|jD]�}|j|}xvtj|�D]e}tjj||�}tjj
|�r�q�n|j|j�d}tjj||�|j
|<q�Wq�Wtj�|_dS(u!Update table of contents mapping.iNiFT(utimeu
_last_readu_skewfactoruFalseu_toc_mtimesuosupathugetmtimeu_pathsuTrueu_toculistdirujoinuisdirusplitucolon(uselfurefreshusubdirumtimeupathuentryupuuniq((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_refreshs& 		
$uMaildir._refreshcCs�y:tjjtjj|j|j|��r9|j|SWntk
rNYnX|j�y|j|SWn"tk
r�td|��YnXdS(u=Use TOC to return subpath for given key, or raise a KeyError.uNo message with key: %sN(uosupathuexistsujoinu_pathu_tocuKeyErroru_refresh(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_lookup2s+


uMaildir._lookupcCsst|d�s't|j��|_nxEy|t|j�SWq*tk
rWdSYq*tk
rkw*Yq*Xq*dS(u0Return the next message in a one-time iteration.u
_onetime_keysN(uhasattruiterukeysu
_onetime_keysunextu
StopIterationuNoneuKeyError(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyunext@s

uMaildir.nextNT( u__name__u
__module__u__qualname__u__doc__ucolonuNoneuTrueu__init__uadduremoveudiscardu__setitem__uget_messageu	get_bytesuget_fileuiterkeysu__contains__u__len__uflushulockuunlockucloseulist_foldersu
get_folderu
add_folderu
remove_folderucleanu_countu_create_tmpu_refreshu_lookupunext(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuMaildirs6)
	
$cBs�|EeZdZdZd"d#dd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd"dd�Zd d!�Zd"S($u_singlefileMailboxuA single-file mailbox.cCs	tj||||�yt|jd�}Wn�tk
r�}zw|jtjkr�|rnt|jd�}q�t|j��n3|jtjtj	fkr�t|jd�}n�WYdd}~XnX||_
d|_d|_
d|_d|_d|_d|_dS(u!Initialize a single-file mailbox.urb+uwb+urbNiF(uMailboxu__init__uopenu_pathuIOErroruerrnouENOENTuNoSuchMailboxErroruEACCESuEROFSu_fileuNoneu_tocu	_next_keyuFalseu_pendingu
_pending_syncu_lockedu_file_length(uselfupathufactoryucreateufue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__Ps$						u_singlefileMailbox.__init__cCsF|j�|j|�|j|j<|jd7_d|_|jdS(u$Add message and return assigned key.iT(u_lookupu_append_messageu_tocu	_next_keyuTrueu
_pending_sync(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuaddgs

	u_singlefileMailbox.addcCs$|j|�|j|=d|_dS(u=Remove the keyed message; raise KeyError if it doesn't exist.NT(u_lookupu_tocuTrueu_pending(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremoveqs

u_singlefileMailbox.removecCs0|j|�|j|�|j|<d|_dS(u>Replace the keyed message; raise KeyError if it doesn't exist.NT(u_lookupu_append_messageu_tocuTrueu_pending(uselfukeyumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__setitem__ws
u_singlefileMailbox.__setitem__ccs-|j�x|jj�D]}|VqWdS(uReturn an iterator over keys.N(u_lookupu_tocukeys(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuiterkeys}s
u_singlefileMailbox.iterkeyscCs|j�||jkS(u9Return True if the keyed message exists, False otherwise.(u_lookupu_toc(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__contains__�s
u_singlefileMailbox.__contains__cCs|j�t|j�S(u*Return a count of messages in the mailbox.(u_lookupulenu_toc(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__len__�s
u_singlefileMailbox.__len__cCs&|js"t|j�d|_ndS(uLock the mailbox.NT(u_lockedu
_lock_fileu_fileuTrue(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyulock�s	
u_singlefileMailbox.lockcCs&|jr"t|j�d|_ndS(u#Unlock the mailbox if it is locked.NF(u_lockedu_unlock_fileu_fileuFalse(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuunlock�s	
u_singlefileMailbox.unlockcCs�|js/|jr+t|j�d	|_ndS|jdk	sDt�|jjdd�|jj	�}||j
kr�td|j
|f��nt|j
�}y�i}|j|�x�t|jj��D]�}|j|\}}|jj|�|j|�|j	�}xB|jjtd||jj	���}|sCPn|j|�q||j	�f||<|j|�q�W|j	�|_
Wn%|j�tj|j��YnXt|�|jj�tj|j
�j}	tj|j|	�ytj|j|j
�Wn�tk
r�}
zd|
j t j!ksStjdkr||
j t j"kr|tj|j
�tj|j|j
�n�WYdd}
~
XnXt#|j
d�|_||_d	|_d	|_|j$r�t%|jdd	�ndS(
u"Write any pending changes to disk.Niiu4Size of mailbox file changed (expected %i, found %i)iuos2urb+udotlockF(&u_pendingu
_pending_syncu_sync_flushu_fileuFalseu_tocuNoneuAssertionErroruseekutellu_file_lengthuExternalClashErroru_create_temporaryu_pathu_pre_mailbox_hookusortedukeysu_pre_message_hookureaduminuwriteu_post_message_hookucloseuosuremoveunameu_sync_closeustatust_modeuchmodurenameuOSErroruerrnouEEXISTuEACCESuopenu_lockedu
_lock_file(uselfucur_lenunew_fileunew_tocukeyustartustopu	new_startubufferumodeue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuflush�sf		





!				u_singlefileMailbox.flushcCsdS(u,Called before writing the mailbox to file f.N((uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_pre_mailbox_hook�su$_singlefileMailbox._pre_mailbox_hookcCsdS(u-Called before writing each message to file f.N((uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_pre_message_hook�su$_singlefileMailbox._pre_message_hookcCsdS(u,Called after writing each message to file f.N((uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_post_message_hook�su%_singlefileMailbox._post_message_hookcCs1|j�|jr |j�n|jj�dS(uFlush and close the mailbox.N(uflushu_lockeduunlocku_fileuclose(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclose�s
	
u_singlefileMailbox.closecCsc|jdkr|j�n|dk	r_y|j|SWq_tk
r[td|��Yq_XndS(u'Return (start, stop) or raise KeyError.uNo message with key: %sN(u_tocuNoneu
_generate_tocuKeyError(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_lookup�s

u_singlefileMailbox._lookupcCs�|jjdd�|jj�}t|j�dkrT|jrT|j|j�ny3|j|j�|j|�}|j	|j�Wn%t
k
r�|jj|��YnX|jj�|jj�|_
|S(u;Append message to mailbox and return (start, stop) offsets.ii(u_fileuseekutellulenu_tocu_pendingu_pre_mailbox_hooku_pre_message_hooku_install_messageu_post_message_hooku
BaseExceptionutruncateuflushu_file_length(uselfumessageubeforeuoffsets((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_append_message�s

u"_singlefileMailbox._append_messageNT(u__name__u
__module__u__qualname__u__doc__uNoneuTrueu__init__uadduremoveu__setitem__uiterkeysu__contains__u__len__ulockuunlockuflushu_pre_mailbox_hooku_pre_message_hooku_post_message_hookucloseu_lookupu_append_message(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_singlefileMailboxMs"
D
u_singlefileMailboxcBse|EeZdZdZd
Zdd�Zddd�Zddd�Z	ddd	�Z
d
d�ZdS(u	_mboxMMDFuAn mbox or MMDF mailbox.cCs�|j|�\}}|jj|�|jj�jtd�}|jj||jj��}|j|jtd��}|j	|dd�j
d��|S(u4Return a Message representation or raise a KeyError.ss
iNuascii(u_lookupu_fileuseekureadlineureplaceulinesepureadutellu_message_factoryuset_fromudecode(uselfukeyustartustopu	from_lineustringumsg((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_messages u_mboxMMDF.get_messagecCs"tj|j|��jd|�S(u3Return a string representation or raise a KeyError.uunixfrom(uemailumessage_from_bytesu	get_bytesu	as_string(uselfukeyufrom_((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_string su_mboxMMDF.get_stringcCsj|j|�\}}|jj|�|s;|jj�n|jj||jj��}|jtd�S(u3Return a string representation or raise a KeyError.s
(u_lookupu_fileuseekureadlineureadutellureplaceulinesep(uselfukeyufrom_ustartustopustring((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	get_bytes%su_mboxMMDF.get_bytescCsW|j|�\}}|jj|�|s;|jj�nt|j|jj�|�S(u6Return a file-like representation or raise a KeyError.(u_lookupu_fileuseekureadlineu_PartialFileutell(uselfukeyufrom_ustartustop((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_file.s
u_mboxMMDF.get_filecCs�d}t|t�r'|j|�}nt|t�r�|jd�r�|jd�}|dkr�|d|�}||dd�}q	|}d}nst|t�r�|j�j	d�}d|}nBt|t
jj�r	|j
�}|dk	r	|j	d�}q	n|dkr7dtjtj��j	�}n|jj�}|jj|t�|j||j|j�|jj�}||fS(	u1Format a message and blindly write to self._file.sFrom s
iNsuasciisFrom MAILER-DAEMON i����(uNoneu
isinstanceustru_string_to_bytesubytesu
startswithufindu_mboxMMDFMessageuget_fromuencodeuemailumessageuMessageuget_unixfromutimeuasctimeugmtimeu_fileutelluwriteulinesepu
_dump_messageu
_mangle_from_(uselfumessageu	from_lineunewlineuauthorustartustop((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_install_message6s0	
"u_mboxMMDF._install_messageNTF(u__name__u
__module__u__qualname__u__doc__uTrueu
_mangle_from_uget_messageuFalseu
get_stringu	get_bytesuget_fileu_install_message(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	_mboxMMDFs
	u	_mboxMMDFcBsP|EeZdZdZd	Zd	Zdd	dd�Zdd�Z	dd�Z
dS(
umboxuA classic mbox mailbox.cCs#t|_tj||||�dS(uInitialize an mbox mailbox.N(umboxMessageu_message_factoryu	_mboxMMDFu__init__(uselfupathufactoryucreate((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__\s	u
mbox.__init__cCs|jt�dS(u,Called after writing each message to file f.N(uwriteulinesep(uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_post_message_hookasumbox._post_message_hookcCsLgg}}d}|jjd�x�|jj�}|jj�}|jd�r�t|�t|�kr�|r�|j|tt��q�|j|�n|j|�d}q&|s�|r�|j|tt��n
|j|�Pq&|tkr�d}q&d}q&t
tt||���|_
t|j
�|_|jj�|_dS(u0Generate key-to-(start, stop) table of contents.isFrom NFT(uFalseu_fileuseekutellureadlineu
startswithulenuappendulinesepuTrueudictu	enumerateuzipu_tocu	_next_keyu_file_length(uselfustartsustopsulast_was_emptyuline_posuline((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
_generate_toces0

	
		umbox._generate_tocNT(u__name__u
__module__u__qualname__u__doc__uTrueu
_mangle_from_u_append_newlineuNoneu__init__u_post_message_hooku
_generate_toc(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyumboxSscBsP|EeZdZdZd
ddd�Zdd�Zdd�Zdd	�Z	d
S(uMMDFuAn MMDF mailbox.cCs#t|_tj||||�dS(uInitialize an MMDF mailbox.N(uMMDFMessageu_message_factoryu	_mboxMMDFu__init__(uselfupathufactoryucreate((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__�s	u
MMDF.__init__cCs|jdt�dS(u-Called before writing each message to file f.sN(uwriteulinesep(uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_pre_message_hook�suMMDF._pre_message_hookcCs|jtdt�dS(u,Called after writing each message to file f.sN(uwriteulinesep(uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_post_message_hook�suMMDF._post_message_hookcCs?gg}}|jjd�d}x�|}|jj�}|jj�}|jdt�r�|j|�xv|}|jj�}|jj�}|dtkr�|j|tt��Pqm|sm|j|�Pqmqmq&|s&Pq&q&tt	t
||���|_t|j�|_|jjdd�|jj�|_
dS(u0Generate key-to-(start, stop) table of contents.isiN(u_fileuseekureadlineutellu
startswithulinesepuappendulenudictu	enumerateuzipu_tocu	_next_keyu_file_length(uselfustartsustopsunext_posuline_posuline((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
_generate_toc�s2



uMMDF._generate_tocNT(
u__name__u
__module__u__qualname__u__doc__uNoneuTrueu__init__u_pre_message_hooku_post_message_hooku
_generate_toc(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuMMDF�s
cBs(|EeZdZdZd.d/dd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.S(0uMHuAn MH mailbox.cCs�tj||||�tjj|j�s�|r�tj|jd�tjtjtjj	|jd�tj
tjBtjBd��q�t
|j��nd|_dS(uInitialize an MH instance.i�u
.mh_sequencesi�NF(uMailboxu__init__uosupathuexistsu_pathumkdirucloseuopenujoinuO_CREATuO_EXCLuO_WRONLYuNoSuchMailboxErroruFalseu_locked(uselfupathufactoryucreate((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__�s!!uMH.__init__cCs;|j�}t|�dkr'd}nt|�d}tjj|jt|��}t|�}d}z�|j
r�t|�nz�y|j||�WnHt
k
r�|j
r�t|�nt|�d}tj|��YnXt|t�r|j||�nWd|j
rt|�nXWd|s6t|�nX|S(u$Add message and return assigned key.iiNFT(ukeysulenumaxuosupathujoinu_pathustru_create_carefullyuFalseu_lockedu
_lock_fileu
_dump_messageu
BaseExceptionu_unlock_fileu_sync_closeuTrueuremoveu
isinstanceu	MHMessageu_dump_sequences(uselfumessageukeysunew_keyunew_pathufuclosed((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuadd�s6		

	


	uMH.addcCs�tjj|jt|��}yt|d�}WnMtk
r�}z-|jtjkrkt	d|��n�WYdd}~XnX|j
�tj|�dS(u=Remove the keyed message; raise KeyError if it doesn't exist.urb+uNo message with key: %sN(uosupathujoinu_pathustruopenuIOErroruerrnouENOENTuKeyErrorucloseuremove(uselfukeyupathufue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremove�s
u	MH.removecCs tjj|jt|��}yt|d�}WnMtk
r�}z-|jtjkrkt	d|��n�WYdd}~XnXz�|j
r�t|�nzYtjtj|tj
tjB��|j||�t|t�r�|j||�nWd|j
rt|�nXWdt|�XdS(u>Replace the keyed message; raise KeyError if it doesn't exist.urb+uNo message with key: %sN(uosupathujoinu_pathustruopenuIOErroruerrnouENOENTuKeyErroru_lockedu
_lock_fileucloseuO_WRONLYuO_TRUNCu
_dump_messageu
isinstanceu	MHMessageu_dump_sequencesu_unlock_fileu_sync_close(uselfukeyumessageupathufue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__setitem__�s$	
#	uMH.__setitem__cCsCy^|jr6ttjj|jt|��d�}n'ttjj|jt|��d�}WnMtk
r�}z-|jtj	kr�t
d|��n�WYdd}~XnXzD|jr�t|�nzt|�}Wd|jr�t
|�nXWd|j�Xx<|j�j�D](\}}||kr|j|�qqW|S(u4Return a Message representation or raise a KeyError.urb+urbuNo message with key: %sN(u_lockeduopenuosupathujoinu_pathustruIOErroruerrnouENOENTuKeyErroru
_lock_fileu	MHMessageu_unlock_fileucloseu
get_sequencesuitemsuadd_sequence(uselfukeyufueumsgunameukey_list((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_messages(	*+	
	uMH.get_messagecCsy^|jr6ttjj|jt|��d�}n'ttjj|jt|��d�}WnMtk
r�}z-|jtj	kr�t
d|��n�WYdd}~XnXzN|jr�t|�nz|j�j
td�SWd|jr�t|�nXWd|j�XdS(u2Return a bytes representation or raise a KeyError.urb+urbuNo message with key: %sNs
(u_lockeduopenuosupathujoinu_pathustruIOErroruerrnouENOENTuKeyErroru
_lock_fileureadureplaceulinesepu_unlock_fileuclose(uselfukeyufue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	get_bytes&s 	*+	
	uMH.get_bytescCs�y+ttjj|jt|��d�}WnMtk
rz}z-|jtjkret	d|��n�WYdd}~XnXt
|�S(u6Return a file-like representation or raise a KeyError.urbuNo message with key: %sN(uopenuosupathujoinu_pathustruIOErroruerrnouENOENTuKeyErroru
_ProxyFile(uselfukeyufue((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_file=s+uMH.get_filecCs)ttdd�tj|j�D���S(uReturn an iterator over keys.css'|]}|j�rt|�VqdS(N(uisdigituint(u.0uentry((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	<genexpr>JsuMH.iterkeys.<locals>.<genexpr>(uiterusorteduosulistdiru_path(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuiterkeysHsuMH.iterkeyscCs(tjjtjj|jt|���S(u9Return True if the keyed message exists, False otherwise.(uosupathuexistsujoinu_pathustr(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__contains__MsuMH.__contains__cCstt|j���S(u*Return a count of messages in the mailbox.(ulenulistukeys(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__len__Qsu
MH.__len__cCsJ|jsFttjj|jd�d�|_t|j�d|_ndS(uLock the mailbox.u
.mh_sequencesurb+NT(	u_lockeduopenuosupathujoinu_pathu_fileu
_lock_fileuTrue(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyulockUs	$
uMH.lockcCs9|jr5t|j�t|j�|`d|_ndS(u#Unlock the mailbox if it is locked.NF(u_lockedu_unlock_fileu_fileu_sync_closeuFalse(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuunlock\s
	

u	MH.unlockcCsdS(u&Write any pending changes to the disk.N((uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuflushdsuMH.flushcCs|jr|j�ndS(uFlush and close the mailbox.N(u_lockeduunlock(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclosehs	uMH.closecCs[g}xNtj|j�D]:}tjjtjj|j|��r|j|�qqW|S(uReturn a list of folder names.(uosulistdiru_pathupathuisdirujoinuappend(uselfuresultuentry((u,/opt/alt/python33/lib64/python3.3/mailbox.pyulist_foldersms
$uMH.list_folderscCs+ttjj|j|�d|jdd�S(u+Return an MH instance for the named folder.ufactoryucreateF(uMHuosupathujoinu_pathu_factoryuFalse(uselfufolder((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_folderusu
MH.get_foldercCs%ttjj|j|�d|j�S(u:Create a folder and return an MH instance representing it.ufactory(uMHuosupathujoinu_pathu_factory(uselfufolder((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
add_folderzsu
MH.add_foldercCs�tjj|j|�}tj|�}|dgkrUtjtjj|d��n"|gkrdntd|j��tj|�dS(u-Delete the named folder, which must be empty.u
.mh_sequencesuFolder not empty: %sN(uosupathujoinu_pathulistdiruremoveu
NotEmptyErrorurmdir(uselfufolderupathuentries((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
remove_foldersuMH.remove_folderc
sbi}ttjj|jd�ddd��/}t|j���x|D]}y�|jd�\}}t�}xr|j�D]d}|j�r�|j	t
|��q}dd�|jd�D�\}}	|jt||	d	��q}W�fd
d�t
|�D�||<t||�dkr(||=nWqItk
rStd
|j���YqIXqIWWdQX|S(u=Return a name-to-key-list dictionary to define each sequence.u
.mh_sequencesuruencodinguASCIIu:css|]}t|�VqdS(N(uint(u.0ux((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	<genexpr>�su#MH.get_sequences.<locals>.<genexpr>u-ics"g|]}|�kr|�qS(((u.0ukey(uall_keys(u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
<listcomp>�s	u$MH.get_sequences.<locals>.<listcomp>iu"Invalid sequence specification: %sN(uopenuosupathujoinu_pathusetukeysusplituisdigituadduintuupdateurangeusortedulenu
ValueErroruFormatErrorurstrip(
uselfuresultsufulineunameucontentsukeysuspecustartustop((uall_keysu,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_sequences�s&*
	"#
uMH.get_sequencescCskttjj|jd�ddd�}z2tjtj|jtjtjB��x|j	�D]�\}}t
|�dkr�q]n|j|d�d}d
}x�tt|��D]r}|d|kr�|sd}|jd�qn7|rd
}|jd	||f�n|jd
|�|}q�W|rG|jt|�d�q]|jd�q]WWdt|�XdS(u:Set sequences using the given name-to-key-list dictionary.u
.mh_sequencesur+uencodinguASCIIiu:iu-u%s %su %su
NFT(uopenuosupathujoinu_pathucloseunameuO_WRONLYuO_TRUNCuitemsulenuwriteuNoneuFalseusortedusetuTrueustru_sync_close(uselfu	sequencesufunameukeysuprevu
completingukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
set_sequences�s.'&
uMH.set_sequencesc	Cs�|j�}d}g}x|j�D]�}|d|kr|j||df�ttd�r�tjtjj|jt	|��tjj|jt	|d���tj
tjj|jt	|���qtjtjj|jt	|��tjj|jt	|d���n|d7}q%W|d|_t
|�dkrEdSxS|j�D]E\}}x6|D].\}}||kre|||j|�<qeqeWqRW|j|�dS(u?Re-name messages to eliminate numbering gaps. Invalidates keys.iiulinkN(u
get_sequencesukeysuappenduhasattruosulinkupathujoinu_pathustruunlinkurenameu	_next_keyulenuitemsuindexu
set_sequences(	uselfu	sequencesuprevuchangesukeyunameukey_listuoldunew((u,/opt/alt/python33/lib64/python3.3/mailbox.pyupack�s*!#(!&
uMH.packcCs�|j�}|j�}xU|j�D]G\}}||krM|j|�q%||kr%||j|�=q%q%Wx*|D]"}||krw|g||<qwqwW|j|�dS(u;Inspect a new MHMessage and update sequences appropriately.N(u
get_sequencesuitemsuappenduindexu
set_sequences(uselfumessageukeyupending_sequencesu
all_sequencesunameukey_listusequence((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_dump_sequences�s
uMH._dump_sequencesNT(u__name__u
__module__u__qualname__u__doc__uNoneuTrueu__init__uadduremoveu__setitem__uget_messageu	get_bytesuget_fileuiterkeysu__contains__u__len__ulockuunlockuflushucloseulist_foldersu
get_folderu
add_folderu
remove_folderu
get_sequencesu
set_sequencesupacku_dump_sequences(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuMH�s."cBs�|EeZdZdZed$�Zd#d%d	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S(&uBabyluAn Rmail-style Babyl mailbox.uunseenudeletedufileduansweredu	forwardeduediteduresentcCs#tj||||�i|_dS(uInitialize a Babyl mailbox.N(u_singlefileMailboxu__init__u_labels(uselfupathufactoryucreate((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__�suBabyl.__init__cCs;tj||�}t|t�r7|j�|j|<n|S(u$Add message and return assigned key.(u_singlefileMailboxuaddu
isinstanceuBabylMessageu
get_labelsu_labels(uselfumessageukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuadd�su	Babyl.addcCs0tj||�||jkr,|j|=ndS(u=Remove the keyed message; raise KeyError if it doesn't exist.N(u_singlefileMailboxuremoveu_labels(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremove�suBabyl.removecCs<tj|||�t|t�r8|j�|j|<ndS(u>Replace the keyed message; raise KeyError if it doesn't exist.N(u_singlefileMailboxu__setitem__u
isinstanceuBabylMessageu
get_labelsu_labels(uselfukeyumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__setitem__suBabyl.__setitem__c
Cst|j|�\}}|jj|�|jj�tj�}xF|jj�}|dtksg|rkPn|j|jtd��qAtj�}xB|jj�}|tks�|r�Pn|j|jtd��q�||jj	�}|dks�t
�|jj|�}|jtd�}t|j
�|�}	|	j|j
��||jkrp|	j|j|�n|	S(u4Return a Message representation or raise a KeyError.s*** EOOH ***s
i(u_lookupu_fileuseekureadlineuiouBytesIOulinesepuwriteureplaceutelluAssertionErrorureaduBabylMessageugetvalueuset_visibleu_labelsu
set_labels(
uselfukeyustartustopuoriginal_headersulineuvisible_headersunubodyumsg((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_messages0
uBabyl.get_messagec	Cs|j|�\}}|jj|�|jj�tj�}xF|jj�}|dtksg|rkPn|j|jtd��qAx)|jj�}|tks�|r�Pq�q�|j	�}||jj
�}|dks�t�|jj|�}|jtd�}||S(u3Return a string representation or raise a KeyError.s*** EOOH ***s
i(
u_lookupu_fileuseekureadlineuiouBytesIOulinesepuwriteureplaceugetvalueutelluAssertionErroruread(	uselfukeyustartustopuoriginal_headersulineuheadersunudata((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	get_bytes"s&
uBabyl.get_bytescCs"tj|j|�jdt��S(u6Return a file-like representation or raise a KeyError.s
(uiouBytesIOu	get_bytesureplaceulinesep(uselfukey((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_file8suBabyl.get_filecCsT|j�t�}x$|jj�D]}|j|�q#W|j|j�t|�S(u4Return a list of user-defined labels in the mailbox.(u_lookupusetu_labelsuvaluesuupdateudifference_updateu_special_labelsulist(uselfulabelsu
label_list((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_labels<s
	uBabyl.get_labelscCs�gg}}|jjd�d}g}x'|}|jj�}|jj�}|dtkr�t|�t|�kr�|j|tt��n|j|�dd�|jj�dd�jd�D�}|j|�q,|dks�|dtkr/t|�t|�krP|j|tt��qPq,|s,|j|tt��Pq,q,tt	t
||���|_tt	|��|_t|j�|_
|jjdd	�|jj�|_dS(
u0Generate key-to-(start, stop) table of contents.iscSs(g|]}|j�r|j��qS((ustrip(u.0ulabel((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
<listcomp>Ss	u'Babyl._generate_toc.<locals>.<listcomp>iNs,si(u_fileuseekureadlineutellulinesepulenuappendusplitudictu	enumerateuzipu_tocu_labelsu	_next_keyu_file_length(uselfustartsustopsunext_posulabel_listsuline_posulineulabels((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
_generate_tocEs4

	&uBabyl._generate_toccCsmdt}|dt7}|j�}dd�|D�}|ddj|�t7}|d7}|j|�dS(	u,Called before writing the mailbox to file f.sBABYL OPTIONS:s
Version: 5css|]}|j�VqdS(N(uencode(u.0ulabel((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	<genexpr>hsu*Babyl._pre_mailbox_hook.<locals>.<genexpr>sLabels:s,sN(ulinesepu
get_labelsujoinuwrite(uselfufubabylulabels((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_pre_mailbox_hookcs

uBabyl._pre_mailbox_hookcCs|jdt�dS(u-Called before writing each message to file f.sN(uwriteulinesep(uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_pre_message_hookmsuBabyl._pre_message_hookcCs|jtd�dS(u,Called after writing each message to file f.sN(uwriteulinesep(uselfuf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_post_message_hookqsuBabyl._post_message_hookcCs|jj�}t|t�r�g}g}x@|j�D]2}||jkr\|j|�q7|j|�q7W|jjd�x(|D] }|jjd|j��q�W|jjd�x,|D]$}|jjd|j�d�q�W|jjt	�n|jjdt	�t|t
jj�r�t
j�}t
jj|dd�}|j|�|jd�xB|j�}|jj|jdt	��|dks�|rdPqdqd|jjd	t	�t|t�rHt
j�}	t
jj|	dd�}
|
j|j��x�|	j�}|jj|jdt	��|dks>|rPqqnR|jd�xB|j�}|jj|jdt	��|dks�|rXPqXqXxU|jd
�}|s�Pn|jj|jdt	��q�nt|ttt
jf�r+t|t
j�r'tjdtd�|j�}nt|t�rH|j|�}n|j d
�d}|ddkr�|jj|d|�jdt	��|jjd	t	�|jj|d|�jdt	��|jj||d�jdt	��q�|jjd	t	t	�|jj|jdt	��n�t!|d�r�t!|d�rhtjdtd�|j"}n|j�}
d}x�|j�}|j$d�r�|dd�d}n&|j$d�r�|dd�d}n|jj|jdt	��|dks|r}|r4d}|jjd	t	�|j|
�q8Pq}q}x�|j�}|sTPn|j$d�rz|dd�t	}nL|j$d�r�|dd�t	}n&|j$d�r�|dd�t	}n|jj|�q>nt%dt&|���|jj�}||fS(u0Write message contents and return (start, stop).s1s, s,,s s,s1,,is
s*** EOOH ***iu8Use of StringIO input is deprecated, use BytesIO insteadis

iiNureadlineubufferuDUse of text mode files is deprecated, use a binary mode file insteads
s
uInvalid message type: %sFi����Ti����i����i����i����i����('u_fileutellu
isinstanceuBabylMessageu
get_labelsu_special_labelsuappenduwriteuencodeulinesepuemailumessageuMessageuiouBytesIOu	generatoruBytesGeneratoruFalseuflattenuseekureadlineureplaceuget_visibleureadubytesustruStringIOuwarningsuwarnuDeprecationWarningugetvalueu_string_to_bytesufinduhasattrubufferuTrueuendswithu	TypeErrorutype(uselfumessageustartuspecial_labelsulabelsulabeluorig_bufferuorig_generatorulineu
vis_bufferu
vis_generatorubufferu
body_startuoriginal_posu
first_passustop((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_install_messageus�

"



"	
&&)	
uBabyl._install_messageN(uunseenudeletedufileduansweredu	forwardeduediteduresentT(u__name__u
__module__u__qualname__u__doc__u	frozensetu_special_labelsuNoneuTrueu__init__uadduremoveu__setitem__uget_messageu	get_bytesuget_fileu
get_labelsu
_generate_tocu_pre_mailbox_hooku_pre_message_hooku_post_message_hooku_install_message(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuBabyl�s 		
cBsA|EeZdZdZddd�Zdd�Zdd�ZdS(	uMessageu0Message with mailbox-format-specific properties.cCs,t|tjj�rM|jtj|��t|t�r(|j|�q(n�t|t�ru|jtj	|��n�t|t
�r�|jtj|��n�t|tj
�r�|jtj|��n`t|d�r�|jtj|��n8|dkrtjjj|�ntdt|���dS(uInitialize a Message instance.ureaduInvalid message type: %sN(u
isinstanceuemailumessageuMessageu_become_messageucopyudeepcopyu_explain_toubytesumessage_from_bytesustrumessage_from_stringuiou
TextIOWrapperumessage_from_fileuhasattrumessage_from_binary_fileuNoneu__init__u	TypeErrorutype(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__�suMessage.__init__cCsMt|dg�}x4|jD])}||kr|j||j|<qqWdS(u0Assume the non-format-specific state of message.u_type_specific_attributesN(ugetattru__dict__(uselfumessageu
type_specificuname((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_become_message�suMessage._become_messagecCs#t|t�rdStd��dS(u:Copy format-specific state to message insofar as possible.Nu Cannot convert to specified type(u
isinstanceuMessageu	TypeError(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_explain_to�suMessage._explain_toN(u__name__u
__module__u__qualname__u__doc__uNoneu__init__u_become_messageu_explain_to(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuMessage�scBs�|EeZdZdZdddgZddd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS(uMaildirMessageu)Message with Maildir-specific properties.u_subdiru_infou_datecCs5d|_d|_tj�|_tj||�dS(u%Initialize a MaildirMessage instance.unewuN(u_subdiru_infoutimeu_dateuMessageu__init__(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__s		uMaildirMessage.__init__cCs|jS(uReturn 'new' or 'cur'.(u_subdir(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_subdirsuMaildirMessage.get_subdircCs8|dks|dkr$||_ntd|��dS(uSet subdir to 'new' or 'cur'.unewucuru!subdir must be 'new' or 'cur': %sN(u_subdiru
ValueError(uselfusubdir((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
set_subdirsuMaildirMessage.set_subdircCs+|jjd�r#|jdd�SdSdS(u*Return as a string the flags that are set.u2,iNu(u_infou
startswith(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	get_flagssuMaildirMessage.get_flagscCs ddjt|��|_dS(u)Set the given flags and unset all others.u2,uN(ujoinusortedu_info(uselfuflags((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	set_flags$suMaildirMessage.set_flagscCs0|jdjt|j��t|�B��dS(u.Set the given flag(s) without changing others.uN(u	set_flagsujoinusetu	get_flags(uselfuflag((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuadd_flag(suMaildirMessage.add_flagcCs?|j�r;|jdjt|j��t|���ndS(u7Unset the given string flag(s) without changing others.uN(u	get_flagsu	set_flagsujoinuset(uselfuflag((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremove_flag,suMaildirMessage.remove_flagcCs|jS(u<Return delivery date of message, in seconds since the epoch.(u_date(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_date1suMaildirMessage.get_datecCs<yt|�|_Wn"tk
r7td|��YnXdS(u9Set delivery date of message, in seconds since the epoch.ucan't convert to float: %sN(ufloatu_dateu
ValueErroru	TypeError(uselfudate((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuset_date5s
uMaildirMessage.set_datecCs|jS(u%Get the message's "info" as a string.(u_info(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_info<suMaildirMessage.get_infocCs5t|t�r||_ntdt|���dS(u Set the message's "info" string.uinfo must be a string: %sN(u
isinstanceustru_infou	TypeErrorutype(uselfuinfo((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuset_info@suMaildirMessage.set_infocCsXt|t�rK|j|j��|j|j��|j|j��n	t|t�r t	|j��}d|kr�|j
d�n|j�dkr�|j
d�nd|kr�|j
d�nd|kr�|j
d�nd|kr�|j
d�n|jd	tj
|j���n4t|t�r�t	|j��}d|kr]|jd
�nd|kry|jd�nd|krT|jd�qTn�t|t�r,t	|j��}d|kr�|jd
�nd|kr�|jd
�nd|kr
|jd�nd|krT|jd�qTn(t|t�r>ntdt|���dS(u;Copy Maildir-specific state to message insofar as possible.uSuRucuruOuTuDuFuAu
MAILER-DAEMONuunseenureplieduflaggedudeleteduanswereduPu	forwardedu$Cannot convert to specified type: %sN(u
isinstanceuMaildirMessageu	set_flagsu	get_flagsu
set_subdiru
get_subdiruset_dateuget_dateu_mboxMMDFMessageusetuadd_flaguset_fromutimeugmtimeu	MHMessageuadd_sequenceuBabylMessageu	add_labeluMessageu	TypeErrorutype(uselfumessageuflags((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_explain_toGsN"uMaildirMessage._explain_toN(u__name__u
__module__u__qualname__u__doc__u_type_specific_attributesuNoneu__init__u
get_subdiru
set_subdiru	get_flagsu	set_flagsuadd_flaguremove_flaguget_dateuset_dateuget_infouset_infou_explain_to(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuMaildirMessagescBs�|EeZdZdZdgZddd�Zdd�Zddd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS(u_mboxMMDFMessageu/Message with mbox- or MMDF-specific properties.u_fromcCs}|jdd�t|tjj�ri|j�}|dk	ri|jd�ri|j|dd��qintj	||�dS(u'Initialize an mboxMMDFMessage instance.u
MAILER-DAEMONuFrom iNT(
uset_fromuTrueu
isinstanceuemailumessageuMessageuget_unixfromuNoneu
startswithu__init__(uselfumessageuunixfrom((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__xsu_mboxMMDFMessage.__init__cCs|jS(u Return contents of "From " line.(u_from(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_from�su_mboxMMDFMessage.get_fromcCsN|dk	rA|dkr'tj�}n|dtj|�7}n||_dS(u>Set "From " line, formatting and appending time_ if specified.u NT(uNoneuTrueutimeugmtimeuasctimeu_from(uselfufrom_utime_((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuset_from�s
u_mboxMMDFMessage.set_fromcCs |jdd�|jdd�S(u*Return as a string the flags that are set.uStatusuuX-Status(uget(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	get_flags�su_mboxMMDFMessage.get_flagscCst|�}d
\}}x4dD],}||kr||7}|j|�qqWx4dD],}||krV||7}|j|�qVqVW|djt|��7}y|jd|�Wn"tk
r�|jd|�YnXy|jd|�Wn"tk
r|jd|�YnXd	S(
u)Set the given flags and unset all others.uuRuOuDuFuAuStatusuX-StatusN(uu(uRuO(uDuFuA(useturemoveujoinusortedureplace_headeruKeyErroru
add_header(uselfuflagsustatus_flagsu
xstatus_flagsuflag((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	set_flags�s&





u_mboxMMDFMessage.set_flagscCs0|jdjt|j��t|�B��dS(u.Set the given flag(s) without changing others.uN(u	set_flagsujoinusetu	get_flags(uselfuflag((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuadd_flag�su_mboxMMDFMessage.add_flagcCsKd|ksd|krG|jdjt|j��t|���ndS(u7Unset the given string flag(s) without changing others.uStatusuX-StatusuN(u	set_flagsujoinusetu	get_flags(uselfuflag((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremove_flag�su_mboxMMDFMessage.remove_flagcCs�t|t�r$t|j��}d|kr=|jd�nd|krY|jd�nd|kru|jd�nd|kr�|jd�nd|kr�|jd�n|d	=|d
=dj|j�j�dd
��}y&|j	t
jtj
|d���Wq�ttfk
r Yq�Xnlt|t�r\|j|j��|j|j��n4t|t�r�t|j��}d|kr�|jd�nd|kr�|jd�nd|kr�|jd�n|d	=|d
=n�t|t�rht|j��}d|kr|jd�nd|kr;|jd�nd|krW|jd�n|d	=|d
=n(t|t�rzntdt|���d
S(uACopy mbox- or MMDF-specific state to message insofar as possible.uOucuruFuAuRuSuDuTustatusux-statusu iNu%a %b %d %H:%M:%S %Yuunseenureplieduflaggedudeleteduansweredu$Cannot convert to specified type: %si����(u
isinstanceuMaildirMessageusetu	get_flagsu
set_subdiruadd_flagujoinuget_fromusplituset_dateucalendarutimegmutimeustrptimeu
ValueErroru
OverflowErroru_mboxMMDFMessageu	set_flagsuset_fromu	MHMessageuadd_sequenceuBabylMessageu	add_labeluMessageu	TypeErrorutype(uselfumessageuflagsu
maybe_date((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_explain_to�s^%

u_mboxMMDFMessage._explain_toN(u__name__u
__module__u__qualname__u__doc__u_type_specific_attributesuNoneu__init__uget_fromuset_fromu	get_flagsu	set_flagsuadd_flaguremove_flagu_explain_to(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_mboxMMDFMessagess		u_mboxMMDFMessagecBs|EeZdZdZdS(umboxMessageu&Message with mbox-specific properties.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyumboxMessage�scBsn|EeZdZdZdgZddd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�ZdS(u	MHMessageu$Message with MH-specific properties.u
_sequencescCsg|_tj||�dS(u!Initialize an MHMessage instance.N(u
_sequencesuMessageu__init__(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__�s	uMHMessage.__init__cCs|jdd�S(u4Return a list of sequences that include the message.N(u
_sequences(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_sequences�suMHMessage.get_sequencescCst|�|_dS(u3Set the list of sequences that include the message.N(ulistu
_sequences(uselfu	sequences((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
set_sequences�suMHMessage.set_sequencescCsNt|t�r4||jkrJ|jj|�qJntdt|���dS(u8Add sequence to list of sequences including the message.usequence type must be str: %sN(u
isinstanceustru
_sequencesuappendu	TypeErrorutype(uselfusequence((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuadd_sequence�suMHMessage.add_sequencecCs-y|jj|�Wntk
r(YnXdS(uARemove sequence from the list of sequences including the message.N(u
_sequencesuremoveu
ValueError(uselfusequence((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremove_sequences
uMHMessage.remove_sequencecCs�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(u6Copy MH-specific state to message insofar as possible.uunseenucuruSuflaggeduFureplieduRuROuOuAuansweredu$Cannot convert to specified type: %sN(u
isinstanceuMaildirMessageusetu
get_sequencesu
set_subdiruadd_flagu_mboxMMDFMessageu	MHMessageuadd_sequenceuBabylMessageu	add_labeluMessageu	TypeErrorutype(uselfumessageu	sequencesusequence((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_explain_to	s@


uMHMessage._explain_toN(u__name__u
__module__u__qualname__u__doc__u_type_specific_attributesuNoneu__init__u
get_sequencesu
set_sequencesuadd_sequenceuremove_sequenceu_explain_to(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	MHMessage�s	cBs�|EeZdZdZddgZddd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�ZdS(uBabylMessageu'Message with Babyl-specific properties.u_labelsu_visiblecCs)g|_t�|_tj||�dS(u$Initialize an BabylMessage instance.N(u_labelsuMessageu_visibleu__init__(uselfumessage((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__5s	uBabylMessage.__init__cCs|jdd�S(u'Return a list of labels on the message.N(u_labels(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
get_labels;suBabylMessage.get_labelscCst|�|_dS(u&Set the list of labels on the message.N(ulistu_labels(uselfulabels((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
set_labels?suBabylMessage.set_labelscCsNt|t�r4||jkrJ|jj|�qJntdt|���dS(u+Add label to list of labels on the message.ulabel must be a string: %sN(u
isinstanceustru_labelsuappendu	TypeErrorutype(uselfulabel((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	add_labelCsuBabylMessage.add_labelcCs-y|jj|�Wntk
r(YnXdS(u4Remove label from the list of labels on the message.N(u_labelsuremoveu
ValueError(uselfulabel((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuremove_labelKs
uBabylMessage.remove_labelcCs
t|j�S(u3Return a Message representation of visible headers.(uMessageu_visible(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuget_visibleRsuBabylMessage.get_visiblecCst|�|_dS(u2Set the Message representation of visible headers.N(uMessageu_visible(uselfuvisible((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuset_visibleVsuBabylMessage.set_visiblecCs�xG|jj�D]6}||kr<|jj|||�q|j|=qWx=dD]5}||krQ||jkrQ|||j|<qQqQWdS(	u9Update and/or sensibly generate a set of visible headers.uDateuFromuReply-TouTouCCuSubjectN(uDateuFromuReply-TouTouCCuSubject(u_visibleukeysureplace_header(uselfuheader((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuupdate_visibleZs
uBabylMessage.update_visiblecCst|t�r�t|j��}d|kr=|jd�n|jd�|jd�d|ksod|kr|jd�nd|kr�|jd�nd	|kr|jd
�qnRt|t�r?t|j��}d|kr�|jd�n
|jd�d	|kr |jd
�nd|kr|jd�qn�t|t�r�t|j��}d|kr||jd�nd|kr|jd�qnqt|t	�r�|j
|j��xL|j�D]}|j|�q�Wn(t|t
�r�ntdt|���dS(u9Copy Babyl-specific state to message insofar as possible.uunseenucuruSu	forwardeduresentuPuanswereduRudeleteduTuROuOuDuAurepliedu$Cannot convert to specified type: %sN(u
isinstanceuMaildirMessageusetu
get_labelsu
set_subdiruadd_flagu_mboxMMDFMessageu	MHMessageuadd_sequenceuBabylMessageuset_visibleuget_visibleu	add_labeluMessageu	TypeErrorutype(uselfumessageulabelsulabel((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_explain_toesF


uBabylMessage._explain_toN(u__name__u
__module__u__qualname__u__doc__u_type_specific_attributesuNoneu__init__u
get_labelsu
set_labelsu	add_labeluremove_labeluget_visibleuset_visibleuupdate_visibleu_explain_to(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuBabylMessage0scBs|EeZdZdZdS(uMMDFMessageu&Message with MMDF-specific properties.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuMMDFMessage�scBs�|EeZdZdZd%dd�Zd%dd�Zd%dd�Zd%dd	�Zd%d
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zed#d$��Zd%S(&u
_ProxyFileuA read-only wrapper of a file.cCs4||_|dkr'|j�|_n	||_dS(uInitialize a _ProxyFile.N(u_fileuNoneutellu_pos(uselfufupos((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__�s	u_ProxyFile.__init__cCs|j||jj�S(uRead bytes.(u_readu_fileuread(uselfusize((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuread�su_ProxyFile.readcCs|j||jj�S(uRead bytes.(u_readu_fileuread1(uselfusize((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuread1�su_ProxyFile.read1cCs|j||jj�S(uRead a line.(u_readu_fileureadline(uselfusize((u,/opt/alt/python33/lib64/python3.3/mailbox.pyureadline�su_ProxyFile.readlinecCsWg}xJ|D]B}|j|�|dk	r
|t|�8}|dkrOPqOq
q
W|S(uRead multiple lines.iN(uappenduNoneulen(uselfusizehinturesultuline((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	readlines�s

u_ProxyFile.readlinesccs*x#|j�}|st�n|VqdS(uIterate over lines.N(ureadlineu
StopIteration(uselfuline((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__iter__�s
	u_ProxyFile.__iter__cCs|jS(uReturn the position.(u_pos(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyutell�su_ProxyFile.tellicCsK|dkr"|jj|j�n|jj||�|jj�|_dS(uChange position.iN(u_fileuseeku_posutell(uselfuoffsetuwhence((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuseek�su_ProxyFile.seekcCs>t|d�r:t|jd�r1|jj�n|`ndS(uClose the file.u_fileucloseN(uhasattru_fileuclose(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclose�su_ProxyFile.closecCsJ|dkrd}n|jj|j�||�}|jj�|_|S(u"Read size bytes using read_method.iNi����(uNoneu_fileuseeku_posutell(uselfusizeuread_methoduresult((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_read�s	u_ProxyFile._readcCs|S(u!Context manager protocol support.((uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu	__enter__�su_ProxyFile.__enter__cGs|j�dS(N(uclose(uselfuexc((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__exit__�su_ProxyFile.__exit__cCs
|jj�S(N(u_fileureadable(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyureadable�su_ProxyFile.readablecCs
|jj�S(N(u_fileuwritable(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuwritable�su_ProxyFile.writablecCs
|jj�S(N(u_fileuseekable(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuseekable�su_ProxyFile.seekablecCs
|jj�S(N(u_fileuflush(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuflush�su_ProxyFile.flushcCs3t|d�sdSt|jd�s)dS|jjS(Nu_fileuclosedTF(uhasattruTrueu_fileuFalseuclosed(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclosed�s
u_ProxyFile.closedN(u__name__u
__module__u__qualname__u__doc__uNoneu__init__ureaduread1ureadlineu	readlinesu__iter__utelluseekucloseu_readu	__enter__u__exit__ureadableuwritableuseekableuflushupropertyuclosed(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
_ProxyFile�s$	u
_ProxyFilecBs_|EeZdZdZd
d
dd�Zdd�Zddd�Zd	d
�Zdd�Z	d
S(u_PartialFileu&A read-only wrapper of part of a file.cCs)tj|||�||_||_dS(uInitialize a _PartialFile.N(u
_ProxyFileu__init__u_startu_stop(uselfufustartustop((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu__init__�s	u_PartialFile.__init__cCstj|�|jS(u*Return the position with respect to start.(u
_ProxyFileutellu_start(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyutell�su_PartialFile.tellicCsY|dkr!|j|_d}n!|dkrB|j|_d}ntj|||�dS(u8Change position, possibly with respect to start or stop.iiiN(u_startu_posu_stopu
_ProxyFileuseek(uselfuoffsetuwhence((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuseeks		u_PartialFile.seekcCs`|j|j}|dkr dS|dksD|dksD||krM|}ntj|||�S(u;Read size bytes using read_method, honoring start and stop.isN(u_stopu_posuNoneu
_ProxyFileu_read(uselfusizeuread_methodu	remaining((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_reads$	u_PartialFile._readcCst|d�r|`ndS(Nu_file(uhasattru_file(uself((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuclosesu_PartialFile.closeN(
u__name__u
__module__u__qualname__u__doc__uNoneu__init__utelluseeku_readuclose(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_PartialFile�s
	u_PartialFilec3Cs<d}y�tr�ytj|tjtjB�Wq�tk
r�}z?|jtjtjtj	fkryt
d|j��n�WYdd}~Xq�Xn|r�y!t|jd�}|j
�WnGtk
r}z'|jtjtj	fkr�dS�WYdd}~XnXyfttd�rHtj|j|jd�d}tj|j�n tj|j|jd�d}Wq�tk
r�}za|jtjks�tjdkr�|jtjkr�tj|j�t
d|j��n�WYdd}~Xq�XnWnDtrtj|tj�n|r0tj|jd�n�YnXdS(	u(Lock file f using lockf and dot locking.ulockf: lock unavailable: %sNu.lockulinkuos2udot lock unavailable: %sFT(uFalseufcntlulockfuLOCK_EXuLOCK_NBuIOErroruerrnouEAGAINuEACCESuEROFSuExternalClashErrorunameu_create_temporaryucloseuhasattruosulinkuTrueuunlinkurenameuOSErroruEEXISTuremoveuLOCK_UN(ufudotlockudotlock_doneueupre_lock((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
_lock_filesL!
!u
_lock_filecCsPtrtj|tj�ntjj|jd�rLtj|jd�ndS(u*Unlock file f using lockf and dot locking.u.lockN(ufcntlulockfuLOCK_UNuosupathuexistsunameuremove(uf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_unlock_fileHsu_unlock_filecCsLtj|tjtjBtjBd�}zt|d�SWdtj|�XdS(uCCreate a file if it doesn't exist and open for reading and writing.i�urb+N(uosuopenuO_CREATuO_EXCLuO_RDWRuclose(upathufd((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_create_carefullyOs&u_create_carefullycCs2td|ttj��tj�tj�f�S(uBCreate a temp file based on path and open for reading and writing.u%s.%s.%s.%s(u_create_carefullyuintutimeusocketugethostnameuosugetpid(upath((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_create_temporaryWs	u_create_temporarycCs3|j�ttd�r/tj|j��ndS(u0Ensure changes to file f are physically on disk.ufsyncN(uflushuhasattruosufsyncufileno(uf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_sync_flush]s
u_sync_flushcCst|�|j�dS(u:Close file f, ensuring all changes are physically on disk.N(u_sync_flushuclose(uf((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu_sync_closecs
u_sync_closecBs|EeZdZdZdS(uErroru"Raised for module-specific errors.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuErrorisuErrorcBs|EeZdZdZdS(uNoSuchMailboxErroru:The specified mailbox does not exist and won't be created.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuNoSuchMailboxErrorlsuNoSuchMailboxErrorcBs|EeZdZdZdS(u
NotEmptyErroru>The specified mailbox is not empty and deletion was requested.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu
NotEmptyErrorosu
NotEmptyErrorcBs|EeZdZdZdS(uExternalClashErroru)Another process caused an action to fail.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuExternalClashErrorrsuExternalClashErrorcBs|EeZdZdZdS(uFormatErroru)A file appears to have an invalid format.N(u__name__u
__module__u__qualname__u__doc__(u
__locals__((u,/opt/alt/python33/lib64/python3.3/mailbox.pyuFormatErrorusuFormatError(4u__doc__usysuosutimeucalendarusocketuerrnoucopyuwarningsuemailu
email.messageuemail.generatoruiou
contextlibuplatformuImportErrorufcntluNoneu__all__ulinesepuencodeuMailboxuMaildiru_singlefileMailboxu	_mboxMMDFumboxuMMDFuMHuBabylumessageuMessageuMaildirMessageu_mboxMMDFMessageumboxMessageu	MHMessageuBabylMessageuMMDFMessageu
_ProxyFileu_PartialFileuTrueu
_lock_fileu_unlock_fileu_create_carefullyu_create_temporaryu_sync_flushu_sync_closeu	ExceptionuErroruNoSuchMailboxErroru
NotEmptyErroruExternalClashErroruFormatError(((u,/opt/alt/python33/lib64/python3.3/mailbox.pyu<module>sj	
��C�B4-�5�%mqH_a'-

Hacked By AnonymousFox1.0, Coded By AnonymousFox