def _apply(self, func, confirm=False):
        """applies a function to each target path
        """
        i = 0
        desc = func.__doc__.strip()
        for target in self.targets:
            if confirm:
                question = "\n%s '%s' (y/n/q)? " % (desc, target)
                answer = getch(question)
                if answer in ['y', 'Y']:
                    func(target)
                    i += 1
                elif answer in ['q']: #i.e. quit
                    break
                else:
                    continue
            else:
                func(target)
                i += 1
        if i:
            self.log("Applied '%s' to %s items (%sK)" % (
                desc, i, int(round(self.cum_size/1024.0, 0))))
        else:
            self.log('No action taken')
applies a function to each target path
        
recipes/Python/576643_Recursive_filefolder_cleaner/recipe-576643.py