Skip to content

Commit

Permalink
Revert to @rend, again
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed May 25, 2020
1 parent 8418945 commit 6fcff07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/imxml2django.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2020-04-08 17:46:10 (kthoden)>
# Time-stamp: <2020-05-25 09:25:29 (kthoden)>

"""
Create an XML file that can be inserted into the Django database
Expand Down Expand Up @@ -1096,7 +1096,7 @@ def treat_verselines(verse_element):
# Process Section Title
xmlEOAsection = etree.Element("EOAsection")
xmlEOAsection.set("order", str(intObjectNumber))
if xmlChapterChild.get("n") != "nonumber":
if xmlChapterChild.get("rend") != "nonumber":
xmlEOAsection.set("id", xmlChapterChild.get("id"))
xmlEOAsection.set("number", dictSections[xmlChapterChild.get("id")])
intObjectNumber += 1
Expand All @@ -1110,7 +1110,7 @@ def treat_verselines(verse_element):
# Process Subsection Title
xmlEOAsubsection = etree.Element("EOAsubsection")
xmlEOAsubsection.set("order", str(intObjectNumber))
if xmlSectionChild.get("n") != "nonumber":
if xmlSectionChild.get("rend") != "nonumber":
xmlEOAsubsection.set("id", xmlSectionChild.get("id"))
xmlEOAsubsection.set("number", dictSections[xmlSectionChild.get("id")])
intObjectNumber += 1
Expand Down
6 changes: 3 additions & 3 deletions src/imxml2epub.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2020-04-06 08:53:49 (kthoden)>
# Time-stamp: <2020-05-25 09:30:01 (kthoden)>

""" Convert a customized DocBook XML file into a set of files that
constitute the contents of an EPUB file.
Expand Down Expand Up @@ -724,7 +724,7 @@ def add_css_snippet(css_snippet, css_file):
idSection = xmlSection.get("id")
strHeadline = xmlSection.find("h2").text or ""
logging.info(strHeadline)
if xmlSection.get("n") != "nonumber":
if xmlSection.get("rend") != "nonumber":
xmlSection.find("h2").text = str(dictSections[idSection]) + " " + strHeadline
else:
xmlSection.find("h2").text = strHeadline
Expand All @@ -736,7 +736,7 @@ def add_css_snippet(css_snippet, css_file):
idSection = xmlSubsection.get("id")
strHeadline = xmlSubsection.find("h3").text or ""
logging.info(strHeadline)
if xmlSubsection.get("n") != "nonumber":
if xmlSubsection.get("rend") != "nonumber":
xmlSubsection.find("h3").text = str(dictSections[idSection]) + " " + strHeadline
else:
xmlSubsection.find("h3").text = strHeadline
Expand Down

0 comments on commit 6fcff07

Please sign in to comment.