A now type and a text type.

This commit is contained in:
Jeremy Fincher 2004-10-01 21:27:22 +00:00
parent a2d30a88f5
commit 8afad62691

View File

@ -186,8 +186,11 @@ def getNonNegativeInt(irc, msg, args, state, *L):
getInt(irc, msg, args, state, 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): def getId(irc, msg, args, state, kind=None):
getInt(irc, msg, args, state, type='id') type = 'id'
if kind is not None:
type = kind + ' id'
getInt(irc, msg, args, state, type=type)
def getExpiry(irc, msg, args, state): def getExpiry(irc, msg, args, state):
now = int(time.time()) now = int(time.time())
@ -363,9 +366,13 @@ def getUrl(irc, msg, args, state):
else: else:
irc.errorInvalid('url', args[0]) irc.errorInvalid('url', args[0])
def getNow(irc, msg, args, state):
state.args.append(int(time.time()))
wrappers = ircutils.IrcDict({ wrappers = ircutils.IrcDict({
'id': getId, 'id': getId,
'int': getInt, 'int': getInt,
'now': getNow,
'url': getUrl, 'url': getUrl,
'float': getFloat, 'float': getFloat,
'nonInt': getNonInt, 'nonInt': getNonInt,
@ -380,6 +387,7 @@ wrappers = ircutils.IrcDict({
'lowered': getLowered, 'lowered': getLowered,
'anything': anything, 'anything': anything,
'something': getSomething, 'something': getSomething,
'text': anything,
'somethingWithoutSpaces': getSomethingNoSpaces, 'somethingWithoutSpaces': getSomethingNoSpaces,
'channelDb': getChannelDb, 'channelDb': getChannelDb,
'hostmask': getHostmask, 'hostmask': getHostmask,