Merge remote-tracking branch 'upstream/master'
authorRobert Błaut <listy@blaut.biz>
Mon, 3 Mar 2014 20:21:43 +0000 (21:21 +0100)
committerRobert Błaut <listy@blaut.biz>
Mon, 3 Mar 2014 20:21:43 +0000 (21:21 +0100)
1  2 
librarian/epub.py

diff --combined librarian/epub.py
@@@ -249,7 -249,7 +249,7 @@@ class TOC(object)
  
              nav_label = nav_map.makeelement(NCXNS('navLabel'))
              text = nav_map.makeelement(NCXNS('text'))
 -            text.text = child.name
 +            text.text = re.sub(r'\n', ' ', child.name)
              nav_label.append(text)
              nav_point.append(nav_label)
  
@@@ -310,7 -310,7 +310,7 @@@ def chop(main_text)
                  yield part_xml
                  last_node_part = True
                  main_xml_part[:] = [deepcopy(one_part)]
-             elif not last_node_part and name in ("naglowek_scena"):
+             elif not last_node_part and name == "naglowek_scena":
                  yield part_xml
                  main_xml_part[:] = [deepcopy(one_part)]
              else:
@@@ -335,7 -335,7 +335,7 @@@ def transform_chunk(chunk_xml, chunk_no
  
      toc = TOC()
      for element in chunk_xml[0]:
-         if element.tag in ("naglowek_czesc"):
+         if element.tag == "naglowek_czesc":
              toc.add(node_name(element), "part%d.html#book-text" % chunk_no)
          elif element.tag in ("naglowek_rozdzial", "naglowek_akt", "srodtytul"):
              toc.add(node_name(element), "part%d.html" % chunk_no)
@@@ -499,7 -499,7 +499,7 @@@ def transform(wldoc, verbose=False
              '<item id="cover" href="cover.html" media-type="application/xhtml+xml" />'))
          manifest.append(etree.fromstring(
              '<item id="cover-image" href="%s" media-type="%s" />' % (cover_name, bound_cover.mime_type())))
 -        spine.insert(0, etree.fromstring('<itemref idref="cover" linear="no" />'))
 +        spine.insert(0, etree.fromstring('<itemref idref="cover"/>'))
          opf.getroot()[0].append(etree.fromstring('<meta name="cover" content="cover-image"/>'))
          guide.append(etree.fromstring('<reference href="cover.html" type="cover" title="Okładka"/>'))