Exemple #1
0
    def update(self):
        """update the geo files"""
        now = int(time.time())
        try:
            lastupdate = self.registryValue('datalastupdated')
            self.log.info('Last update: %s seconds ago.' % lastupdate)
        except registry.NonExistentRegistryEntry:
            self.log.info(
                'supybot.plugins.%s.datalastupdate not set. Creating...' %
                self.name)
            conf.registerGlobalValue(
                conf.supybot.plugins.get(self.name), 'datalastupdated',
                registry.PositiveInteger(
                    1,
                    """An integer representing the time since epoch the .dat file was last updated."""
                ))
            self.log.info('...success!')
            lastupdate = 1
            self.log.info('Last update: Unknown/Never')

        #if (now-lastupdate)>604800: # updated weekly
        if 1 == 1:
            self.setRegistryValue('datalastupdated', now)
            self.log.info("Starting update of Geo data files...")
            self.getfile()
        return
Exemple #2
0
def registerBugzilla(name, url=''):
    if (not re.match('\w+$', name)):
        s = utils.str.normalizeWhitespace(BugzillaName.__doc__)
        raise registry.InvalidRegistryValue("%s (%s)" % (s, name))

    install = conf.registerGroup(conf.supybot.plugins.Bugzilla.bugzillas,
                                 name.lower())
    conf.registerGlobalValue(install, 'url',
        registry.String(url, """Determines the URL to this Bugzilla
        installation. This must be identical to the urlbase (or sslbase)
        parameter used by the installation. (The url that shows up in
        emails.) It must end with a forward slash."""))
    conf.registerChannelValue(install, 'queryTerms',
        registry.String('',
        """Additional search terms in QuickSearch format, that will be added to
        every search done with "query" against this installation."""))
#    conf.registerGlobalValue(install, 'aliases',
#        BugzillaNames([], """Alternate names for this Bugzilla
#        installation. These must be globally unique."""))

    conf.registerGroup(install, 'watchedItems', orderAlphabetically=True)
    conf.registerChannelValue(install.watchedItems, 'product',
        registry.CommaSeparatedListOfStrings([],
        """What products should be reported to this channel?"""))
    conf.registerChannelValue(install.watchedItems, 'component',
        registry.CommaSeparatedListOfStrings([],
        """What components should be reported to this channel?"""))
    conf.registerChannelValue(install.watchedItems, 'changer',
        registry.SpaceSeparatedListOfStrings([],
        """Whose changes should be reported to this channel?"""))
    conf.registerChannelValue(install.watchedItems, 'all',
        registry.Boolean(False,
        """Should *all* changes be reported to this channel?"""))

    conf.registerChannelValue(install, 'reportedChanges',
        registry.CommaSeparatedListOfStrings(['newBug', 'newAttach', 'Flags',
        'Attachment Flags', 'Resolution', 'Product', 'Component'],
        """The names of fields, as they appear in bugmail, that should be
        reported to this channel."""))

    conf.registerGroup(install, 'traces')
    conf.registerChannelValue(install.traces, 'report',
        registry.Boolean(False, """Some Bugzilla installations have gdb
        stack traces in comments. If you turn this on, the bot will report
        some basic details of any trace that shows up in the comments of
        a new bug."""))
    conf.registerChannelValue(install.traces, 'ignoreFunctions',
        registry.SpaceSeparatedListOfStrings(['__kernel_vsyscall', 'raise',
        'abort', '??'], """Some functions are useless to report, from a stack trace.
        This contains a list of function names to skip over when reporting
        traces to the channel."""))
    #conf.registerChannelValue(install.traces, 'crashStarts',
    #    registry.CommaSeparatedListOfStrings([],
    #    """These are function names that indicate where a crash starts
    #    in a stack trace."""))
    conf.registerChannelValue(install.traces, 'frameLimit',
        registry.PositiveInteger(5, """How many stack frames should be
        reported from the crash?"""))
Exemple #3
0
    halfop people with the <channel>,halfop capability when they join the
    channel.""")))
conf.registerChannelValue(
    AutoMode, 'voice',
    registry.Boolean(
        True,
        _("""Determines whether the bot will automatically
    voice people with the <channel>,voice capability when they join the
    channel.""")))
conf.registerChannelValue(
    AutoMode, 'ban',
    registry.Boolean(
        True,
        _("""Determines whether the bot will automatically
    ban people who join the channel and are on the banlist.""")))
conf.registerChannelValue(
    AutoMode.ban, 'period',
    registry.PositiveInteger(
        86400,
        _("""Determines how many seconds the bot
    will automatically ban a person when banning.""")))

conf.registerChannelValue(
    AutoMode, 'delay',
    registry.Integer(
        0,
        _("""Determines how many seconds the bot will wait
    before applying a mode. Has no effect on bans.""")))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #4
0
# POSSIBILITY OF SUCH DAMAGE.
###

import supybot.conf as conf
import supybot.registry as registry


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('NickCapture', True)


NickCapture = conf.registerPlugin('NickCapture')
conf.registerPlugin('NickCapture')
conf.registerGlobalValue(
    NickCapture, 'ison',
    registry.Boolean(
        True, """Determines whether the bot will check
    occasionally if its preferred nick is in use via the ISON command."""))
conf.registerGlobalValue(
    NickCapture.ison, 'period',
    registry.PositiveInteger(
        600, """Determines how often (in seconds) the bot
    will check whether its nick ISON."""))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #5
0
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Limiter', True)


Limiter = conf.registerPlugin('Limiter')
conf.registerChannelValue(
    Limiter, 'enable',
    registry.Boolean(
        False,
        _("""Determines whether the bot will maintain the
    channel limit to be slightly above the current number of people in the
    channel, in order to make clone/drone attacks harder.""")))
conf.registerChannelValue(
    Limiter, 'minimumExcess',
    registry.PositiveInteger(
        5,
        _("""Determines the minimum number of free
    spots that will be saved when limits are being enforced.  This should
    always be smaller than supybot.plugins.Limiter.limit.maximumExcess.""")))
conf.registerChannelValue(
    Limiter, 'maximumExcess',
    registry.PositiveInteger(
        10,
        _("""Determines the maximum number of free spots
    that will be saved when limits are being enforced.  This should always be
    larger than supybot.plugins.Limiter.limit.minimumExcess.""")))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #6
0
Trivia = conf.registerPlugin('Trivia')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Trivia, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))

conf.registerChannelValue(
    Trivia, 'blankChar',
    registry.String(
        '*',
        _("""The character used for a blank when
        displaying hints""")))

conf.registerChannelValue(
    Trivia, 'numHints',
    registry.PositiveInteger(
        3, _("""The number of hints to be given for
        each question""")))

conf.registerChannelValue(
    Trivia, 'timeout',
    registry.PositiveInteger(
        90, _("""The number of seconds to allow for
        each question""")))

conf.registerChannelValue(
    Trivia, 'hintPercentage',
    registry.Probability(
        0.25,
        _("""The fraction of the answer that
        should be revealed with each hint""")))
Exemple #7
0
conf.registerChannelValue(
    Timebomb, 'exclusions',
    registry.SpaceSeparatedListOfStrings(
        [], """A list of nicks who should be excluded from being 
            randombombed"""))

conf.registerChannelValue(
    Timebomb, 'allowBombs',
    registry.Boolean(
        True, """Determines whether timebombs are allowed 
            in the channel."""))

conf.registerChannelValue(
    Timebomb, 'minWires',
    registry.PositiveInteger(
        2, """Determines the minimum number of wires 
            a timebomb will have."""))

conf.registerChannelValue(
    Timebomb, 'maxWires',
    registry.PositiveInteger(
        4, """Determines the maximum number of wires 
            a timebomb will have."""))

conf.registerChannelValue(
    Timebomb, 'minTime',
    registry.PositiveInteger(
        45, """Determines the minimum time of a 
            timebomb timer, in seconds."""))

conf.registerChannelValue(
Exemple #8
0
conf.registerGlobalValue(
    Sigyn, 'wordsList',
    registry.CommaSeparatedListOfStrings(
        [''], """paths of files contains one word per line"""))

conf.registerGlobalValue(
    Sigyn, 'logChannel',
    registry.String("", """channel where bot's actions is announced"""))
conf.registerGlobalValue(
    Sigyn, 'useNotice',
    registry.Boolean(False, """use notices for announces in logChannel"""))

conf.registerGlobalValue(
    Sigyn, 'resolverTimeout',
    registry.PositiveInteger(
        3, """max duration of dns request/resolve in seconds"""))

conf.registerGlobalValue(
    Sigyn, 'klineDuration',
    registry.Integer(
        -1,
        """kline duration, in minutes, with -1, bot will not kill or kline"""))
conf.registerGlobalValue(
    Sigyn, 'klineMessage',
    registry.String(
        "Please do not spam users or channels on freenode. If in error, please contact [email protected].",
        """default reason used in kline's message"""))
conf.registerChannelValue(
    Sigyn, 'killMessage',
    registry.String("Spam is off topic on freenode.", """kill reason"""))
Exemple #9
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:
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('RatingSystem', True)


RatingSystem = conf.registerPlugin('RatingSystem')

conf.registerGlobalValue(
    RatingSystem, 'requirePositiveRating',
    registry.Boolean(
        True, """Only allow users with a positive rating to enter
    ratings."""))

conf.registerGlobalValue(
    RatingSystem, 'ratingMax',
    registry.PositiveInteger(
        10, """Maximum possible trust rating that can be
    given to a user."""))

conf.registerGlobalValue(
    RatingSystem, 'ratingMin',
    registry.Integer(
        -10, """Minimum possible trust rating that can be
    given to a user."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #11
0
import supybot.conf as conf
import supybot.registry as registry

def configure(advanced):
    conf.registerPlugin('Muzzle', True)


Muzzle = conf.registerPlugin('Muzzle')
conf.registerChannelValue(Muzzle, 'enable',
    registry.Boolean(False, """Determines whether or not the bot will
    automatically voice (after {supybot.plugins.Muzzle.delay}) users who join
    the channel."""))
conf.registerChannelValue(Muzzle, 'delay',
    registry.PositiveInteger(30, """The delay (in seconds) before a user will be
    automatically voiced after joining the channel."""))
Exemple #12
0
# conf.registerGlobalValue(Gatekeeper, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))

conf.registerGlobalValue(
    Gatekeeper, 'targetChannel',
    registry.String("#bitcoin-otc", """Target channel for gatekeeper
    management"""))

conf.registerGlobalValue(
    Gatekeeper, 'ratingThreshold',
    registry.NonNegativeInteger(0, """Minimum rating to be allowed in."""))

conf.registerGlobalValue(
    Gatekeeper, 'accountAgeThreshold',
    registry.PositiveInteger(
        604800, """Minimum account age, in seconds,
    to be allowed in."""))

conf.registerGlobalValue(
    Gatekeeper, 'invite',
    registry.Boolean(False, """Should the bot invite the user to channel?"""))

conf.registerGlobalValue(
    Gatekeeper, 'msgOnJoinVoice',
    registry.String(
        "Join #bitcoin-otc-foyer and see channel topic for instructions on getting voice on #bitcoin-otc.",
        """Message to send to unauthed users with instructions on 
    how to get voice in channel."""))

conf.registerGlobalValue(
    Gatekeeper, 'msgOnJoinIdent',
Exemple #13
0
    # 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('DDG', True)


class SafeSearch(registry.OnlySomeStrings):
    validStrings = ['active', 'moderate', 'off']


DDG = conf.registerPlugin('DDG')
conf.registerChannelValue(
    DDG, 'maxResults',
    registry.PositiveInteger(
        4,
        _("""Determines the maximum number of
    results the bot will respond with.""")))
conf.registerChannelValue(
    DDG, 'showSnippet',
    registry.Boolean(
        True,
        _("""Determines whether the bot will show a
    snippet of each resulting link. If False, it will show the title
    of the link instead.""")))
conf.registerChannelValue(
    DDG, 'region',
    registry.String(
        "",
        _("""Set the DDG search region to return results
    for the language/country of your choice. E.g. 'us-en' for United States.
    https://duckduckgo.com/params""")))
Exemple #14
0
###

import supybot.conf as conf
import supybot.registry as registry


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('Market', True)


Market = conf.registerPlugin('Market')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Market, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(
    Market, 'fullDepthCachePeriod',
    registry.PositiveInteger(
        245, """Number of seconds to cache the
     full depth data from mtgox, to avoid getting banned."""))
conf.registerGlobalValue(
    Market, 'defaultExchange',
    registry.String('btsp', """Default exchange to query for market data."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #15
0
    variables.""")))

###########
# Announces

conf.registerChannelValue(
    RSS, 'announce',
    registry.SpaceSeparatedSetOfStrings([],
                                        _("""Determines which RSS feeds
    should be announced in the channel; valid input is a list of strings
    (either registered RSS feeds or RSS feed URLs) separated by spaces.""")))
conf.registerGlobalValue(
    RSS, 'waitPeriod',
    registry.PositiveInteger(
        1800,
        _("""Indicates how many seconds the bot will
    wait between retrieving RSS feeds; requests made within this period will
    return cached results.""")))
conf.registerGlobalValue(
    RSS, 'sortFeedItems',
    FeedItemSortOrder(
        'asInFeed',
        _("""Determines whether feed items should be
    sorted by their update timestamp or kept in the same order as they appear
    in a feed.""")))

####################
# Headlines filtering
conf.registerChannelValue(
    RSS, 'defaultNumberOfHeadlines',
    registry.PositiveInteger(
Exemple #16
0
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('Qalculate')
except:
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = lambda x: x


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('Qalculate', True)


Qalculate = conf.registerPlugin('Qalculate')
conf.registerGlobalValue(
    Qalculate, 'command',
    registry.String(
        utils.findBinaryInPath('qalc') or '',
        _("""Set the path of the 'qalc' command. On snap installations this is "qalculate.qalc"."""
          )))
conf.registerGlobalValue(
    Qalculate, 'timeout',
    registry.PositiveInteger(
        2000, _("""Set the timeout for the qalc command in milliseconds.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #17
0
    Filter.spellit, 'replacePunctuation',
    registry.Boolean(
        True,
        _("""Determines whether or not
    to replace punctuation in the output of spellit.""")))
conf.registerGlobalValue(
    Filter.spellit, 'replaceNumbers',
    registry.Boolean(
        True,
        _("""Determines whether or not to
    replace numbers in the output of spellit.""")))
conf.registerGroup(Filter, 'shrink')
conf.registerChannelValue(
    Filter.shrink, 'minimum',
    registry.PositiveInteger(
        4,
        _("""Determines the minimum number of a letters
    in a word before it will be shrunken by the shrink command/filter.""")))


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('Filter', True)


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #18
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('Misc', True)


Misc = conf.registerPlugin('Misc')
conf.registerChannelValue(
    Misc, 'mores',
    registry.PositiveInteger(
        1,
        _("""Determines how many messages the bot
    will issue when using the 'more' command.""")))
conf.registerGlobalValue(
    Misc, 'listPrivatePlugins',
    registry.Boolean(
        False,
        _("""Determines whether the bot will list private
    plugins with the list command if given the --private switch.  If this is
    disabled, non-owner users should be unable to see what private plugins
    are loaded.""")))
conf.registerGlobalValue(
    Misc, 'customHelpString',
    registry.String(
        '',
        _("""Sets a custom help string, displayed when the 'help'
    command is called without arguments.""")))
Exemple #19
0
    RSS, 'announcementSeparator',
    registry.StringWithSpaceOnRight(
        _(': '),
        _("""Determines what
    suffix is appended to the feed name in a news item.""")))
conf.registerChannelValue(
    RSS, 'announce',
    registry.SpaceSeparatedSetOfStrings([],
                                        _("""Determines which RSS feeds
    should be announced in the channel; valid input is a list of strings
    (either registered RSS feeds or RSS feed URLs) separated by spaces.""")))
conf.registerGlobalValue(
    RSS, 'waitPeriod',
    registry.PositiveInteger(
        1800,
        _("""Indicates how many seconds the bot will
    wait between retrieving RSS feeds; requests made within this period will
    return cached results.""")))
conf.registerGlobalValue(
    RSS, 'sortFeedItems',
    FeedItemSortOrder(
        'asInFeed',
        _("""Determines whether feed items should be
    sorted by their update timestamp or kept in the same order as they appear
    in a feed.""")))
conf.registerGlobalValue(
    RSS, 'stripRedirect',
    registry.Boolean(
        True,
        """Determines whether the bot will attempt to strip url redirection
    from headline links, by taking things after the last http://."""))
Exemple #20
0
from supybot import conf, registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('Random')
except:
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = lambda x: x


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('Random', True)


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

conf.registerGlobalValue(
    Random, 'maxCoins',
    registry.PositiveInteger(
        50000, _("""The maximum amount of coins that can be flipped""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #21
0
###

import supybot.conf as conf
import supybot.registry as registry


def configure(advanced):
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('FloodProtect', True)


FloodProtect = conf.registerPlugin('FloodProtect')
conf.registerGlobalValue(
    FloodProtect, 'lifeQueueKick',
    registry.PositiveInteger(
        7,
        """Queue life for flood kick detection ( in seconds : default 7)"""))
conf.registerGlobalValue(
    FloodProtect, 'lifeQueueBan',
    registry.PositiveInteger(
        600,
        """Queue life for flood ban detection ( in seconds : default 600)"""))
conf.registerGlobalValue(
    FloodProtect, 'lifeQueueLongBan',
    registry.PositiveInteger(
        3600,
        """Queue life for flood long ban detection ( in seconds : default 3600)"""
    ))

conf.registerChannelValue(
    FloodProtect, 'enable',
Exemple #22
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('Ctcp', True)


###
# Ctcp plugin configuration variables.
###
Ctcp = conf.registerPlugin('Ctcp')
conf.registerGlobalValue(
    Ctcp, 'versionWait',
    registry.PositiveInteger(
        10, """Determines how many seconds the bot will
    wait after getting a version command (not a CTCP VERSION, but an actual
    call of the command in this plugin named "version") before replying with
    the results it has collected."""))

###
# supybot.abuse configuration variables.
###
conf.registerGlobalValue(
    conf.supybot.abuse.flood, 'ctcp',
    registry.Boolean(
        True, """Determines whether the bot will defend itself
    against CTCP flooding."""))
conf.registerGlobalValue(
    conf.supybot.abuse.flood.ctcp, 'maximum',
    registry.PositiveInteger(
        5, """Determines how many CTCP messages (not
Exemple #23
0
    Herald, 'heralding',
    registry.Boolean(
        True,
        _("""Determines whether messages will be sent to the
    channel when a recognized user joins; basically enables or disables the
    plugin.""")))
conf.registerGlobalValue(
    Herald, 'requireCapability',
    registry.String(
        '',
        _("""Determines what capability (if any) is required to
    add/change/remove the herald of another user.""")))
conf.registerChannelValue(
    Herald, 'throttle',
    registry.PositiveInteger(
        600,
        _("""Determines the minimum number of seconds
    between heralds.""")))
conf.registerChannelValue(
    Herald.throttle, 'afterPart',
    registry.NonNegativeInteger(
        0,
        _("""Determines the minimum number of seconds
    after parting that the bot will not herald the person when he or she
    rejoins.""")))
conf.registerChannelValue(
    Herald.throttle, 'afterSplit',
    registry.NonNegativeInteger(
        60,
        _("""Determines the minimum number of seconds
    after a netsplit that the bot will not herald the users that split.""")))
conf.registerChannelValue(
Exemple #24
0
import supybot.conf as conf
import supybot.registry as registry


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('Notify', True)


Notify = conf.registerPlugin('Notify')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Notify, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(
    Notify, 'server_address',
    registry.String(
        '0.0.0.0', """Address for the IRC notification server to listen on"""))
conf.registerGlobalValue(
    Notify, 'server_port',
    registry.PositiveInteger(
        5050, """Port for the IRC notification server to listen on"""))
conf.registerGlobalValue(
    Notify, 'use_notice',
    registry.Boolean(False, """Use notices instead of privmsgs"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #25
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('GPG', True)


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

conf.registerGroup(GPG, 'auth')
conf.registerGroup(GPG.auth, 'sign')

conf.registerGlobalValue(
    GPG.auth.sign, 'enable',
    registry.Boolean(
        True, """Determines whether or not users are
    allowed to use GPG signing for authentication."""))
conf.registerGlobalValue(
    GPG.auth.sign, 'TokenTimeout',
    registry.PositiveInteger(
        60 * 10, """Determines the lifetime of a GPG
    signature authentication token (in seconds)."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #26
0
    registry.Boolean(
        False,
        _("""Determines whether the bot should status prefixes
    (@, %, +) when relaying.""")))

conf.registerGroup(RelayNext, 'antiflood')
conf.registerChannelValue(
    RelayNext.antiflood, 'enable',
    registry.Boolean(
        False,
        _("""Determines whether flood prevention should be enabled
    for the given channel.""")))
conf.registerChannelValue(
    RelayNext.antiflood, 'seconds',
    registry.PositiveInteger(
        20,
        _("""Determines how many seconds messages should be queued
        for flood protection.""")))
conf.registerChannelValue(
    RelayNext.antiflood, 'maximum',
    registry.PositiveInteger(
        15,
        _("""Determines the maximum amount of incoming messages
        the bot will allow from a relay channel before flood protection is triggered."""
          )))
conf.registerChannelValue(
    RelayNext.antiflood.maximum, 'nonPrivmsgs',
    registry.PositiveInteger(
        10,
        _("""Determines the maximum amount of incoming non-PRIVMSG events
        the bot will allow from a relay channel before flood protection is triggered."""
          )))
Exemple #27
0
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('Geo')
except:
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = lambda x: x


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('Geo', True)


Geo = conf.registerPlugin('Geo')
conf.registerGlobalValue(
    Geo, 'datalastupdated',
    registry.PositiveInteger(
        1,
        """An integer representing the time since epoch the .dat file was last updated."""
    ))

conf.registerGlobalValue(
    Geo, 'licenseKey',
    registry.String('', """MaxMind license key.""", private=True))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('ArtificialIntelligence', True)


ArtificialIntelligence = conf.registerPlugin('ArtificialIntelligence')
conf.registerChannelValue(
    ArtificialIntelligence, 'ignoreBotCommands',
    registry.Boolean(
        False, """Determines whether messages addressed to the
    bot are ignored."""))
conf.registerChannelValue(
    ArtificialIntelligence, 'minChainLength',
    registry.PositiveInteger(
        1, """Determines the length of the smallest chain
    which the markov command will generate."""))
conf.registerChannelValue(
    ArtificialIntelligence, 'maxAttempts',
    registry.PositiveInteger(
        1, """Determines the maximum number of times the
    bot will attempt to generate a chain that meets or exceeds the size set in
    minChainLength."""))

conf.registerGroup(ArtificialIntelligence, 'randomSpeaking')
conf.registerChannelValue(
    ArtificialIntelligence.randomSpeaking, 'probability',
    registry.Probability(
        0, """Determines the probability that
    will be checked against to determine whether the bot should randomly say
    something.  If 0, the bot will never say anything on it's own.  If 1, the
Exemple #29
0
    registry.Boolean(
        False, """Determines whether the
    shrink snarfer is enabled.  This snarfer will watch for URLs in the
    channel, and if they're sufficiently long (as determined by
    supybot.plugins.ShrinkUrl.minimumLength) it will post a
    smaller URL from the service denoted in
    supybot.plugins.ShrinkUrl.default."""))
conf.registerChannelValue(
    ShrinkUrl.shrinkSnarfer, 'showDomain',
    registry.Boolean(
        True, """Determines whether the snarfer will show the
    domain of the URL being snarfed along with the shrunken URL."""))
conf.registerChannelValue(
    ShrinkUrl, 'minimumLength',
    registry.PositiveInteger(
        48, """The minimum length a URL must be before
    the bot will shrink it."""))
conf.registerChannelValue(
    ShrinkUrl, 'nonSnarfingRegexp',
    registry.Regexp(
        None, """Determines what URLs are to be snarfed; URLs
    matching the regexp given will not be snarfed.  Give the empty string if
    you have no URLs that you'd like to exclude from being snarfed."""))
conf.registerChannelValue(
    ShrinkUrl, 'outFilter',
    registry.Boolean(
        False, """Determines whether the bot will shrink the URLs
    of outgoing messages if those URLs are longer than
    supybot.plugins.ShrinkUrl.minimumLength."""))
conf.registerChannelValue(
    ShrinkUrl, 'default',
Exemple #30
0
conf.registerGlobalValue(
    MarketMonitor, 'channels',
    CommaSeparatedListOfChannels(
        "", """List of channels that should
    receive monitoring output."""))
conf.registerGlobalValue(
    MarketMonitor, 'network',
    registry.String("freenode", """Network that should
    receive monitoring output."""))
conf.registerGlobalValue(
    MarketMonitor, 'server',
    registry.String("bitcoincharts.com", """Server to connect to."""))
conf.registerGlobalValue(
    MarketMonitor, 'port',
    registry.PositiveInteger(27007, """Port to connect to."""))
conf.registerGlobalValue(
    MarketMonitor, 'autostart',
    registry.Boolean(
        False, """If true, will autostart monitoring upon bot
    startup."""))
conf.registerGlobalValue(
    MarketMonitor, 'marketsWhitelist',
    registry.SpaceSeparatedListOfStrings(
        "", """Whitelist of markets you
    want to monitor, space separated list of short market names. Leave
    blank to include all."""))
conf.registerGlobalValue(
    MarketMonitor, 'collapseThreshold',
    registry.Integer(
        3, """Minimum number of transactions the bot will