def _add_file(self, name, data, secnum=0): if len(data) > 0: section = self._sections[secnum] offset = section.tell() section.write(data) else: offset = 0 self._directory.append(DirectoryEntry(name, secnum, offset, len(data)))
def _add_folder(self, name, offset=0, size=0): if not name.endswith('/'): name += '/' self._directory.append(DirectoryEntry(name, 0, offset, size))