2025-03-29 18:03:55 -04:00

51 lines
1.7 KiB
Python

###
# Copyright (c) 2025, Your Name
#
# This plugin is licensed under the same terms as Limnoria itself.
###
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Weather')
def configure(advanced):
# This will be called by supybot to configure this module.
# advanced is a bool that specifies whether the user identified themself as
# an advanced user or not. You should effect your configuration by
# manipulating the registry as appropriate.
from supybot.questions import expect, anything, something, yn
conf.registerPlugin('Weather', True)
Weather = conf.registerPlugin('Weather')
# This is where your configuration variables (if any) should go.
# User agent for Nominatim
conf.registerGlobalValue(Weather, 'userAgent',
registry.String('limnoria-weather-plugin/1.0', _("""User agent for Nominatim""")))
# Temperature unit
class WeatherConfig(registry.OnlySomeStrings):
validStrings = ('C', 'F')
conf.registerChannelValue(Weather, 'defaultUnit',
WeatherConfig('F', _("""Default temperature unit (C or F)""")))
# Display options
conf.registerChannelValue(Weather, 'showHumidity',
registry.Boolean(True, _("""Show humidity in weather reports""")))
conf.registerChannelValue(Weather, 'showWind',
registry.Boolean(True, _("""Show wind speed in weather reports""")))
conf.registerChannelValue(Weather, 'showForecast',
registry.Boolean(True, _("""Show forecast in weather reports""")))
conf.registerChannelValue(Weather, 'forecastDays',
registry.PositiveInteger(3, _("""Number of forecast days to display""")))
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: