mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 21:29:24 +01:00
Fix testing for positiveInt and nonNegativeInt.
This commit is contained in:
parent
23f4dc2d0f
commit
edc698e48b
@ -174,7 +174,7 @@ def getInt(irc, msg, args, state, type='integer', p=None):
|
||||
if p is not None:
|
||||
if not p(i):
|
||||
raise ValueError
|
||||
state.args.append(_int(args[0]))
|
||||
state.args.append(i)
|
||||
del args[0]
|
||||
except ValueError:
|
||||
irc.errorInvalid(type, args[0])
|
||||
@ -195,11 +195,11 @@ def getFloat(irc, msg, args, state):
|
||||
|
||||
def getPositiveInt(irc, msg, args, state, *L):
|
||||
getInt(irc, msg, args, state,
|
||||
p=lambda i: i<=0, type='positive integer', *L)
|
||||
p=lambda i: i>0, type='positive integer', *L)
|
||||
|
||||
def getNonNegativeInt(irc, msg, args, state, *L):
|
||||
getInt(irc, msg, args, state,
|
||||
p=lambda i: i<0, type='non-negative integer', *L)
|
||||
p=lambda i: i>=0, type='non-negative integer', *L)
|
||||
|
||||
def getId(irc, msg, args, state, kind=None):
|
||||
type = 'id'
|
||||
|
Loading…
Reference in New Issue
Block a user