Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Other epub stuff
  • Loading branch information
Klaus Thoden committed May 29, 2018
1 parent 6ee0a6e commit e5315c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions imxml2epub.py
Expand Up @@ -707,12 +707,14 @@ class FootnoteError(Exception):
don't try to mix-and-match
"""
pass
# class FootnoteError ends here

intTechnicalChapterNumber = 1

for xmlChapter in xmlChapters:
groupings = libeoaconvert.get_bigfoot_data(xmlChapter)
xmlFootnotes = list(xmlChapter.findall(".//note"))
print("here come the footnotes. found", len(xmlFootnotes))
has_old = 0 != len(xmlFootnotes)
has_new = 0 != len(
[ # flatten the association list whose values are lists, so we can take the length
Expand Down Expand Up @@ -888,7 +890,6 @@ class FootnoteError(Exception):
xmlHyperlinks = xmlChapter.findall(".//xref")
for xmlHyperlink in xmlHyperlinks:
strURL = xmlHyperlink.get('url')
print(strURL)
if strURL.startswith("http://") == False:
if strURL.startswith("https://") == False:
strURL = "http://" + strURL
Expand Down Expand Up @@ -1082,7 +1083,6 @@ class FootnoteError(Exception):
xmlLetterheads = xmlChapter.xpath(".//EOAletterhead")
for xmlLetterhead in xmlLetterheads:
xmlRecipient = xmlLetterhead.find(".//Recipient")
print(etree.tostring(xmlRecipient))
xmlRecipient.tag = "p"
xmlRecipient.getchildren()[0].tag = "em"
xmlArchive = xmlLetterhead.find(".//Archive")
Expand Down Expand Up @@ -1112,7 +1112,7 @@ class FootnoteError(Exception):
xmlHeader = xmlTranscription.find(".//EOAtranscriptedheader")
xmlHeader.tag = "tr"
xmlLeftHeader = xmlTranscription.find(".//Leftheader")
print(xmlLeftHeader.text)
# print(xmlLeftHeader.text)
xmlLeftHeader.tag = "td"
xmlLeftHeader.set("style", "width: 50%")
xmlRightHeader = xmlTranscription.find(".//Rightheader")
Expand Down Expand Up @@ -1153,7 +1153,7 @@ class FootnoteError(Exception):
for xmlTable in xmlTables:
xmlRawTable = xmlTable.find(".//table")
strTableCaption = xmlTable.find(".//EOAtablecaption").text or ""
print("Working on ", strTableCaption)
# print("Working on ", strTableCaption)
if strTableCaption != "nonumber":
intTableNumber = dictTables[xmlTable.find(".//EOAtablelabel").text]
xmlTableCaption = etree.Element("p")
Expand Down

0 comments on commit e5315c7

Please sign in to comment.