'Removing all temporary files
Be warned that "cleanuping" your document makes it unusable.'

def _cleanup(self):

    if hasattr(self, '_cache_dir'):
        shutil.rmtree(self._cache_dir, ignore_errors=True)
    if hasattr(self, '_cache_file'):
        os.remove(self._cache_file)
    return
