From e2fd18800cd87799f522fde8a200ae872aedab44 Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Thu, 3 Jan 2019 00:22:21 +0100 Subject: [PATCH] try to smack unicode into cp437 for usernames --- screenless/bureau/publicrelations/publicrelations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index eef10f4..5b7c47b 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -333,9 +333,10 @@ class PublicRelations(Bureau): prn.text("NOTIFICATIONS:\r\n") prn.set(text_type="NORMAL") for note in notifications: + username = t.account.display_name.encode("cp437", "ignore") + \ + " (" + t.account.acct.encode("cp437", "ignore") + ")" prn.text(note["type"] + " " + str(note["created_at"]) + " from " + - note["account"]["display_name"] + " (" + - note["account"]["acct"] + "):\r\n" + str(note.keys()) + + username + ":\r\n" + str(note.keys()) + "\r\n") prn.text("\r\n\r\n")