X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/static/gitweb.css?a=blobdiff_plain;f=plomrogue%2Fparser.py;h=22e90594be8313ab514d6d346ce1b87fa498188b;hb=c1024023126d1fd91be3145e50cae4b493d7a956;hp=2820c186778365384be548929c2a1128f587d490;hpb=0ec2f3df7ef3b2f7bdbe7c45278e0944e64a56fe;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: