Added httpUrl converter.

This commit is contained in:
Jeremy Fincher 2004-10-23 20:54:28 +00:00
parent e3bdd34f3f
commit 1a73603e22

View File

@ -434,6 +434,12 @@ def getUrl(irc, msg, args, state):
else: else:
irc.errorInvalid('url', args[0]) irc.errorInvalid('url', args[0])
def getHttpUrl(irc, msg, args, state):
if webutils.urlRe.match(args[0]) and args[0].startswith('http://'):
state.args.append(args.pop(0))
else:
irc.errorInvalid('http url', args[0])
def getNow(irc, msg, args, state): def getNow(irc, msg, args, state):
state.args.append(int(time.time())) state.args.append(int(time.time()))
@ -494,6 +500,7 @@ wrappers = ircutils.IrcDict({
'color': getIrcColor, 'color': getIrcColor,
'now': getNow, 'now': getNow,
'url': getUrl, 'url': getUrl,
'httpUrl': getHttpUrl,
'float': getFloat, 'float': getFloat,
'nonInt': getNonInt, 'nonInt': getNonInt,
'positiveInt': getPositiveInt, 'positiveInt': getPositiveInt,