home · contact · privacy
While rtrim() doesn't work to allow \n-trailed tablet logins, this does.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 5 Dec 2020 14:30:17 +0000 (15:30 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 5 Dec 2020 14:30:17 +0000 (15:30 +0100)
plomrogue/parser.py

index 2820c186778365384be548929c2a1128f587d490..22e90594be8313ab514d6d346ce1b87fa498188b 100644 (file)
@@ -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.
         """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
         """
         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:
         legal_chars = string.digits + string.ascii_letters +\
             string.punctuation + ' ' + 'ÄäÖöÜüߧ' + 'éèáàô'
         for c in msg: