Example #1
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself 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('String', True)


String = conf.registerPlugin('String')
conf.registerGroup(String, 'levenshtein')
conf.registerGlobalValue(String.levenshtein, 'max',
    registry.PositiveInteger(256, """Determines the maximum size of a string
    given to the levenshtein command.  The levenshtein command uses an O(m*n)
    algorithm, which means that with strings of length 256, it can take 1.5
    seconds to finish; with strings of length 384, though, it can take 4
    seconds to finish, and with strings of much larger lengths, it takes more
    and more time.  Using nested commands, strings can get quite large, hence
    this variable, to limit the size of arguments passed to the levenshtein
    command."""))
conf.registerGroup(String, 're')
conf.registerGlobalValue(String.re, 'timeout',
    registry.PositiveFloat(0.1, """Determines the maximum time, in seconds, that
    a regular expression is given to execute before being terminated. Since
    there is a possibility that user input for the re command can cause it to
    eat up large amounts of ram or cpu time, it's a good idea to keep this
    low. Most normal regexps should not take very long at all."""))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Example #2
0
    SedRegex, 'displayErrors',
    registry.Boolean(True, _("""Should errors be displayed?""")))
conf.registerChannelValue(
    SedRegex, 'boldReplacementText',
    registry.Boolean(True, _("""Should the replacement text be bolded?""")))
conf.registerChannelValue(
    SedRegex, 'enable',
    registry.Boolean(
        False,
        _("""Should Perl/sed-style regex replacing
                     work in this channel?""")))
conf.registerChannelValue(
    SedRegex, 'ignoreRegex',
    registry.Boolean(
        True,
        _("""Should Perl/sed regex replacing
                     ignore messages which look like valid regex?""")))
conf.registerGlobalValue(
    SedRegex, 'processTimeout',
    registry.PositiveFloat(
        0.5,
        _("""Sets the timeout when processing a single
                                   regexp. The default should be adequate unless
                                   you have a busy or low-powered system that
                                   cannot process regexps quickly enough. However,
                                   you will not want to set this value too high
                                   as that would make your bot vulnerable to ReDoS
                                   attacks.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Example #3
0
    # a bool that specifies whether the user identified himself 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('Mumble', True)


Mumble = conf.registerPlugin('Mumble')

conf.registerGlobalValue(
    Mumble, 'serverIp',
    registry.String('127.0.0.1', _("""Server IP of murmur""")))
conf.registerGlobalValue(
    Mumble, 'serverPort',
    registry.String('6502', _("""Murmur port to connect to""")))
#conf.registerGlobalValue(Mumble, 'mumbleSlice',
#    registry.String('/usr/share/murmur/Murmur.ice', _("""Path to Murmur.ice""")))
conf.registerGlobalValue(
    Mumble, 'mumbleSecret',
    registry.String('mysecret', _("""Password to connect to murmur""")))
conf.registerGlobalValue(
    Mumble, 'announceChannels',
    registry.SpaceSeparatedListOfStrings(
        '', _("""Channels to announce mumble changes to""")))
conf.registerGlobalValue(
    Mumble, 'checkInterval',
    registry.PositiveFloat(
        10.0, _("""Interval to check for new online users in murmur""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Example #4
0
    # 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
    Mittag = conf.registerPlugin('Mittag', True)

    Mittag.apiKey.setValue(something("Please enter your API Key:"))
    Mittag.latitude.setValue(something("Latitude:"))
    Mittag.longitude.setValue(something("Longitude:"))
    Mittag.distance.setValue(something("Distance:", default=2.5))
    Mittag.prefixNick.setValue(yn("Prefix nickname in replies?",
                                  default=False))


Mittag = conf.registerPlugin('Mittag')

conf.registerChannelValue(
    Mittag, 'apiKey',
    registry.String('', 'Your Mittag.at API key', private=True))
conf.registerChannelValue(Mittag, 'latitude', registry.Float(0.0, 'Latitude'))
conf.registerChannelValue(Mittag, 'longitude',
                          registry.Float(0.0, 'Longitude'))
conf.registerChannelValue(Mittag, 'distance',
                          registry.PositiveFloat(2.5, 'Distance'))
conf.registerChannelValue(
    Mittag, 'prefixNick',
    registry.Boolean(False, 'Whether or not to prefix nickname in replies'))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Example #5
0
    less likely (and far more annoying) for users to flood witih invalid
    commands than for them to flood with valid commands."""))
registerGlobalValue(
    supybot.abuse.flood.command.invalid, 'notify',
    registry.Boolean(
        True, """Determines whether the bot will notify people that they're
    being ignored for invalid command flooding."""))

###
# supybot.drivers.  For stuff relating to Supybot's drivers (duh!)
###
registerGroup(supybot, 'drivers')
registerGlobalValue(
    supybot.drivers, 'poll',
    registry.PositiveFloat(
        1.0, """Determines the default length of time a
    driver should block waiting for input."""))


class ValidDriverModule(registry.OnlySomeStrings):
    validStrings = ('default', 'Socket', 'Twisted')


registerGlobalValue(
    supybot.drivers, 'module',
    ValidDriverModule(
        'default', """Determines what driver module the bot will
    use.  Socket, a simple driver based on timeout sockets, is used by default
    because it's simple and stable.  Twisted is very stable and simple, and if
    you've got Twisted installed, is probably your best bet."""))
Example #6
0
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('PulpTriage', True)


PulpTriage = conf.registerPlugin('PulpTriage')

conf.registerGlobalValue(
    PulpTriage, 'proposal_timeout',
    registry.PositiveFloat(2.0, """Time, in seconds, to ignore proposals
    after a triage user makes a proposal. This prevents multiple simultaneous
    proposals from overlapping."""))
conf.registerGlobalValue(
    PulpTriage, 'quorum_count',
    registry.NonNegativeInteger(2, """Number of users required to reach a
    quorum. New issues will not be submitted for triage if the number of
    triaging users goes below this count."""))
conf.registerGlobalValue(
    PulpTriage, 'proposal_timeout',
    registry.NonNegativeInteger(2, """Number of seconds to wait after
    accepting a proposal before accepting another (prevents confusion
    by only accepting one proposal at a time)"""))
conf.registerGlobalValue(
    PulpTriage, 'report_id',
    registry.NonNegativeInteger(134, """ID of the Redmine report containing
    non-triaged issues"""))
Example #7
0
    # a bool that specifies whether the user identified himself 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('BGs', True)


BGs = conf.registerPlugin('BGs')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(BGs, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))

conf.registerGlobalValue(
    BGs, 'measurementTransitionValue',
    registry.PositiveFloat(
        30,
        """For BG measurements at or below this value, BGs will assume measurements are in 
					mmol/L by default, otherwise mg/dL."""))

conf.registerGlobalValue(
    BGs, 'measurementTransitionValueA1C',
    registry.PositiveFloat(
        20,
        """For A1C measurements at or below this value, BGs will assume measurements are in 
					DCCT percentage by default, otherwise IFCC mmol/mol."""))

conf.registerGlobalValue(
    BGs, 'defaultLastBGCount',
    registry.PositiveInteger(
        10,
        """If no count is specified, the "bgs last" command will return up to this many values."""
    ))
Example #8
0
conf.registerGlobalValue(
    BitcoinWallet, 'accountNamePrefix',
    registry.String('ircbot', """Prefix to use for account names in the
    wallet."""))

conf.registerGlobalValue(
    BitcoinWallet, 'jsonRpcUrl',
    registry.String('http://*****:*****@127.0.0.1:8332',
                    """The JSON RPC URL
    for the Bitcoin wallet.""",
                    private=True))

conf.registerGlobalValue(
    BitcoinWallet, 'minConf',
    registry.NonNegativeInteger(
        0, """The amount of confirmations to
    require for wallet operations."""))

conf.registerGlobalValue(
    BitcoinWallet, 'minAmount',
    registry.PositiveFloat(0.01, """Minimum amount for payments."""))

conf.registerGlobalValue(
    BitcoinWallet, 'requireCloak',
    registry.Boolean(
        True, """Only allow users with cloaks to enter orders.
    Good idea to have this set to prevent clonebot attacks to spamify the
    database."""))

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