try to fix formatting for masto-fedi prints

workspace
Brendan Howell 4 years ago
parent 208a953c6f
commit fa9ae8668e

@ -318,12 +318,14 @@ class PublicRelations(Bureau):
out = "" out = ""
for t in toots: for t in toots:
prn.set(underline=1) prn.set(underline=1)
username = t.account.display_name print("toot from:" + str(t.account))
username = str(t.account.display_name)
prn.textln(username) prn.textln(username)
prn.set() prn.set()
ttext = bleach.clean(t.content, tags=[], strip=True) ttext = bleach.clean(t.content, tags=[], strip=True)
ttext = html.unescape(ttext) ttext = html.unescape(ttext)
prn.block_text(ttext, font="0") prn.block_text(ttext, font="0")
prn.ln()
if len(t.media_attachments) > 0: if len(t.media_attachments) > 0:
img = None img = None
@ -336,7 +338,7 @@ class PublicRelations(Bureau):
im = PIL.Image.open(io.BytesIO(req_data.content)) im = PIL.Image.open(io.BytesIO(req_data.content))
if im.mode in ("L", "RGB", "P"): if im.mode in ("L", "RGB", "P"):
im = PIL.ImageOps.equalize(im) im = PIL.ImageOps.equalize(im)
im.thumbnail((self.smprint["width"], 576), PIL.Image.ANTIALIAS) im.thumbnail((self.smprint["width"], 960), PIL.Image.ANTIALIAS)
prn.image(im, impl="bitImageColumn") prn.image(im, impl="bitImageColumn")
shortcode = self.short_tweet_id(str(t["id"])) shortcode = self.short_tweet_id(str(t["id"]))

Loading…
Cancel
Save