def cleanup_workdir(self):
    for io_dir in set((os.path.dirname(io_file) for job in self.jobs for io_file in chain(job.output, job.input) if (not os.path.exists(io_file)))):
        if (os.path.exists(io_dir) and (not len(os.listdir(io_dir)))):
            os.removedirs(io_dir)
def cleanup_workdir(self):
    for io_dir in set((os.path.dirname(io_file) for job in self.jobs for io_file in chain(job.output, job.input) if (not os.path.exists(io_file)))):
        if (os.path.exists(io_dir) and (not len(os.listdir(io_dir)))):
            os.removedirs(io_dir)