Module mhlib :: Class Folder
[hide private]
[frames] | no frames]

_ClassType Folder

Class representing a particular folder.

Instance Methods [hide private]
 
__init__(self, mh, name)
Constructor.
 
__repr__(self)
String representation.
 
error(self, *args)
Error message handler.
 
getfullname(self)
Return the full pathname of the folder.
 
getsequencesfilename(self)
Return the full pathname of the folder's sequences file.
 
getmessagefilename(self, n)
Return the full pathname of a message in the folder.
 
listsubfolders(self)
Return list of direct subfolders.
 
listallsubfolders(self)
Return list of all subfolders.
 
listmessages(self)
Return the list of messages currently present in the folder.
 
getsequences(self)
Return the set of sequences for the folder.
 
putsequences(self, sequences)
Write the set of sequences back to the folder.
 
getcurrent(self)
Return the current message.
 
setcurrent(self, n)
Set the current message.
 
parsesequence(self, seq)
Parse an MH sequence specification into a message list.
 
_parseindex(self, seq, all)
Internal: parse a message number (or cur, first, etc.).
 
openmessage(self, n)
Open a message -- returns a Message object.
 
removemessages(self, list)
Remove one or more messages -- may raise os.error.
 
refilemessages(self, list, tofolder, keepsequences=0)
Refile one or more messages -- may raise os.error.
 
_copysequences(self, fromfolder, refileditems)
Helper for refilemessages() to copy sequences.
 
movemessage(self, n, tofolder, ton)
Move one message over a specific destination message, which may or may not already exist.
 
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.
 
removefromallsequences(self, list)
Remove one or more messages from all sequences (including last) -- but not from 'cur'!!!
 
getlast(self)
Return the last message number.
 
setlast(self, last)
Set the last message number.
Method Details [hide private]

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).

getcurrent(self)

 

Return the current message. Raise Error when there is none.

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.

refilemessages(self, list, tofolder, keepsequences=0)

 

Refile one or more messages -- may raise os.error. 'tofolder' is an open folder object.