Exemplo n.º 1
0
    def load_tome(self, reader, page_class):
        name = reader.name
        if not util.valid_library_item_name(name):
            raise LoadError(reader.data, "Invalid tome name [name=%s]" % name)

        tome = Tome(name, page_class)
        for page_reader in reader.children:
            tome.add_page(self.load_page(page_reader, page_class))

        return tome
Exemplo n.º 2
0
 def clone_object(self, mgr, tome, type_info):
     page_marshaller = mgr.require_data_marshaller(tome.page_class)
     clone = Tome(tome.name, tome.page_class)
     for page in tome.values():
         clone.add_page(page_marshaller.clone_data(mgr, page, type_info.subtype))
     return clone