'Validate the filename by calling get_valid_name() and return a filename
to be passed to the save() method.'

def generate_filename(self, filename):

    (dirname, filename) = os.path.split(filename)
    return os.path.normpath(os.path.join(dirname, self.get_valid_name(filename)))
