def search_dialog(zones, search): messages = {} for zone_id, dat_id in zones.items(): offsets, data = decipher_dialog(find_dat(dat_id)) for i in range(len(offsets) - 1): message = data[offsets[i]:offsets[i+1]] if message == search: messages[zone_id] = str(i) return messages
def search_dialog(zones, search): messages = {} for zone_id, dat_id in zones.items(): offsets, data = decipher_dialog(find_dat(dat_id)) for i in range(len(offsets) - 1): message = data[offsets[i]:offsets[i+1]] for name, string in search.items(): if message == string: if messages.get(zone_id) is None: messages[zone_id] = {name: i} else: messages[zone_id][name] = i return messages
def search_dialog(zones, search): messages = {} for zone_id, dat_id in zones.items(): offsets, data = decipher_dialog(find_dat(dat_id)) for i in range(len(offsets) - 1): message = data[offsets[i]:offsets[i + 1]] for name, string in search.items(): if message == string: if messages.get(zone_id) is None: messages[zone_id] = {name: i} else: messages[zone_id][name] = i return messages