X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=sidebyside;f=plomrogue%2Fparser.py;h=302733d0322a69c9592276b94239b626debcb4c3;hb=54d8db95b3bb690b712ec09179922829d0c68a54;hp=05c830ff8552c216b81924c46244067717e478a4;hpb=ea5ddf2c37571f3fb0ed486cd4a4294b82c54b54;p=plomrogue2
diff --git a/plomrogue/parser.py b/plomrogue/parser.py
index 05c830f..302733d 100644
--- a/plomrogue/parser.py
+++ b/plomrogue/parser.py
@@ -84,7 +84,7 @@ class Parser:
import string
msg = msg.replace('\n', ' ') # Inserted by some tablet keyboards.
legal_chars = string.digits + string.ascii_letters +\
- string.punctuation + ' ' + 'ÃäÃöÃüç' + 'éèáà ô' + 'â'
+ string.punctuation + ' ' + 'ÃäÃöÃüç' + 'éèáà ô' + 'ââ¦'
for c in msg:
if not c in legal_chars:
raise ArgError('Command/message contains illegal character(s), '
@@ -127,6 +127,11 @@ class Parser:
if not arg.isdigit() or int(arg) < 1:
raise ArgError('Argument must be positive integer.')
args += [int(arg)]
+ elif tmpl == 'int':
+ try:
+ args += [int(arg)]
+ except ValueError:
+ raise ArgError('Argument must be integer.')
elif tmpl == 'bool':
if not arg.isdigit() or int(arg) not in (0, 1):
raise ArgError('Argument must be 0 or 1.')