| |
- Folder
- IntSet
- MH
- mimetools.Message(rfc822.Message)
-
- Message
-
- SubMessage
class Folder |
|
no doc string |
| |
- __init__(self, mh, name)
- # Constructor
- __repr__(self)
- # String representation
- _copysequences(self, fromfolder, refileditems)
- # Helper for refilemessages() to copy sequences
- _parseindex(self, seq, all)
- # Internal: parse a message number (or cur, first, etc.)
- copymessage(self, n, tofolder, ton)
- # Copy one message over a specific destination message,
- # which may or may not already exist.
- createmessage(self, n, txt)
- # Create a message, with text from the open file txt.
- error(self, *args)
- # Error message handler
- getcurrent(self)
- # Return the current message. Raise KeyError when there is none
- getfullname(self)
- # Return the full pathname of the folder
- getlast(self)
- # Return the last message number
- getmessagefilename(self, n)
- # Return the full pathname of a message in the folder
- getsequences(self)
- # Return the set of sequences for the folder
- getsequencesfilename(self)
- # Return the full pathname of the folder's sequences file
- listallsubfolders(self)
- # Return list of all subfolders
- listmessages(self)
- # Return the list of messages currently present in the folder.
- # As a side effect, set self.last to the last message (or 0)
- listsubfolders(self)
- # Return list of direct subfolders
- movemessage(self, n, tofolder, ton)
- # Move one message over a specific destination message,
- # which may or may not already exist.
- openmessage(self, n)
- # Open a message -- returns a Message object
- parsesequence(self, seq)
- # Parse 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
- putsequences(self, sequences)
- # Write the set of sequences back to the folder
- refilemessages(self, list, tofolder, keepsequences=0)
- # Refile one or more messages -- may raise os.error.
- # 'tofolder' is an open folder object
- removefromallsequences(self, list)
- # Remove one or more messages from all sequeuces (including last)
- # -- but not from 'cur'!!!
- removemessages(self, list)
- # Remove one or more messages -- may raise os.error
- setcurrent(self, n)
- # Set the current message
- setlast(self, last)
- # Set the last message number
|
class IntSet |
|
# Class 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.
#
# XXX The default begin/end separator means that negative numbers are
# not supported very well.
#
# XXX There are currently no operations to remove set elements.
|
| |
- __cmp__(self, other)
- no doc string
- __hash__(self)
- no doc string
- __init__(self, data=None, sep=',', rng='-')
- no doc string
- __repr__(self)
- no doc string
- addpair(self, xlo, xhi)
- no doc string
- append(self, x)
- no doc string
- clone(self)
- no doc string
- contains(self, x)
- no doc string
- fromlist(self, list)
- no doc string
- fromstring(self, data)
- no doc string
- max(self)
- no doc string
- min(self)
- no doc string
- normalize(self)
- no doc string
- reset(self)
- no doc string
- tolist(self)
- no doc string
- tostring(self)
- no doc string
|
class MH |
|
# 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.
|
| |
- __init__(self, path=None, profile=None)
- # Constructor
- __repr__(self)
- # String representation
- deletefolder(self, name)
- # Delete a folder. This removes files in the folder but not
- # subdirectories. If deleting the folder itself fails it
- # raises os.error
- error(self, msg, *args)
- # Routine to print an error. May be overridden by a derived class
- getcontext(self)
- # Return the name of the current folder
- getpath(self)
- # Return the path (the name of the collection's directory)
- getprofile(self, key)
- # Return a profile entry, None if not found
- listallfolders(self)
- # Return the names of all folders, including subfolders, recursively
- listallsubfolders(self, name)
- # Return the names of subfolders in a given folder, recursively
- listfolders(self)
- # Return the names of the top-level folders
- listsubfolders(self, name)
- # Return the names of the subfolders in a given folder
- # (prefixed with the given folder name)
- makefolder(self, name)
- # Create a new folder. This raises os.error if the folder
- # cannot be created
- openfolder(self, name)
- # Return a new Folder object for the named folder
- setcontext(self, context)
- # Set the name of the current folder
|
class Message(mimetools.Message) |
|
no doc string |
| |
- __init__(self, f, n, fp=None)
- # Constructor
- __repr__(self)
- # String representation
- getbody(self)
- # Return body, either a string or a list of messages
- getbodyparts(self)
- # Only for multipart messages: return the message's body as a
- # list of SubMessage objects. Each submessage object behaves
- # (almost) as a Message object.
- getbodytext(self, decode=1)
- # Return 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 to
- # decoding, pass a 0 as argument
- getheadertext(self, pred=None)
- # Return 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).
|
|