from supybot import utils, plugins, ircutils, callbacks from supybot.commands import * from .bollycao import Bollycao as BollycaoUtils try: from supybot.i18n import PluginInternationalization _ = PluginInternationalization('Bollycao') except ImportError: # Placeholder that allows to run the plugin on a bot # without the i18n module _ = lambda x: x class Bollycao(callbacks.Plugin): """Bollycao""" threaded = True def __init__(self, irc): self.__parent = super(Bollycao, self) self.__parent.__init__(irc) self.bollycao_utils = BollycaoUtils(self.registryValue('url')) def bollycao(self, irc, msg, args): """takes no arguments Returns the price of one bollycao in euros """ irc.reply('1 bollycao = €' + "{:.2f}".format(self.bollycao_utils.get_price())) bollycao = wrap(bollycao) def bollycaos(self, irc, msg, args, euros): """ Returns the number of bollycaos you could buy with """ irc.reply('€' + "{:.2f}".format(euros) + ' = ' + str(self.bollycao_utils.get_bollycaos(euros)) + ' bollycaos') bollycaos = wrap(bollycaos, ['float']) Class = Bollycao # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: