diff --git a/plugins/Math.py b/plugins/Math.py index 84bcb4509..1ecccc200 100644 --- a/plugins/Math.py +++ b/plugins/Math.py @@ -45,7 +45,7 @@ import string from itertools import imap import supybot.utils as utils -from supybot.commands import wrap +from supybot.commands import additional, optional, wrap import supybot.callbacks as callbacks import convertcore @@ -67,8 +67,8 @@ class Math(callbacks.Privmsg): except ValueError: irc.error('Invalid for base %s: %s' % (frm, number)) base = wrap(base, [('int', 'base', lambda i: 2 <= i <= 36), - ('int?', 10, 'base', lambda i: 2 <= i <= 36), - '?something']) + optional(('int', 'base', lambda i: 2 <= i <= 36), 10), + optional('something')]) def _convertDecimalToBase(self, number, base): """ @@ -307,8 +307,8 @@ class Math(callbacks.Privmsg): irc.reply(str(newNum)) except convertcore.UnitDataError, ude: irc.error(str(ude)) - convert = wrap(convert, [('float?', 1.0), 'something', - ('literal?', '', 'to'), 'something']) + convert = wrap(convert, [optional('float', 1.0), 'something', + additional(('literal', 'to'), ''), 'something']) def units(self, irc, msg, args, type): """ [] @@ -319,7 +319,7 @@ class Math(callbacks.Privmsg): """ irc.reply(convertcore.units(type)) - units = wrap(units, [('?something', None)]) + units = wrap(units, [optional('something')]) Class = Math diff --git a/src/Admin.py b/src/Admin.py index b5804df42..934f46361 100755 --- a/src/Admin.py +++ b/src/Admin.py @@ -49,7 +49,7 @@ import supybot.conf as conf import supybot.ircdb as ircdb import supybot.utils as utils import supybot.ircmsgs as ircmsgs -from supybot.commands import wrap +from supybot.commands import additional, wrap import supybot.ircutils as ircutils import supybot.privmsgs as privmsgs import supybot.schedule as schedule