X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=plomrogue%2Fparser.py;h=2820c186778365384be548929c2a1128f587d490;hb=124e135b89821306ac924a9387cd6a7799d0a65e;hp=69f728ee9859f3ed299f04b98177687c0ee52ce0;hpb=089f09f75ae957e2483da10f0dbeac299217688c;p=plomrogue2 diff --git a/plomrogue/parser.py b/plomrogue/parser.py index 69f728e..2820c18 100644 --- a/plomrogue/parser.py +++ b/plomrogue/parser.py @@ -78,6 +78,14 @@ class Parser: Respects function signature defined in function's .argtypes attribute. """ + import string + msg = msg.rstrip() + legal_chars = string.digits + string.ascii_letters +\ + string.punctuation + ' ' + 'ÄäÖöÜüߧ' + 'éèáàô' + for c in msg: + if not c in legal_chars: + raise ArgError('Command/message contains illegal character(s), ' + 'may only contain ones of: %s' % legal_chars) tokens = self.tokenize(msg) if len(tokens) == 0: return None, ()