%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/mhlib.pyo


Mac@s|dZddlmZeddd[dZdZdZd	Zdd
lZdd
lZdd
l	Z	dd
l
Z
dd
lZdd
lZddl
m
Z
dd
ddgZd
efdYZdfdYZe	jdZdZdfdYZde
jfdYZdefdYZdfdYZddZddZdZedkrxend
S(s	MH interface -- purely object-oriented (well, almost)

Executive summary:

import mhlib

mh = mhlib.MH()         # use default mailbox directory and profile
mh = mhlib.MH(mailbox)  # override mailbox location (default from profile)
mh = mhlib.MH(mailbox, profile) # override mailbox and profile

mh.error(format, ...)   # print error message -- can be overridden
s = mh.getprofile(key)  # profile entry (None if not set)
path = mh.getpath()     # mailbox pathname
name = mh.getcontext()  # name of current folder
mh.setcontext(name)     # set name of current folder

list = mh.listfolders() # names of top-level folders
list = mh.listallfolders() # names of all folders, including subfolders
list = mh.listsubfolders(name) # direct subfolders of given folder
list = mh.listallsubfolders(name) # all subfolders of given folder

mh.makefolder(name)     # create new folder
mh.deletefolder(name)   # delete folder -- must have no subfolders

f = mh.openfolder(name) # new open folder object

f.error(format, ...)    # same as mh.error(format, ...)
path = f.getfullname()  # folder's full pathname
path = f.getsequencesfilename() # full pathname of folder's sequences file
path = f.getmessagefilename(n)  # full pathname of message n in folder

list = f.listmessages() # list of messages in folder (as numbers)
n = f.getcurrent()      # get current message
f.setcurrent(n)         # set current message
list = f.parsesequence(seq)     # parse msgs syntax into list of messages
n = f.getlast()         # get last message (0 if no messagse)
f.setlast(n)            # set last message (internal use only)

dict = f.getsequences() # dictionary of sequences in folder {name: list}
f.putsequences(dict)    # write sequences back to folder

f.createmessage(n, fp)  # add message from file f as number n
f.removemessages(list)  # remove messages in list from folder
f.refilemessages(list, tofolder) # move messages in list to other folder
f.movemessage(n, tofolder, ton)  # move one message to a given destination
f.copymessage(n, tofolder, ton)  # copy one message to a given destination

m = f.openmessage(n)    # new open message object (costs a file descriptor)
m is a derived class of mimetools.Message(rfc822.Message), with:
s = m.getheadertext()   # text of message's headers
s = m.getheadertext(pred) # text of message's headers, filtered by pred
s = m.getbodytext()     # text of message's body, decoded
s = m.getbodytext(0)    # text of message's body, not decoded
i(twarnpy3ksOthe mhlib module has been removed in Python 3.0; use the mailbox module insteadt
stacklevelis
~/.mh_profiles~/Mails
.mh_sequencesiN(tbisecttMHtErrortFoldertMessagecBseZRS((t__name__t
__module__(((s!/usr/local/lib/python2.7/mhlib.pyR[scBseZdZdddZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZd
ZdZRS(s<Class representing a particular collection of folders.
    Optional constructor arguments are the pathname for the directory
    containing the collection, and the MH profile to use.
    If either is omitted or empty a default is used; the default
    directory is taken from the MH profile if it is specified there.cCs|dkrt}ntjj||_|dkrH|jd}n|sWt}ntjj|r|ddkrtjj	d|}ntjj|}tjj
|stdn||_dS(sConstructor.tPathit~sMH() path not foundN(tNonet
MH_PROFILEtostpatht
expandusertprofilet
getprofiletPATHtisabstjointisdirR(tselfRR((s!/usr/local/lib/python2.7/mhlib.pyt__init__fs		#cCsd|j|jfS(sString representation.s
MH(%r, %r)(RR(R((s!/usr/local/lib/python2.7/mhlib.pyt__repr__rscGstjjd||dS(sARoutine to print an error.  May be overridden by a derived class.s
MH error: %s
N(tsyststderrtwrite(Rtmsgtargs((s!/usr/local/lib/python2.7/mhlib.pyterrorvscCst|j|S(s*Return a profile entry, None if not found.(tpicklineR(Rtkey((s!/usr/local/lib/python2.7/mhlib.pyRzscCs|jS(s9Return the path (the name of the collection's directory).(R(R((s!/usr/local/lib/python2.7/mhlib.pytgetpath~scCs7ttjj|jdd}|s3d}n|S(s&Return the name of the current folder.tcontextsCurrent-Foldertinbox(RR
RRR!(RR"((s!/usr/local/lib/python2.7/mhlib.pyt
getcontexts
		cCsItjj|jd}t|d}|jd||jdS(s#Set the name of the current folder.R"twsCurrent-Folder: %s
N(R
RRR!topenRtclose(RR"tfntf((s!/usr/local/lib/python2.7/mhlib.pyt
setcontextscCsqg}|j}xNtj|D]=}tjj||}tjj|r"|j|q"q"W|j|S(s*Return the names of the top-level folders.(R!R
tlistdirRRRtappendtsort(RtfoldersRtnametfullname((s!/usr/local/lib/python2.7/mhlib.pytlistfolderss
c	Cstjj|j|}tj|j}|dkr:gSg}tj|}xt|D]l}tjj||}tjj|rVtjj||}|j||d}|dkrPqqVqVW|j|S(scReturn the names of the subfolders in a given folder
        (prefixed with the given folder name).ii(	R
RRtstattst_nlinkR+RR,R-(	RR/R0tnlinkst
subfolderstsubnamestsubnametfullsubnametname_subname((s!/usr/local/lib/python2.7/mhlib.pytlistsubfolderss 



cCs
|jdS(s<Return the names of all folders and subfolders, recursively.t(tlistallsubfolders(R((s!/usr/local/lib/python2.7/mhlib.pytlistallfolderssc
Cs$tjj|j|}tj|j}|dkr:gSg}tj|}x|D]}|ddksVt|r~qVntjj||}tjj|rVtjj||}|j|tjj	|s|j
|}	||	}n|d}|dkrPqqVqVW|j|S(s>Return the names of subfolders in a given folder, recursively.iit,i(R
RRR2R3R+t	isnumericRR,tislinkR<R-(
RR/R0R4R5R6R7R8R9t
subsubfolders((s!/usr/local/lib/python2.7/mhlib.pyR<s,

	


cCs
t||S(s0Return a new Folder object for the named folder.(R(RR/((s!/usr/local/lib/python2.7/mhlib.pyt
openfolderscCset|jd}|r6t|r6t|d}nt}tjtjj|j	||dS(s@Create a new folder (or raise os.error if it cannot be created).sFolder-ProtectiN(
RRR?tinttFOLDER_PROTECTR
tmkdirRRR!(RR/tprotecttmode((s!/usr/local/lib/python2.7/mhlib.pyt
makefolders
cCstjj|j|}xetj|D]T}tjj||}ytj|Wq+tjk
r~|jd|q+Xq+Wtj|dS(sDelete a folder.  This removes files in the folder but not
        subdirectories.  Raise os.error if deleting the folder itself fails.s%s not deleted, continuing...N(R
RRR!R+tunlinkRtrmdir(RR/R0R7R8((s!/usr/local/lib/python2.7/mhlib.pytdeletefolders	N(RRt__doc__RRRRRR!R$R*R1R:R=R<RBRHRK(((s!/usr/local/lib/python2.7/mhlib.pyR_s													s
^[1-9][0-9]*$cCstj|dk	S(N(tnumericprogtmatchR(tstr((s!/usr/local/lib/python2.7/mhlib.pyR?scBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZddZdZdZdZdZdZdZdZRS(s'Class representing a particular folder.cCs>||_||_tjj|js:td|ndS(sConstructor.sno folder %sN(tmhR/R
RRtgetfullnameR(RRPR/((s!/usr/local/lib/python2.7/mhlib.pyRs		cCsd|j|jfS(sString representation.sFolder(%r, %r)(RPR/(R((s!/usr/local/lib/python2.7/mhlib.pyRscGs|jj|dS(sError message handler.N(RPR(RR((s!/usr/local/lib/python2.7/mhlib.pyRscCstjj|jj|jS(s'Return the full pathname of the folder.(R
RRRPR/(R((s!/usr/local/lib/python2.7/mhlib.pyRQscCstjj|jtS(s8Return the full pathname of the folder's sequences file.(R
RRRQtMH_SEQUENCES(R((s!/usr/local/lib/python2.7/mhlib.pytgetsequencesfilenamescCstjj|jt|S(s4Return the full pathname of a message in the folder.(R
RRRQRO(Rtn((s!/usr/local/lib/python2.7/mhlib.pytgetmessagefilenamescCs|jj|jS(s!Return list of direct subfolders.(RPR:R/(R((s!/usr/local/lib/python2.7/mhlib.pyR:scCs|jj|jS(sReturn list of all subfolders.(RPR<R/(R((s!/usr/local/lib/python2.7/mhlib.pyR<scCsg}tj}|j}x6tj|jD]}||r.||q.q.Wtt|}|j|r|d|_	n	d|_	|S(sReturn the list of messages currently present in the folder.
        As a side effect, set self.last to the last message (or 0).ii(
RMRNR,R
R+RQtmapRCR-tlast(RtmessagesRNR,R/((s!/usr/local/lib/python2.7/mhlib.pytlistmessagess		
	cCsi}|j}yt|d}Wntk
r9|SXx|j}|sSPn|jd}t|dkr|jd||jfn|dj}t|djdj	}|||<q=W|S(s+Return the set of sequences for the folder.trt:isbad sequence in %s: %siit (
RSR&tIOErrortreadlinetsplittlenRtstriptIntSetttolist(Rt	sequencesR0R)tlinetfieldsR tvalue((s!/usr/local/lib/python2.7/mhlib.pytgetsequences)s$
	cCs|j}d}xk|jD]]\}}tdd}|j||s_t|d}n|jd||jfqW|sytj	|Wqtj
k
rqXn
|jdS(s.Write the set of sequences back to the folder.R;R\R%s%s: %s
N(RSRt	iteritemsRbtfromlistR&RttostringR
RIRR'(RRdR0R)R tseqts((s!/usr/local/lib/python2.7/mhlib.pytputsequences=s
!cCsE|j}yt|dSWn ttfk
r@tdnXdS(s<Return the current message.  Raise Error when there is none.tcursno cur messageN(Rhtmaxt
ValueErrortKeyErrorR(Rtseqs((s!/usr/local/lib/python2.7/mhlib.pyt
getcurrentNs
cCs#t|jdt|ddS(sSet the current message.RoiN(t
updatelineRSRO(RRT((s!/usr/local/lib/python2.7/mhlib.pyt
setcurrentVscCsL|j}|s%td|jn|dkr5|S|jd}|dkr
|| d||d}}}|d dkr|d |d}}nt|std|nyt|}Wn#ttfk
rt|}nXy|j	||}Wntk
r}	|j
}
||
krV|	s=d|}	nt|	tjd	n|
|}|svtd
|n|dkr||S|| Sq
X|s|dkrd}qn|dkrt
||}|td|||!St
||d}||||!Sn|jd}|dkr|j	|| |}|j	||d|}
t
||d}t
||
}|||!}|std|n|Sy|j	||}WnOtk
r}	|j
}
||
kr|	sd|}	nt|	n|
|SX||krAt|r1td|qHtd|n|gSdS(sParse an MH sequence specification into a message list.
        Attempt to mimic mh-sequence(5) as close as possible.
        Also attempt to mimic observed behavior regarding which
        conditions cause which error messages.sno messages in %stallR[iR;is-+sbad message list %sissequence %s emptyt-tprevRWsmessage %d doesn't exists
no %s messageN(RyRW(RYRR/tfindR?RCRqt
OverflowErrorR`t_parseindexRhRtexc_infoRRp(RRlRwtitheadtdirttailtcounttanchorRRstmsgstbegintendtjRZRT((s!/usr/local/lib/python2.7/mhlib.pyt
parsesequenceZs|	 

	

	cCsLt|r;yt|SWq;ttfk
r7tjSXn|d
krQ|jS|dkre|dS|dkry|dS|dkr|j}t||}y||SWqtk
rt	dqXn|d	kr?|j}t||d
}|dkrt	dny||d
SWq?tk
r;t	dq?Xnt	ddS(s7Internal: parse a message number (or cur, first, etc.).Rot.tfirstiRWitnextsno next messageRyisno prev messageN(RoR(R?RCR{RqRtmaxintRtRt
IndexErrorRR(RRlRwRTR~((s!/usr/local/lib/python2.7/mhlib.pyR|s8


cCs
t||S(s+Open a message -- returns a Message object.(R(RRT((s!/usr/local/lib/python2.7/mhlib.pytopenmessagescCsg}g}x|D]}|j|}|jdt|}ytj|Wntjk
rhnXytj||Wn#tjk
r}|j|qX|j|qW|r|j|n|r
t|dkrtj|dq
tjd|fndS(s2Remove one or more messages -- may raise os.error.R>iismultiple errors:N(	RUROR
RIRtrenameR,tremovefromallsequencesR`(RtlistterrorstdeletedRTRt	commapathR((s!/usr/local/lib/python2.7/mhlib.pytremovemessagess(
icCsg}i}x|D]}|jd}|j|}|j|}	ytj||	Wntjk
ry!tj||	tj|Wqttjfk
r}
|j	|
ytj|	Wqtjk
rqXqqXnX|j
||||<qW|r@|r*|j||jn|j
|jn|rt|dkrktj|dqtjd|fndS(s_Refile one or more messages -- may raise os.error.
        'tofolder' is an open folder object.iismultiple errors:N(tgetlastRUR
RRtshutiltcopy2RIR]R,tsetlastt_copysequencestitemsRtkeysR`(RRttofoldert
keepsequencesRtrefiledRTttonRttopathR((s!/usr/local/lib/python2.7/mhlib.pytrefilemessagess:


cCs|j}|j}d}x|jD]\}}y||}d}	Wntk
rjg}d}	nXx6|D].\}
}|
|krr|j|d}qrqrW|	r+|r+|||<q+q+W|r|j|ndS(s.Helper for refilemessages() to copy sequences.iiN(RhRRrR,Rn(Rt
fromfoldertrefileditemst
fromsequencesttosequencestchangedR/RlttoseqtnewtfromnR((s!/usr/local/lib/python2.7/mhlib.pyR
s$





c	Cs#|j|}t|}|j~|j|}|jd|}ytj||Wntjk
rtnXytj||Wntjk
rd}z'|jdtj	||d}Wd|sytj
|Wqtjk
rqXnXtj
|nX|j|gdS(saMove one message over a specific destination message,
        which may or may not already exist.s,%diiN(RUR&R'R
RRRRRRRIR(	RRTRRRR)Rtbackuptopathtok((s!/usr/local/lib/python2.7/mhlib.pytmovemessage"s2


c	Cs|j|}t|}|j~|j|}|jd|}ytj||Wntjk
rtnXd}z'|jdtj	||d}Wd|sytj
|Wqtjk
rqXnXdS(saCopy one message over a specific destination message,
        which may or may not already exist.s,%diiN(RUR&R'R
RRRRRRRI(	RRTRRRR)RRR((s!/usr/local/lib/python2.7/mhlib.pytcopymessageBs(


c	Cs|j|}|jd|}ytj||Wntjk
rLnXd}d}zPt|d}x*|j|}|sPn|j|qnW|jd}Wd|sytj|Wqtjk
rqXnXdS(	s3Create a message, with text from the open file txt.s,%diiiR%iNi@(	RUR
RRR&treadRR'RI(	RRTttxtRt
backuppathRtBUFSIZER)tbuf((s!/usr/local/lib/python2.7/mhlib.pyt
createmessage\s,

cCst|dr'|j|kr'|`n|j}d}xo|jD]a\}}|dkrdqFnx@|D]8}||krk|j|d}|s||=qqkqkWqFW|r|j|ndS(s`Remove one or more messages from all sequences (including last)
        -- but not from 'cur'!!!RWiRoiN(thasattrRWRhRtremoveRn(RRRdRR/RlRT((s!/usr/local/lib/python2.7/mhlib.pyRvs	

cCs#t|ds|jn|jS(sReturn the last message number.RW(RRYRW(R((s!/usr/local/lib/python2.7/mhlib.pyRs
cCs4|dkr't|dr0|`q0n	||_dS(sSet the last message number.RWN(RRRW(RRW((s!/usr/local/lib/python2.7/mhlib.pyRs(RRRLRRRRQRSRUR:R<RYRhRnRtRvRR|RRRRRRRRRR(((s!/usr/local/lib/python2.7/mhlib.pyRs4														T			#		 				cBsGeZddZdZddZddZdZdZRS(cCsV||_||_|dkr?|j|}t|d}ntjj||dS(sConstructor.RZN(tfoldertnumberRRUR&t	mimetoolsRR(RR)RTtfpR((s!/usr/local/lib/python2.7/mhlib.pyRs		cCsdt|j|jfS(sString representation.sMessage(%s, %s)(treprRR(R((s!/usr/local/lib/python2.7/mhlib.pyRscCs|dkrdj|jSg}d}xn|jD]c}|djs|jd}|dkr||| j}qn|r2|j|q2q2Wdj|S(sReturn the message's header text as a string.  If an
        argument is specified, it is used as a filter predicate to
        decide which headers to return (its argument is the header
        name converted to lower case).R;iR[N(RRtheaderstisspaceRztlowerR,(RtpredRthitReR~((s!/usr/local/lib/python2.7/mhlib.pyt
getheadertextsicCs|jj|j|j}|s2|dkr?|jjSyddlm}Wn!tk
rvddlm}nX|}tj	|j|||j
S(sReturn the message's body text as string.  This undoes a
        Content-Transfer-Encoding, but does not interpret other MIME
        features (e.g. multipart messages).  To suppress decoding,
        pass 0 as an argument.R;t7bitt8bittbinaryi(tStringIO(R;RRR(RtseektstartofbodytgetencodingRt	cStringIORtImportErrorRtdecodetgetvalue(RRtencodingRtoutput((s!/usr/local/lib/python2.7/mhlib.pytgetbodytexts

	cCs|jdkrtdn|jd}|s?tdn|jj|jtj|j}|j|g}xO|j	rd|j
dt|f}t|j
||}|j|qzW|j|S(sOnly for multipart messages: return the message's body as a
        list of SubMessage objects.  Each submessage object behaves
        (almost) as a Message object.t	multipartsContent-Type is not multipart/*tboundarys"multipart/* without boundary params%s.%ri(tgetmaintypeRtgetparamRRRt	multifilet	MultiFiletpushRRR`t
SubMessageRR,tpop(RtbdrytmftpartsRTtpart((s!/usr/local/lib/python2.7/mhlib.pytgetbodypartss

cCs*|jdkr|jS|jSdS(s3Return body, either a string or a list of messages.RN(RRR(R((s!/usr/local/lib/python2.7/mhlib.pytgetbodys
N(	RRRRRRRRR(((s!/usr/local/lib/python2.7/mhlib.pyRs			RcBs8eZdZdZddZdZdZRS(cCsktj|||||jdkr=tj||_ntj||_tj|dd|_dS(sConstructor.RRiN(RRRRtbodyRtbodyencoded(RR)RTR((s!/usr/local/lib/python2.7/mhlib.pyRs
cCs.|j|j|j}}}d|||fS(sString representation.sSubMessage(%s, %s, %s)(RRR(RR)RTR((s!/usr/local/lib/python2.7/mhlib.pyRsicCs3|s
|jSt|jtdkr/|jSdS(NR;(RttypeR(RR((s!/usr/local/lib/python2.7/mhlib.pyRscCs&t|jtgkr"|jSdS(N(RR(R((s!/usr/local/lib/python2.7/mhlib.pyRscCs|jS(N(R(R((s!/usr/local/lib/python2.7/mhlib.pyRs(RRRRRRR(((s!/usr/local/lib/python2.7/mhlib.pyRs
	
		RbcBseZdZddddZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZRS(sClass implementing sets of integers.

    This is an efficient representation for sets consisting of several
    continuous ranges, e.g. 1-100,200-400,402-1000 is represented
    internally as a list of three pairs: [(1,100), (200,400),
    (402,1000)].  The internal representation is always kept normalized.

    The constructor has up to three arguments:
    - the string used to initialize the set (default ''),
    - the separator between ranges (default ',')
    - the separator between begin and end of a range (default '-')
    The separators must be strings (not regexprs) and should be different.

    The tostring() function yields a string that can be passed to another
    IntSet constructor; __repr__() is a valid IntSet constructor itself.
    R>RxcCs5g|_||_||_|r1|j|ndS(N(tpairstseptrngt
fromstring(RtdataRR((s!/usr/local/lib/python2.7/mhlib.pyRs
			cCs
g|_dS(N(R(R((s!/usr/local/lib/python2.7/mhlib.pytreset scCst|j|jS(N(tcmpR(Rtother((s!/usr/local/lib/python2.7/mhlib.pyt__cmp__#scCs
t|jS(N(thashR(R((s!/usr/local/lib/python2.7/mhlib.pyt__hash__&scCsd|j|j|jfS(NsIntSet(%r, %r, %r)(RkRR(R((s!/usr/local/lib/python2.7/mhlib.pyR)scCs|jjd}x|t|jkr|j|d\}}|j|\}}||dkr|t||fg|j|d|d+q|d}qWdS(Ni(RR-R`Rp(RR~talotahitblotbhi((s!/usr/local/lib/python2.7/mhlib.pyt	normalize,s
-cCs|d}xo|jD]d\}}||kr7t|}nt||jt|}|rn||j|}q|}qW|S(NR;(RRRR(RRmtlothitt((s!/usr/local/lib/python2.7/mhlib.pyRk7s
cCsAg}x4|jD])\}}t||d}||}qW|S(Ni(Rtrange(RtlRRtm((s!/usr/local/lib/python2.7/mhlib.pyRc@s
cCs"x|D]}|j|qWdS(N(R,(RRR~((s!/usr/local/lib/python2.7/mhlib.pyRjGs
cCst}|j|_|S(N(RbR(RR((s!/usr/local/lib/python2.7/mhlib.pytcloneKs	
cCs|jddS(Ni(R(R((s!/usr/local/lib/python2.7/mhlib.pytminPscCs|jddS(Ni(R(R((s!/usr/local/lib/python2.7/mhlib.pyRpSscCs>x7|jD],\}}||ko-|knr
tSq
WtS(N(RtTruetFalse(RtxRR((s!/usr/local/lib/python2.7/mhlib.pytcontainsVscCsqxtt|jD]}|j|\}}||kr|d|kra||f|j|<n|jj|||f|dkr|d|j|ddkr|j|dd|j|dfg|j|d|d+ndS||krdSqWt|jd}|dkrW|j|\}}|d|krW||f|j|<dSn|jj||fdS(Nii(RR`RtinsertR,(RRR~RR((s!/usr/local/lib/python2.7/mhlib.pyR,[s&+,cCs4||krdS|jj||f|jdS(N(RR,R(Rtxlotxhi((s!/usr/local/lib/python2.7/mhlib.pytaddpairtscCsg}x|j|jD]}g}x9|j|jD]%}|j}|jt|q8Wt|dkr|j|d|dfqt|dkr|d|dkr|j|d|dfqtdqW|j||_|j	dS(Niiisbad data passed to IntSet(
R_RRRaR,RCR`RqRR(RRRRRtsubpRm((s!/usr/local/lib/python2.7/mhlib.pyRys&
N(RRRLRRRRRRRRkRcRjRRRpRR,RR(((s!/usr/local/lib/python2.7/mhlib.pyRbs"															icCsyt|d}Wntk
r'dSXtj|d}tj||oPtj}x|j}|soPn|j|rY|t	|d}x6|j}|s|dj
rPn||}qW|jSqYWdS(NRZR[ii(R&R]Rtretescapetcompilet
IGNORECASER^RNR`RRa(tfileR tcasefoldR)tpattprogRettext((s!/usr/local/lib/python2.7/mhlib.pyRs&
cCsay)t|d}|j}|jWntk
rBg}nXtj|d}tj||oktj}|dkrd}nd||f}xst	t
|D]C}	||	}
|j|
r|dkr||	=n
|||	<PqqW|dk	r|j|n|d}t|d}x|D]}
|j
|
q,W|jtj||dS(NRZs:(.*)
s%s: %s
R
R%(R&t	readlinesR'R]RRRRRRR`RNR,RR
R(RR RgRR)tlinesR	R
tnewlineR~Rettempfile((s!/usr/local/lib/python2.7/mhlib.pyRus4

	





c	Cstjdtad}|d|dddddd	d
g}x|D]}|d|fqRW|d|d
tjda|d|d|dtj}tddj|d<|GHtj	||dx%t
|D]}|d|fqW|dtj}tj|a|dx|d/D]t}y|d*|fWntk
r}d+G|GHnXtj
d,|fj}tt|j}|Gd-GHqMW|d.dS(0Nsrm -rf $HOME/Mail/@testcSs|GHt|GHdS(N(teval(Rm((s!/usr/local/lib/python2.7/mhlib.pytdossmh.listfolders()smh.listallfolders()s@tests@test/test1s@test/test2s@test/test1/test11s@test/test1/test12s@test/test1/test11/test111smh.makefolder(%r)smh.listsubfolders('@test')smh.listallsubfolders('@test')sf.listsubfolders()sf.listallsubfolders()sf.getsequences()s
1-10 12-20R\tfoosmh.deletefolder(%r)smh.getcontext()sf.getcurrent()RRWRoRRyRsfirst:3slast:3scur:3scur:-3sprev:3snext:3s1:3s1:-3s100:3s100:-3s10000:3s10000:-3Rwsf.parsesequence(%r)sError:spick %r 2>/dev/nulls<-- picksf.listmessages()(RRWRoRRyRsfirst:3slast:3scur:3scur:-3sprev:3snext:3s1:3s1:-3s100:3s100:-3s10000:3s10000:-3Rw(R
tsystemRRPRBR)RhRbRcRntreversedR$RtpopenRRVRCR_(	RttestfoldersRRsR"RlRtstuffR((s!/usr/local/lib/python2.7/mhlib.pyttestsP
		

		












t__main__(RLtwarningsRRRRRRDR
RRRRRRt__all__t	ExceptionRRRRMR?RRRRbRRuRR(((s!/usr/local/lib/python2.7/mhlib.pyt<module>6s<	
	M"	*

Zerion Mini Shell 1.0