|
|
@ -165,7 +165,7 @@ class Publications(Bureau):
|
|
|
|
continue # skip bogus links
|
|
|
|
continue # skip bogus links
|
|
|
|
tmpcode = self._make_shorturl(link.attrib["href"])
|
|
|
|
tmpcode = self._make_shorturl(link.attrib["href"])
|
|
|
|
|
|
|
|
|
|
|
|
svg = barcode.get("CODE128", "PBr." + tmpcode).raw
|
|
|
|
svg = self.bc_svg("PBr." + tmpcode)
|
|
|
|
|
|
|
|
|
|
|
|
footnote = html.makeelement("div")
|
|
|
|
footnote = html.makeelement("div")
|
|
|
|
footnote.attrib["class"] = "footnote"
|
|
|
|
footnote.attrib["class"] = "footnote"
|
|
|
@ -173,7 +173,7 @@ class Publications(Bureau):
|
|
|
|
notetext.text = str(notecount) + ". " + link.attrib["href"]
|
|
|
|
notetext.text = str(notecount) + ". " + link.attrib["href"]
|
|
|
|
footnote.append(notetext)
|
|
|
|
footnote.append(notetext)
|
|
|
|
#TODO: make this barcode inline thing a util method
|
|
|
|
#TODO: make this barcode inline thing a util method
|
|
|
|
encoded_svg = b64encode(svg).decode()
|
|
|
|
encoded_svg = b64encode(svg.encode()).decode()
|
|
|
|
encoded_data = "data:image/svg+xml;charset=utf-8;base64," + encoded_svg
|
|
|
|
encoded_data = "data:image/svg+xml;charset=utf-8;base64," + encoded_svg
|
|
|
|
svg = '<img class="endnotebc" src="%s"/>' % encoded_data
|
|
|
|
svg = '<img class="endnotebc" src="%s"/>' % encoded_data
|
|
|
|
footnote.append(lxml.html.fromstring(svg))
|
|
|
|
footnote.append(lxml.html.fromstring(svg))
|
|
|
@ -276,8 +276,8 @@ class Publications(Bureau):
|
|
|
|
|
|
|
|
|
|
|
|
entry.source = feed.feed.title
|
|
|
|
entry.source = feed.feed.title
|
|
|
|
entry.dbhash = self._make_shorturl(entry.link)
|
|
|
|
entry.dbhash = self._make_shorturl(entry.link)
|
|
|
|
entry.svg = barcode.get("CODE128", "PBr." + entry.dbhash).raw
|
|
|
|
entry.svg = self.bc_svg("PBr." + entry.dbhash)
|
|
|
|
encoded_svg = b64encode(entry.svg).decode()
|
|
|
|
encoded_svg = b64encode(entry.svg.encode()).decode()
|
|
|
|
encoded_data = "data:image/svg+xml;charset=utf-8;base64," + encoded_svg
|
|
|
|
encoded_data = "data:image/svg+xml;charset=utf-8;base64," + encoded_svg
|
|
|
|
entry.svg = '<img src="%s"/>' % encoded_data
|
|
|
|
entry.svg = '<img src="%s"/>' % encoded_data
|
|
|
|
|
|
|
|
|
|
|
|