

def _visitor(self, data, dirname, filesindir):
    prune = []
    self.insert_dirname(dirname)
    for filename in filesindir:
        if os.path.isdir(os.path.join(dirname, filename)):
            if ((filename in ('.git', '.hg', '_build')) or filename.endswith('.egg-info')):
                prune.append(filename)
        else:
            (name, ext) = os.path.splitext(filename)
            if (not ((ext in ('.pyc',)) or filename.startswith('.'))):
                (root, ext) = os.path.splitext(filename)
                if (ext == '.py'):
                    self.insert_filename(dirname, filename, ext)
                else:
                    prune.append(filename)
            else:
                prune.append(filename)
    for filename in prune:
        filesindir.remove(filename)

dataset/ETHPy150Open pybee/duvet/duvet/widgets.py FileView._visitor/original