All pastes #127596 Raw Edit

Something

public text v1 · immutable
·published 2006-08-12 10:28 UTC
rendered paste body
                for path in self.rompath:
                    roms = os.listdir(path)
                    tmpext = self.romext[self.rompath.index(path)].split(';')
                    for kword in string.split(keyboard.getText()):
                        kword = string.lower(kword)
                        kword = string.strip(kword)
                        for rom in roms[:]:
                            trom = string.lower(rom)
                            if string.find(trom, kword) == -1:
                                roms.remove(rom)
                            rem = True
                            for ext in tmpext:
                                ext = string.lower(ext)
                                if string.find(trom, ext) > -1:
                                    rem = False
                            if rem == True:
                                roms.remove(rom)
                                rem = True

                    for rom in roms:
                        if os.path.isfile(path+rom):
                            (rpath, rext) = os.path.splitext(rom)
                            results.append((str(rpath), str(rext), self.rompath.index(path)))