Fix bug in reconstituting NCX @id and @class attributes.

This commit is contained in:
Marshall T. Vandegrift 2009-02-02 11:41:00 -05:00
parent 02091a0fa6
commit 7b2064221e

View File

@ -900,9 +900,9 @@ class TOC(object):
def to_ncx(self, parent, depth=1): def to_ncx(self, parent, depth=1):
for node in self.nodes: for node in self.nodes:
id = self.id or unicode(uuid.uuid4()) id = node.id or unicode(uuid.uuid4())
attrib = {'id': id, 'playOrder': '0'} attrib = {'id': id, 'playOrder': '0'}
if self.klass: if node.klass:
attrib['class'] = node.klass attrib['class'] = node.klass
point = element(parent, NCX('navPoint'), attrib=attrib) point = element(parent, NCX('navPoint'), attrib=attrib)
label = etree.SubElement(point, NCX('navLabel')) label = etree.SubElement(point, NCX('navLabel'))