Home | History | Annotate | Download | only in python2.7

Lines Matching defs:MH

0 """MH interface -- purely object-oriented (well, almost)
7 mh = mhlib.MH() # use default mailbox directory and profile
8 mh = mhlib.MH(mailbox) # override mailbox location (default from profile)
9 mh = mhlib.MH(mailbox, profile) # override mailbox and profile
11 mh.error(format, ...) # print error message -- can be overridden
12 s = mh.getprofile(key) # profile entry (None if not set)
13 path = mh.getpath() # mailbox pathname
14 name = mh.getcontext() # name of current folder
15 mh.setcontext(name) # set name of current folder
17 list = mh.listfolders() # names of top-level folders
18 list = mh.listallfolders() # names of all folders, including subfolders
19 list = mh.listsubfolders(name) # direct subfolders of given folder
20 list = mh.listallsubfolders(name) # all subfolders of given folder
22 mh.makefolder(name) # create new folder
23 mh.deletefolder(name) # delete folder -- must have no subfolders
25 f = mh.openfolder(name) # new open folder object
27 f.error(format, ...) # same as mh.error(format, ...)
87 __all__ = ["MH","Error","Folder","Message"]
95 class MH:
98 containing the collection, and the MH profile to use.
100 directory is taken from the MH profile if it is specified there."""
111 if not os.path.isdir(path): raise Error, 'MH() path not found'
116 return 'MH(%r, %r)' % (self.path, self.profile)
120 sys.stderr.write('MH error: %s\n' % (msg % args))
245 def __init__(self, mh, name):
247 self.mh = mh
254 return 'Folder(%r, %r)' % (self.mh, self.name)
258 self.mh.error(*args)
262 return os.path.join(self.mh.path, self.name)
274 return self.mh.listsubfolders(self.name)
278 return self.mh.listallsubfolders(self.name)
347 """Parse an MH sequence specification into a message list.
348 Attempt to mimic mh-sequence(5) as close as possible.
351 # XXX Still not complete (see mh-format(5)).
963 global mh, f
965 mh = MH()
967 do('mh.listfolders()')
968 do('mh.listallfolders()')
972 for t in testfolders: do('mh.makefolder(%r)' % (t,))
973 do('mh.listsubfolders(\'@test\')')
974 do('mh.listallsubfolders(\'@test\')')
975 f = mh.openfolder('@test')
984 for t in reversed(testfolders): do('mh.deletefolder(%r)' % (t,))
985 do('mh
986 context = mh.getcontext()
987 f = mh.openfolder(context)