|
|
@ -1,4 +1,5 @@
|
|
|
|
# publications office for reading and writing
|
|
|
|
# publications office for reading and writing
|
|
|
|
|
|
|
|
from base64 import b64encode
|
|
|
|
from datetime import datetime
|
|
|
|
from datetime import datetime
|
|
|
|
import io
|
|
|
|
import io
|
|
|
|
import json
|
|
|
|
import json
|
|
|
@ -272,6 +273,9 @@ 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 = code128.svg("PBr." + entry.dbhash)
|
|
|
|
entry.svg = code128.svg("PBr." + entry.dbhash)
|
|
|
|
|
|
|
|
encoded_svg = b64encode(entry.svg).decode()
|
|
|
|
|
|
|
|
encoded_data = "data:image/svg+xml;charset=utf-8;base64," + encoded_svg
|
|
|
|
|
|
|
|
entry.svg = '<img src="%s"/>' % encoded_data
|
|
|
|
|
|
|
|
|
|
|
|
# skip bogus entries with no text
|
|
|
|
# skip bogus entries with no text
|
|
|
|
if not hasattr(entry, "summary"):
|
|
|
|
if not hasattr(entry, "summary"):
|
|
|
|