def __init__(self, opf_tree): self.__tree = xpath(opf_tree, './/dc:identifier') self.__items = [ item.text for item in self.__tree ]
def __init__(self, opf_tree): self.__tree = xpath(opf_tree, './/opf:manifest') self.__items = [ ManifestItem(item) for item in self.__tree.getchildren() if item.tag is not etree.Comment ]
def __init__(self, opf_tree): self.__tree = xpath(opf_tree, './/opf:guide') self.__items = [ Reference(item) for item in self.__tree ]
def get_opf_path(self): with self._file.open('META-INF/container.xml') as container_file: container_root = etree.fromstring(container_file.read()) opf_path = xpath(container_root, './/container:rootfile/@full-path') return opf_path
def __init__(self, opf_tree, manifest): self.__tree = xpath(opf_tree, './/opf:spine') self.__manifest = manifest
def __init__(self, toc_tree): self.__tree = xpath(toc_tree, './/ncx:navMap') self.__items = [ TOCItem(item) for item in self.__tree.getchildren() ]
def __init__(self, item): self.__item = item self.order = int(self.__item.get('playOrder')) self.label = xpath(self.__item, './/ncx:navLabel/ncx:text/text()') self.src = xpath(self.__item, './/ncx:content/@src')
def __get_metadata_attribute(self, quantifier, *attributes): return quantifier( *[xpath(tree=self.__tree, expression=attribute, quantifier=quantifier) for attribute in attributes] )
def __init__(self, opf_tree): self.__unique_identifier_id = opf_tree.get('unique-identifier') self.__tree = xpath(opf_tree, './/opf:metadata')