def read(filename, file=None): import formats result = qdict.qdict() z = zipfile.ZipFile(file or filename, 'r') resources = z.namelist() for resource in resources: result.update(formats.read(resource, z.open(resource) )) return result
def read(self): self.text = formats.read(self.basepath) for (filename, path) in formats.iter(self.basepath): child = LocalDocument(self.repo, os.path.split(filename)[1], None, self.ancestors + [weakref.ref(self)]) child.basepath = path child.unlink = True self.children.append(child)
def file_open(self, filename): self.resources.update(formats.read(filename), True) formats.unwrap(self.world, self.view, self.resources) self.last_filename = filename