def load_wadio(self, wadio): """Load all matching lumps that have not already been flagged as read from the given WadIO object.""" for i, entry in ((i, e) for (i, e) in enumerate(wadio.entries) if not e.been_read and util.inwclist(e.name, self.names)): self[entry.name] = self.lumptype(wadio.read(i)) entry.been_read = True
def load_wadio(self, wadio): """Load all matching lumps that have not already been flagged as read from the given WadIO object.""" numlumps = len(wadio.entries) i = 0 while i < numlumps: if wadio.entries[i].been_read: i += 1 continue name = wadio.entries[i].name added = False for head in self.headers: if fnmatch.fnmatchcase(name, head): added = True self[name] = NameGroup() wadio.entries[i].been_read = True i += 1 while i < numlumps and util.inwclist(wadio.entries[i].name, self.tail): self[name][wadio.entries[i].name] = \ self.lumptype(wadio.read(i)) wadio.entries[i].been_read = True i += 1 if not added: i += 1