mirror of https://github.com/Mikaela/Limnoria.git
commands.wrap.
This commit is contained in:
parent
601d58a662
commit
0d2b710aa2
|
@ -51,9 +51,9 @@ import BeautifulSoup
|
||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
|
from supybot.commands import *
|
||||||
import supybot.commands as commands
|
import supybot.commands as commands
|
||||||
import supybot.ircutils as ircutils
|
import supybot.ircutils as ircutils
|
||||||
import supybot.privmsgs as privmsgs
|
|
||||||
import supybot.registry as registry
|
import supybot.registry as registry
|
||||||
import supybot.webutils as webutils
|
import supybot.webutils as webutils
|
||||||
import supybot.callbacks as callbacks
|
import supybot.callbacks as callbacks
|
||||||
|
@ -107,7 +107,7 @@ class Weather(callbacks.Privmsg):
|
||||||
def _noLocation(self):
|
def _noLocation(self):
|
||||||
raise NoLocation, noLocationError
|
raise NoLocation, noLocationError
|
||||||
|
|
||||||
def weather(self, irc, msg, args):
|
def weather(self, irc, msg, args, location):
|
||||||
# This specifically does not have a docstring.
|
# This specifically does not have a docstring.
|
||||||
channel = None
|
channel = None
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if ircutils.isChannel(msg.args[0]):
|
||||||
|
@ -116,7 +116,6 @@ class Weather(callbacks.Privmsg):
|
||||||
s = self.userValue('lastLocation', msg.prefix)
|
s = self.userValue('lastLocation', msg.prefix)
|
||||||
if s:
|
if s:
|
||||||
args = [s]
|
args = [s]
|
||||||
location = privmsgs.getArgs(args)
|
|
||||||
self.setUserValue('lastLocation', msg.prefix,
|
self.setUserValue('lastLocation', msg.prefix,
|
||||||
location, ignoreNoUser=True)
|
location, ignoreNoUser=True)
|
||||||
realCommandName = self.registryValue('command', channel)
|
realCommandName = self.registryValue('command', channel)
|
||||||
|
@ -134,6 +133,7 @@ class Weather(callbacks.Privmsg):
|
||||||
break
|
break
|
||||||
except NoLocation:
|
except NoLocation:
|
||||||
self.log.info('%s lookup failed as backup.', command)
|
self.log.info('%s lookup failed as backup.', command)
|
||||||
|
weather = wrap(weather, ['text'])
|
||||||
|
|
||||||
|
|
||||||
def _toCelsius(self, temp, unit):
|
def _toCelsius(self, temp, unit):
|
||||||
|
|
Loading…
Reference in New Issue