class Controller(): def __init__(self, rom, config): self.rom = rom self.stringeditor = StringEditorController(rom) self.mainview = MainView(self, self.stringeditor) def search(self, string): #String to bytes, strip the END OF STRING byte. searchbytes = PokeString(string).bytestring()[:-1] results = self.rom.findall(searchbytes) results_list = [] for offset in results: thestr = self.rom.getRM().get(PokeString, offset) occ_count = len(self.rom.findall(array('B', offsetToGBA(offset)))) results_list.append((offset, occ_count, thestr)) self.mainview.setResults(results_list) def stringselected(self, offset): self.stringeditor.selectString(offset)
def __init__(self, rom, config): self.rom = rom self.stringeditor = StringEditorController(rom) self.mainview = MainView(self, self.stringeditor)