Beispiel #1
0
        True, """Shows metric formatted data (Celsius, kilometres/hour)
    in the weather output if true. You can have both imperial and metric enabled,
    and the bot will show both."""))
conf.registerChannelValue(
    WunderWeather, 'showPressure',
    registry.Boolean(
        True, """Determines whether the bot will show pressures in its
    output. The type of pressure shown will depend on the metric/imperial settings."""
    ))
conf.registerChannelValue(
    WunderWeather, 'forecastDays',
    registry.NonNegativeInteger(
        0, """Determines how many days the forecast shows, up to 7.
    If set to 0, show all days. See showForecast configuration variable to turn off
    forecast display."""))
conf.registerChannelValue(
    WunderWeather, 'showCurrentByDefault',
    registry.Boolean(
        True, """If True, will show the current conditions in the weather
    output if no ouput control switches are given."""))
conf.registerChannelValue(
    WunderWeather, 'showForecastByDefault',
    registry.Boolean(
        True, """If True, will show the forecast in the weather
    output if no ouput control switches are given."""))

conf.registerUserValue(conf.users.plugins.WunderWeather, 'lastLocation',
                       registry.String('', ''))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
    registry.NonNegativeInteger(
        2,
        """Determines how many days the forecast shows, up to 7.
    If set to 0, show all days. See showForecast configuration variable to turn off
    forecast display.""",
    ),
)
conf.registerChannelValue(
    WunderWeather,
    "showCurrentByDefault",
    registry.Boolean(
        True,
        """If True, will show the current conditions in the weather
    output if no ouput control switches are given.""",
    ),
)
conf.registerChannelValue(
    WunderWeather,
    "showForecastByDefault",
    registry.Boolean(
        True,
        """If True, will show the forecast in the weather
    output if no ouput control switches are given.""",
    ),
)

conf.registerUserValue(conf.users.plugins.WunderWeather, "lastLocation", registry.String("", ""))


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Beispiel #3
0
class WeatherUnit(registry.String):
    def setValue(self, s):
        s = s.capitalize()
        if s not in plugin.unitAbbrevs:
            raise registry.InvalidRegistryValue,\
                  'Unit must be one of Fahrenheit, Celsius, or Kelvin.'
        s = plugin.unitAbbrevs[s]
        registry.String.setValue(self, s)

class WeatherCommand(registry.OnlySomeStrings):
    validStrings = plugin.Weather.weatherCommands.keys()

Weather = conf.registerPlugin('Weather')
conf.registerChannelValue(Weather, 'temperatureUnit',
    WeatherUnit('Fahrenheit', """Sets the default temperature unit to use when
    reporting the weather."""))
conf.registerChannelValue(Weather, 'command',
    WeatherCommand('wunder', """Sets the default command to use when retrieving
    the weather.  Command must be one of %s.""" %
    utils.str.commaAndify(plugin.Weather.weatherCommands, And='or')))
conf.registerChannelValue(Weather, 'convert',
    registry.Boolean(True, """Determines whether the weather commands will
    automatically convert weather units to the unit specified in
    supybot.plugins.Weather.temperatureUnit."""))

conf.registerUserValue(conf.users.plugins.Weather, 'lastLocation',
    registry.String('', ''))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #4
0
conf.registerGlobalValue(SupyTweet.mentions, 'channel',
    registry.SpaceSeparatedListOfStrings("", """List of channels to announce new mentions to (can be channel or nick)"""))

conf.registerGlobalValue(SupyTweet.mentions, 'waitPeriod',
    registry.PositiveInteger(240, """Delay in seconds between each new mention check"""))

conf.registerGlobalValue(SupyTweet, 'DM',
    registry.Boolean(True, """Toggle DM checking and announces"""))

conf.registerGlobalValue(SupyTweet.DM, 'channel',
    registry.SpaceSeparatedListOfStrings("", """List of channels to announce new DMs to (can be channel or nick)"""))

conf.registerGlobalValue(SupyTweet.DM, 'waitPeriod',
    registry.PositiveInteger(360, """Delay in seconds between each new DM check"""))

conf.registerGlobalValue(SupyTweet, 'timeline',
    registry.Boolean(True, """Toggle home timeline checking and announces"""))

conf.registerGlobalValue(SupyTweet.timeline, 'channel',
    registry.SpaceSeparatedListOfStrings("", """List of channels to announce new timeline tweets to (can be channel or nick)"""))

conf.registerGlobalValue(SupyTweet.timeline, 'waitPeriod',
    registry.PositiveInteger(120, """Delay in seconds between each new timeline check"""))

conf.registerUserValue(conf.users.plugins.SupyTweet, 'coTag',
    registry.String('', ''))
    

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: