X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomrogue%2Fparser.py;h=22e90594be8313ab514d6d346ce1b87fa498188b;hb=b42a49ec09d08e8f37ea52ad6b74fb10c5c5b01d;hp=2820c186778365384be548929c2a1128f587d490;hpb=124e135b89821306ac924a9387cd6a7799d0a65e;p=plomrogue2 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: