From cc9522e833a1d0b18cae5a6126594fad44a9eb8d Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 30 Mar 2004 08:32:17 +0000 Subject: [PATCH] Slight cleanup. --- plugins/Weather.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/Weather.py b/plugins/Weather.py index 3afc4df2d..ec911ca81 100644 --- a/plugins/Weather.py +++ b/plugins/Weather.py @@ -60,7 +60,7 @@ class WeatherUnit(registry.String): s = s.capitalize() if s not in unitAbbrevs: raise registry.InvalidRegistryValue,\ - 'Unit must be one of Fahrenheit, Celsius, or Kelvin.' + 'Unit must be one of Fahrenheit, Celsius, or Kelvin.' s = unitAbbrevs[s] registry.String.setValue(self, s) @@ -69,12 +69,14 @@ class WeatherCommand(registry.String): m = Weather.weatherCommands if s not in m: raise registry.InvalidRegistryValue,\ - 'Command must be one of %s' % utils.commaAndify(m) + 'Command must be one of %s' % utils.commaAndify(m) else: method = getattr(Weather, s) Weather.weather.im_func.__doc__ = method.__doc__ registry.String.setValue(self, s) +# Registry variables moved to the bottom to use Weather.weatherCommands. + class Weather(callbacks.Privmsg): weatherCommands = ['ham', 'cnn'] threaded = True @@ -326,7 +328,8 @@ conf.registerChannelValue(conf.supybot.plugins.Weather, 'temperatureUnit', reporting the weather.""")) conf.registerChannelValue(conf.supybot.plugins.Weather, 'command', WeatherCommand('cnn', """Sets the default command to use when retrieving - the weather.""")) + the weather. Command must be one of %s.""" % + utils.commaAndify(Weather.weatherCommands, And='or'))) Class = Weather