def clean(self, only_temp=False, dryrun=False):
    'Removes files generated by the workflow.'
    for job in self.jobs:
        for f in job.output:
            if ((not only_temp) or is_flagged(f, 'temp')):
                if (f.exists or os.path.islink(f)):
                    if f.protected:
                        logger.error('Skipping write-protected file {}.'.format(f))
                    else:
                        msg = ('Deleting {}' if (not dryrun) else 'Would delete {}')
                        logger.info(msg.format(f))
                        if (not dryrun):
                            f.remove(remove_non_empty_dir=only_temp)
Removes files generated by the workflow.
def clean(self, only_temp=False, dryrun=False):
    
    for job in self.jobs:
        for f in job.output:
            if ((not only_temp) or is_flagged(f, 'temp')):
                if (f.exists or os.path.islink(f)):
                    if f.protected:
                        logger.error('Skipping write-protected file {}.'.format(f))
                    else:
                        msg = ('Deleting {}' if (not dryrun) else 'Would delete {}')
                        logger.info(msg.format(f))
                        if (not dryrun):
                            f.remove(remove_non_empty_dir=only_temp)