|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21571/root/usr/lib64/python2.4/ |
Upload File : |
m
=5Dc @ sF d Z d Z d Z d Z d Z d k Z d k Z d k Z d k Z d k Z d k
Z
d k l Z d d d d
g Z d e
f d YZ d f d YZ e i d
Z d Z d f d YZ d
e i f d YZ d e f d YZ d f d YZ d d Z d d Z d Z e d j o e n d 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
s
~/.mh_profiles ~/Mails
.mh_sequencesi N( s bisectt MHt Errort Foldert Messagec B s t Z RS( N( t __name__t
__module__( ( ( t /usr/lib64/python2.4/mhlib.pyR W s c B s t Z d Z e e d Z d Z d Z d Z d Z d Z d Z
d Z d Z d
Z
d Z d Z d
Z d Z RS( 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.c C s | d j o
t } n t i i | | _ | d j o | i d } n | p
t } n t i i | o* | d d j o t i i
d | } n t i i | } t i i | p
t d n | | _ d S( s Constructor.t Pathi t ~s MH() path not foundN(
t profilet Nonet
MH_PROFILEt ost patht
expandusert selft
getprofilet PATHt isabst joint isdirR ( R R
R ( ( R t __init__b s
%
c C s d | i | i f S( s String representation.s
MH(%r, %r)N( R R
R ( R ( ( R t __repr__n s c G s t i i d | | d S( sA Routine to print an error. May be overridden by a derived class.s
MH error: %s
N( t syst stderrt writet msgt args( R R R ( ( R t errorr s c C s t | i | S( s* Return a profile entry, None if not found.N( t picklineR R t key( R R ( ( R R v s c C s | i S( s9 Return the path (the name of the collection's directory).N( R R
( R ( ( R t getpathz s c C s9 t t i i | i d d } | p
d } n | S( s&