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

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

Instance Methods [hide private]
 
__init__(self, path=None, profile=None)
Constructor.
 
__repr__(self)
String representation.
 
error(self, msg, *args)
Routine to print an error.
 
getprofile(self, key)
Return a profile entry, None if not found.
 
getpath(self)
Return the path (the name of the collection's directory).
 
getcontext(self)
Return the name of the current folder.
 
setcontext(self, context)
Set the name of the current folder.
 
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).
 
listallfolders(self)
Return the names of all folders and subfolders, recursively.
 
listallsubfolders(self, name)
Return the names of subfolders in a given folder, recursively.
 
openfolder(self, name)
Return a new Folder object for the named folder.
 
makefolder(self, name)
Create a new folder (or raise os.error if it cannot be created).
 
deletefolder(self, name)
Delete a folder.
Method Details [hide private]

error(self, msg, *args)

 

Routine to print an error. May be overridden by a derived class.

deletefolder(self, name)

 

Delete a folder. This removes files in the folder but not subdirectories. Raise os.error if deleting the folder itself fails.