some fixes for masto-fedi timelines

workspace
Brendan Howell 4 years ago
parent 81dbe250c8
commit 208a953c6f

@ -339,9 +339,11 @@ class PublicRelations(Bureau):
im.thumbnail((self.smprint["width"], 576), PIL.Image.ANTIALIAS) im.thumbnail((self.smprint["width"], 576), PIL.Image.ANTIALIAS)
prn.image(im, impl="bitImageColumn") prn.image(im, impl="bitImageColumn")
tw_shortcode = self.short_tweet_id(str(t["id"])) shortcode = self.short_tweet_id(str(t["id"]))
#prn.barcode("PRmad." + tw_shortcode, "CODE128", function_type="B") #prn.barcode("PRmad." + tw_shortcode, "CODE128", function_type="B")
prn.soft_barcode("code128", "PRmad." + tw_shortcode, module_width=0.16) prn.soft_barcode("code128", "PRmad." + shortcode, module_width=0.16)
with self.dbenv.begin(db=self.tweetdb, write=True) as txn:
txn.put(shortcode.encode(), str(t.id).encode())
notifications = self.masto.notifications(since_id=self.last_mast_notif) notifications = self.masto.notifications(since_id=self.last_mast_notif)
if len(notifications) > 0: if len(notifications) > 0:
@ -358,8 +360,6 @@ class PublicRelations(Bureau):
prn.text(note["type"] + " " + str(note["created_at"]) + " from ") prn.text(note["type"] + " " + str(note["created_at"]) + " from ")
prn.textln(username + ":") prn.textln(username + ":")
prn.textln(str(note["status"])) prn.textln(str(note["status"]))
with self.dbenv.begin(db=self.tweetdb, write=True) as txn:
txn.put(shortcode.encode(), tweet_id.encode())
prn.ln(2) prn.ln(2)
prn.cut() prn.cut()

Loading…
Cancel
Save