mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
Make Weather.weather less complicated and fix the bug where it wouldn't be listed as a command until it had been called once.
This commit is contained in:
parent
ad35c62568
commit
9f6e826481
@ -57,9 +57,6 @@ class WeatherCommand(registry.String):
|
|||||||
if s not in m:
|
if s not in m:
|
||||||
raise registry.InvalidRegistryValue,\
|
raise registry.InvalidRegistryValue,\
|
||||||
format('Command must be one of %L', m)
|
format('Command must be one of %L', m)
|
||||||
else:
|
|
||||||
method = getattr(plugin.Weather, s)
|
|
||||||
plugin.Weather.weather.im_func.__doc__ = method.__doc__
|
|
||||||
registry.String.setValue(self, s)
|
registry.String.setValue(self, s)
|
||||||
|
|
||||||
Weather = conf.registerPlugin('Weather')
|
Weather = conf.registerPlugin('Weather')
|
||||||
|
@ -62,7 +62,10 @@ class Weather(callbacks.Plugin):
|
|||||||
raise NoLocation, noLocationError
|
raise NoLocation, noLocationError
|
||||||
|
|
||||||
def weather(self, irc, msg, args, location):
|
def weather(self, irc, msg, args, location):
|
||||||
# This specifically does not have a docstring.
|
"""<US zip code | US/Canada city, state | Foreign city, country>
|
||||||
|
|
||||||
|
Returns the approximate weather conditions for a given city.
|
||||||
|
"""
|
||||||
channel = None
|
channel = None
|
||||||
if irc.isChannel(msg.args[0]):
|
if irc.isChannel(msg.args[0]):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user