From c1024023126d1fd91be3145e50cae4b493d7a956 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 5 Dec 2020 15:30:17 +0100 Subject: [PATCH] While rtrim() doesn't work to allow \n-trailed tablet logins, this does. --- plomrogue/parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plomrogue/parser.py b/plomrogue/parser.py index 2820c18..22e9059 100644 --- a/plomrogue/parser.py +++ b/plomrogue/parser.py @@ -77,9 +77,12 @@ class Parser: """Parse msg as call to function, return function with args tuple. Respects function signature defined in function's .argtypes attribute. + + Throws out messages with any but a small list of acceptable characters. + """ import string - msg = msg.rstrip() + msg = msg.replace('\n', ' ') # Inserted by some tablet keyboards. legal_chars = string.digits + string.ascii_letters +\ string.punctuation + ' ' + 'ÄäÖöÜüߧ' + 'éèáàô' for c in msg: -- 2.30.2