'Prune any empty directories above the given file. If this
task has no `toppath` or the file path provided is not within
the `toppath`, then this function has no effect. Similarly, if
the file still exists, no pruning is performed, so it\'s safe to
call when the file in question may not have been removed.'

def prune(self, filename):

    if (self.toppath and (not os.path.exists(filename))):
        util.prune_dirs(os.path.dirname(filename), self.toppath, clutter=config['clutter'].as_str_seq())
