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:
James Vega 2005-02-10 03:14:09 +00:00
parent ad35c62568
commit 9f6e826481
2 changed files with 4 additions and 4 deletions

View File

@ -57,9 +57,6 @@ class WeatherCommand(registry.String):
if s not in m:
raise registry.InvalidRegistryValue,\
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)
Weather = conf.registerPlugin('Weather')

View File

@ -62,7 +62,10 @@ class Weather(callbacks.Plugin):
raise NoLocation, noLocationError
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
if irc.isChannel(msg.args[0]):
channel = msg.args[0]