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

def deletefolder(self, name):

    fullname = os.path.join(self.getpath(), name)
    for subname in os.listdir(fullname):
        fullsubname = os.path.join(fullname, subname)
        try:
            os.unlink(fullsubname)
        except os.error:
            self.error(('%s    not    deleted,    continuing...' % fullsubname))
    os.rmdir(fullname)
