示例#1
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?"""))
示例#2
0
 registry.SpaceSeparatedListOfStrings(
     [
         "AliceBlue",
         "AntiqueWhite",
         "Aqua",
         "Aquamarine",
         "Azure",
         "Beige",
         "Bisque",
         "Black",
         "BlanchedAlmond",
         "Blue",
         "BlueViolet",
         "Brown",
         "BurlyWood",
         "CadetBlue",
         "Chartreuse",
         "Chocolate",
         "Coral",
         "CornflowerBlue",
         "Cornsilk",
         "Crimson",
         "Cyan",
         "DarkBlue",
         "DarkCyan",
         "DarkGoldenRod",
         "DarkGray",
         "DarkGreen",
         "DarkKhaki",
         "DarkMagenta",
         "DarkOliveGreen",
         "DarkOrange",
         "DarkOrchid",
         "DarkRed",
         "DarkSalmon",
         "DarkSeaGreen",
         "DarkSlateBlue",
         "DarkSlateGray",
         "DarkTurquoise",
         "DarkViolet",
         "DeepPink",
         "DeepSkyBlue",
         "DimGray",
         "DodgerBlue",
         "FireBrick",
         "FloralWhite",
         "ForestGreen",
         "Fuchsia",
         "Gainsboro",
         "GhostWhite",
         "Gold",
         "GoldenRod",
         "Gray",
         "Green",
         "GreenYellow",
         "HoneyDew",
         "HotPink",
         "IndianRed",
         "Indigo",
         "Ivory",
         "Khaki",
         "Lavender",
         "LavenderBlush",
         "LawnGreen",
         "LemonChiffon",
         "LightBlue",
         "LightCoral",
         "LightCyan",
         "LightGoldenRodYellow",
         "LightGrey",
         "LightGreen",
         "LightPink",
         "LightSalmon",
         "LightSeaGreen",
         "LightSkyBlue",
         "LightSlateGray",
         "LightSteelBlue",
         "LightYellow",
         "Lime",
         "LimeGreen",
         "Linen",
         "Magenta",
         "Maroon",
         "MediumAquaMarine",
         "MediumBlue",
         "MediumOrchid",
         "MediumPurple",
         "MediumSeaGreen",
         "MediumSlateBlue",
         "MediumSpringGreen",
         "MediumTurquoise",
         "MediumVioletRed",
         "MidnightBlue",
         "MintCream",
         "MistyRose",
         "Moccasin",
         "NavajoWhite",
         "Navy",
         "OldLace",
         "Olive",
         "OliveDrab",
         "Orange",
         "OrangeRed",
         "Orchid",
         "PaleGoldenRod",
         "PaleGreen",
         "PaleTurquoise",
         "PaleVioletRed",
         "PapayaWhip",
         "PeachPuff",
         "Peru",
         "Pink",
         "Plum",
         "PowderBlue",
         "Purple",
         "Red",
         "RosyBrown",
         "RoyalBlue",
         "SaddleBrown",
         "Salmon",
         "SandyBrown",
         "SeaGreen",
         "SeaShell",
         "Sienna",
         "Silver",
         "SkyBlue",
         "SlateBlue",
         "SlateGray",
         "Snow",
         "SpringGreen",
         "SteelBlue",
         "Tan",
         "Teal",
         "Thistle",
         "Tomato",
         "Turquoise",
         "Violet",
         "Wheat",
         "White",
         "WhiteSmoke",
         "Yellow",
         "YellowGreen",
     ],
     """The set of possible timebomb wire colors""",
 ),
示例#3
0
    displayed by the title snarfer.""")))
conf.registerChannelValue(Rweb, 'snarferShowTargetDomain',
    registry.Boolean(False, _("""Determines whether the domain name displayed
    by the snarfer will be the original one (posted on IRC) or the target one
    (got after following redirects, if any).""")))
conf.registerChannelValue(Rweb, 'nonSnarfingRegexp',
    registry.Regexp(None, _("""Determines what URLs matching the given regexp
    will not be snarfed.  Give the empty string if you have no URLs that you'd
    like to exclude from being snarfed.""")))
conf.registerChannelValue(Rweb, 'checkIgnored',
    registry.Boolean(True, _("""Determines whether the title snarfer checks
    if the author of a message is ignored.""")))

conf.registerGlobalValue(Rweb, 'urlWhitelist',
    registry.SpaceSeparatedListOfStrings([], """If set, bot will only fetch data
    from urls in the whitelist, i.e. starting with http://domain/optionalpath/. This will
    apply to all commands that retrieve data from user-supplied URLs,
    including fetch, headers, title, doctype."""))

conf.registerGlobalValue(Rweb, 'timeout',
    registry.NonNegativeInteger(5, """Determines the maximum number of
    seconds the bot will wait for the site to respond, when using a command
    in this plugin other than 'fetch'. If 0, will use socket.defaulttimeout"""))

conf.registerGroup(Rweb, 'fetch')
conf.registerGlobalValue(Rweb.fetch, 'maximum',
    registry.NonNegativeInteger(0, _("""Determines the maximum number of
    bytes the bot will download via the 'fetch' command in this plugin.""")))

conf.registerGlobalValue(Rweb.fetch, 'timeout',
    registry.NonNegativeInteger(5, """Determines the maximum number of
    seconds the bot will wait for the site to respond, when using the 'fetch'
示例#4
0
        _("""Determines whether fortune will give equal
    weight to the different fortune databases.  If false, then larger
    databases will be given more weight.  This sends the -e option to the
    fortune program.""")))
conf.registerChannelValue(
    Unix.fortune, 'offensive',
    registry.Boolean(
        False,
        _("""Determines whether fortune will retrieve
    offensive fortunes along with the normal fortunes.  This sends the -a
    option to the fortune program.""")))
conf.registerGlobalValue(
    Unix.fortune, 'files',
    registry.SpaceSeparatedListOfStrings([],
                                         _("""Determines what specific file
    (if any) will be used with the fortune command; if none is given, the
    system-wide default will be used.  Do note that this fortune file must be
    placed with the rest of your system's fortune files.""")))

conf.registerGroup(Unix, 'spell')
conf.registerGlobalValue(
    Unix.spell, 'command',
    registry.String(
        utils.findBinaryInPath('aspell') or utils.findBinaryInPath('ispell')
        or '',
        _("""Determines
    what command will be called for the spell command.""")))
conf.registerGlobalValue(
    Unix.spell, 'language',
    registry.String(
        'en',
示例#5
0
    # 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('SilencePlugin', True)


SilencePlugin = conf.registerPlugin('SilencePlugin')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(SilencePlugin, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(
    SilencePlugin, 'outblacklist',
    registry.SpaceSeparatedListOfStrings([],
                                         _("""List of plugins that should
    be muted.""")))
conf.registerGlobalValue(
    SilencePlugin, 'inblacklist',
    registry.SpaceSeparatedListOfStrings([],
                                         _("""List of plugins that should
    not get any command.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
示例#6
0

NoTrigger = conf.registerPlugin('NoTrigger')
conf.registerChannelValue(NoTrigger, 'enable',
    registry.Boolean(True, _("""Enable protection against triggering other bots.""")))
conf.registerChannelValue(NoTrigger, 'spaceBeforeNicks',
    registry.Boolean(False, _("""Add a space before messages beginning with
        "blah: " or "blah, ", preventing the bot from triggering other bots that
        respond to nick.""")))

conf.registerChannelValue(NoTrigger, 'colorAware',
    registry.Boolean(True, _("""Toggles whether the bot should be aware of color-stripping
        channel modes (+c or +S on most IRCds).""")))
conf.registerChannelValue(NoTrigger.colorAware, 'modes',
    registry.SpaceSeparatedListOfStrings("c S", _("""Defines a space-separated list of modes that should
        be treated as color-blocking modes. This is usually +c (block) and +S (stripcolour) on
        UnrealIRCd/InspIRCd, and just +c (stripcolor) on charybdis-based daemons.""")))

conf.registerChannelValue(NoTrigger, 'blockCtcp',
    registry.Boolean(False, _("""Determines whether the bot should block all outbound channel CTCPs
        except CTCP actions. If you are using the Ctcp plugin, you will want to turn this off.""")))

conf.registerChannelValue(NoTrigger, 'prefixes',
    registry.SpaceSeparatedListOfStrings(' '.join(string.punctuation),
        _("""Defines a space-separated list of prefix triggers the bot should ignore.""")))

conf.registerChannelValue(NoTrigger, 'suffixes',
    registry.SpaceSeparatedListOfStrings('',
        _("""Defines a space-separated list of suffix triggers the bot should ignore.""")))

conf.registerChannelValue(NoTrigger, 'blockBell',
示例#7
0
    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
    collapse together"""))


class Formats(registry.OnlySomeStrings):
    validStrings = ('raw', 'pretty')


conf.registerGlobalValue(
    MarketMonitor, 'format',
    Formats(
示例#8
0
conf.registerChannelValue(
    SpiffyTitles, 'ignoredTitlePattern',
    registry.Regexp("",
                    _("""Titles matching this pattern will be ignored.""")))

conf.registerGroup(SpiffyTitles, 'wikipedia')

conf.registerChannelValue(
    SpiffyTitles.wikipedia, 'enabled',
    registry.Boolean(
        True, _("""Whether to fetch extracts for Wikipedia articles.""")))

conf.registerChannelValue(
    SpiffyTitles.wikipedia, 'apiParams',
    registry.SpaceSeparatedListOfStrings(
        [],
        _("""Add or override API query parameters with a space-separated list of key=value pairs."""
          )))

conf.registerChannelValue(
    SpiffyTitles.wikipedia, 'titleParam',
    registry.String(
        "titles",
        _("""The query parameter that will hold the page title from the URL."""
          )))

# Ideally, links to specific article sections would produce the relevant output for that section. This is not currently implemented.
conf.registerChannelValue(
    SpiffyTitles.wikipedia, 'ignoreSectionLinks',
    registry.Boolean(True,
                     _("""Ignore links to specific article sections.""")))
示例#9
0
    _ = PluginInternationalization('AutoTrans')
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('AutoTrans', True)


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

conf.registerChannelValue(
    AutoTrans, 'queries',
    registry.SpaceSeparatedListOfStrings([],
                                         _("""A list of people who
    want to have a translated version of messages in a channel if the
    messages are not in their native language.
    Format: nick1:lang1 nick2:lang2.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
示例#10
0
import supybot.conf as conf
import supybot.registry as registry


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


DropboxWatch = conf.registerPlugin('DropboxWatch')
conf.registerGlobalValue(
    DropboxWatch, 'apiKey',
    registry.String('', """The Dropbox API key""", private=True))
conf.registerGlobalValue(
    DropboxWatch, 'appSecret',
    registry.String('', """The Dropbox app secret""", private=True))
conf.registerGlobalValue(
    DropboxWatch, 'interval',
    registry.PositiveInteger(60,
                             """Number of seconds between parsing events"""))
conf.registerChannelValue(
    DropboxWatch, 'paths',
    registry.SpaceSeparatedListOfStrings('',
                                         """The list of paths to announce"""))
示例#11
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('Karma', True)

Karma = conf.registerPlugin('Karma')

conf.registerChannelValue(Karma, 'simpleOutput',
    registry.Boolean(False, _("""Determines whether the bot will output shorter
    versions of the karma output when requesting a single thing's karma.""")))
conf.registerChannelValue(Karma, 'incrementChars',
    registry.SpaceSeparatedListOfStrings(['++'], _("""A space separated list of
    characters to increase karma.""")))
conf.registerChannelValue(Karma, 'decrementChars',
    registry.SpaceSeparatedListOfStrings(['--'], _("""A space separated list of
    characters to decrease karma.""")))
conf.registerChannelValue(Karma, 'response',
    registry.Boolean(False, _("""Determines whether the bot will reply with a
    success message when something's karma is increased or decreased.""")))
conf.registerChannelValue(Karma, 'rankingDisplay',
    registry.Integer(3, _("""Determines how many highest/lowest karma things
    are shown when karma is called with no arguments.""")))
conf.registerChannelValue(Karma, 'mostDisplay',
    registry.Integer(25, _("""Determines how many karma things are shown when
    the most command is called.""")))
conf.registerChannelValue(Karma, 'allowSelfRating',
    registry.Boolean(False, _("""Determines whether users can adjust the karma
    of their nick.""")))
示例#12
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('suds', True)


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

# General configuration settings
conf.registerGlobalValue(
    Suds, 'channels',
    registry.SpaceSeparatedListOfStrings(
        '', """ The channels you wish to use
        for OpenTTD communication """))
conf.registerGlobalValue(
    Suds, 'logdir',
    registry.String(
        'None', """ Logging directory. This is where logfiles are
    saved to. It will rotate logs when a new game starts, and back up the old
    log. A maximum of 2 logs are backed up. To disable logging, set this to an
    invalid path or 'None' """))
conf.registerGlobalValue(
    Suds, 'logHistory',
    registry.Integer(
        2, """ Amount of logfiles to keep. This does not include
    the current logfile. A value of 2 will keep the current logfile, and the 2
    preceding ones as .log.1 and .log.2."""))
示例#13
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('GateStatus', True)


GateStatus = conf.registerPlugin('GateStatus')
conf.registerGlobalValue(
    GateStatus, 'changeIDs',
    registry.SpaceSeparatedListOfStrings([],
                                         _("""Change ID list used for
    reporting.""")))
conf.registerGlobalValue(
    GateStatus, 'timeLimit',
    registry.NonNegativeInteger(
        24,
        _("""Maximum comment age in hours that gets
    parsed. Avoids reporting on old and obsolete gate jobs. Defaults to
    24.""")))
conf.registerGlobalValue(
    GateStatus, 'sshCommand',
    registry.String(
        '',
        _("""Command prefix used to fetch data from Gerrit. The
    bot's user should have passwordless ssh set up. Example: ssh -p 29418
    [email protected]""")))
示例#14
0
        _("""Determines whether the plugin is enabled on a channel. This defaults to False to avoid useless resources consumption."""
          )))
conf.registerChannelValue(
    Cobe, 'stripRelayedNick',
    registry.Boolean(
        True,
        _("""Determines whether the bot will strip strings like <XXX> at the beginning of messages."""
          )))
conf.registerChannelValue(
    Cobe, 'stripURL',
    registry.Boolean(
        True,
        _("""Determines whether the bot will strip URLs from messages.""")))
conf.registerChannelValue(
    Cobe, 'ignoreNicks',
    registry.SpaceSeparatedListOfStrings(
        [], _("""A list of nicks to be ignored by the bot""")))
conf.registerChannelValue(
    Cobe, 'ignorePattern',
    registry.Regexp("",
                    _("""Mesages matching this pattern will be ignored.""")))
conf.registerChannelValue(
    Cobe, 'stripPattern',
    registry.Regexp("", _("""Text matching this pattern will be stripped.""")))
conf.registerChannelValue(
    Cobe, 'stripNicks',
    registry.Boolean(
        False,
        _("""Strip all nicks, including the bots, when learning? This replaces a nick with the keyword MAGIC_NICK to use for random highlighting."""
          )))
conf.registerChannelValue(
    Cobe, 'probability',
示例#15
0
conf.registerGlobalValue(
    GPG, 'authRequestTimeout',
    registry.NonNegativeInteger(
        300, """Time (seconds) for authentication
    requests to time out."""))
conf.registerGlobalValue(
    GPG, 'keyservers',
    registry.String(
        "subset.pool.sks-keyservers.net,pgp.mit.edu", """Default keyservers to
    use for key retrieval. Comma-separated list."""))
conf.registerGlobalValue(
    GPG, 'channels',
    registry.String(
        "#bitcoin-otc", """Channels to monitor for user parts
    for auth removal. Semicolon-separated list."""))
conf.registerGlobalValue(
    GPG, 'network',
    registry.String(
        "freenode", """Network to monitor for user parts/quits
    and bot quits for auth removal."""))
conf.registerGlobalValue(
    GPG, 'pastebinWhitelist',
    registry.SpaceSeparatedListOfStrings(
        ['http://pastebin.com', 'http://paste.debian.net'],
        """If set, bot will only fetch clearsigned data
    for the verify command from urls in the whitelist, i.e. starting with
    http://domain/optionalpath/."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
示例#16
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:
示例#17
0
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('GateStatus')

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

GateStatus = conf.registerPlugin('GateStatus')
conf.registerGlobalValue(GateStatus, 'changeID',
    registry.String('', _("""Change ID used for reporting.""")))
conf.registerGlobalValue(GateStatus, 'changeURL',
    registry.String('', _("""URL to check the results.""")))
conf.registerGlobalValue(GateStatus, 'timeLimit',
    registry.NonNegativeInteger(24, _("""Maximum comment age in hours that gets
    parsed. Avoids reporting on old and obsolete gate jobs. Defaults to
    24.""")))
conf.registerGlobalValue(GateStatus, 'sshCommand',
    registry.String('', _("""Command prefix used to fetch data from Gerrit. The
    bot's user should have passwordless ssh set up. Example: ssh -p 29418
    [email protected]""")))
conf.registerGlobalValue(GateStatus, 'userFilter',
    registry.SpaceSeparatedListOfStrings([], _("""Only try to parse comment
    from these users""")))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
示例#18
0
conf.registerGlobalValue(
    Phabricator, 'acceptInvalidSSLCert',
    registry.Boolean(False, _("Whether to accept invalid SSL certificates.")))

conf.registerGlobalValue(
    Phabricator, 'httpTimeout',
    registry.PositiveInteger(
        40,
        _("How long to wait for HTTP(S) responses until aborting the request.")
    ))

conf.registerGlobalValue(
    Phabricator, 'channels',
    registry.SpaceSeparatedListOfStrings(
        "",
        _("List of channels on which the bot posts Phabricator updates. If empty, prints on each joined channel."
          )))

conf.registerGlobalValue(
    Phabricator, 'storyLimit',
    registry.PositiveInteger(
        5,
        _("Limit of phabricator updates to pull information about in one request."
          )))

conf.registerGlobalValue(
    Phabricator, 'historyForwards',
    registry.Boolean(
        True,
        _("Whether to traverse in history chronologically forwards or backwards."
          )))
示例#19
0
    RelayNext.antiflood, 'timeout',
    registry.PositiveInteger(
        60,
        _("""Determines the amount of time in seconds the bot should
        block messages if flood protection is triggered.""")))

conf.registerGroup(RelayNext, 'events')

_events = {
    'quit': True,
    'join': True,
    'part': True,
    'nick': True,
    'mode': True,
    'kick': True,
    'topic': False
}
for ev in _events:
    conf.registerChannelValue(
        RelayNext.events, 'relay%ss' % ev,
        registry.Boolean(
            _events[ev],
            """Determines whether the bot should relay %ss.""" % ev))
conf.registerChannelValue(
    RelayNext.events, 'userIgnored',
    registry.SpaceSeparatedListOfStrings(['PRIVMSG', 'MODE'],
                                         ("""Determines what events
        the relay should ignore from ignored users. Ignores are added using
        Supybot's global ignore system.""")))
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
示例#20
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('AutoTrans', True)


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

conf.registerChannelValue(
    AutoTrans, 'queries',
    registry.SpaceSeparatedListOfStrings([],
                                         _("""A list of people who
    want to have a translated version of messages in a channel if the
    messages are not in their native language.
    Format: nick1:lang1 nick2:lang2.""")))
conf.registerChannelValue(
    AutoTrans, 'authorWhitelist',
    registry.SpaceSeparatedListOfStrings({},
                                         _("""List of
    hostmasks such that messages will be translated only if they match
    one of the hostmasks. Empty list disables this check.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
示例#21
0
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('FreeBSDbugcatch')
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('FreeBSDbugcatch', True)


FreeBSDbugcatch = conf.registerPlugin('FreeBSDbugcatch')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(FreeBSDbugcatch, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(
    FreeBSDbugcatch, 'Channels',
    registry.SpaceSeparatedListOfStrings(
        [],
        _("""Space separated list of channels that bot will parse all IRC lines to snarf issue|pr|bug ID references"""
          )))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
示例#22
0
conf.registerGlobalValue(
    Piccy, 'module_map',
    registry.String(
        "modules.pcimap-%s",
        "kernel pci-id to module mapping file; use %s for the release name; (full path or path relative to base_path)"
    ))
conf.registerGlobalValue(
    Piccy, 'hcl_url',
    registry.String(
        "http://kmuto.jp/debian/hcl/index.rhtmlx?check=1&lspci=%s",
        "link for extra information about the pci-id; use %s for the pci-id; will not be included in output if set to empty string"
    ))
conf.registerGlobalValue(
    Piccy, 'extra_module_maps',
    registry.SpaceSeparatedListOfStrings([
        "squeeze-extras", "sid-extras"
    ], "space separated list of extra kernel pci-id to module mapping files from out-of-tree modules; used in the %s 'release name' field of the module_map parameter; (full path or path relative to base_path)"
                                         ))
conf.registerGlobalValue(
    Piccy, 'xorg_maps',
    registry.String(
        "xorg-%s",
        "directory for xorg pci-id to xorg driver mappings; use %s for the release name; (full path or path relative to base_path)"
    ))
conf.registerGlobalValue(
    Piccy, 'wiki_map',
    registry.String(
        "modules.wikilinks",
        "moin-moin wiki file that maps module names to wiki pages for further information (full path or path relative to base_path)"
    ))
conf.registerGlobalValue(
    Piccy, 'wiki_url',
示例#23
0
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# 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('Games', True)


Games = conf.registerPlugin('Games')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Games, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerChannelValue(Games, 'exclusions',
        registry.SpaceSeparatedListOfStrings([], 
        """A list of nicks who should be excluded from being 
            targeted"""))


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
示例#24
0
conf.registerGlobalValue(
    OperUp, 'operName',
    registry.String("",
                    _("""Specifies the name of the Oper block the bot will
        use."""),
                    private=True))
conf.registerGlobalValue(
    OperUp, 'operPass',
    registry.String("",
                    _("""Specifies the password of the Oper block the bot
        will use."""),
                    private=True))
conf.registerGlobalValue(
    OperUp, 'operNets',
    registry.SpaceSeparatedListOfStrings("",
                                         _("""Space separated list of
        network names to Oper up on (denoted by 005 name)"""),
                                         private=True))
conf.registerGlobalValue(
    OperUp, 'operModes',
    registry.SpaceSeparatedListOfStrings("",
                                         _("""Specifies the mode(s) the
        bot will set on itself when it Opers up."""),
                                         private=True))
conf.registerGlobalValue(
    OperUp, 'autoOper',
    registry.Boolean(
        True,
        _("""Specifies whether the bot should automatically
        oper up on connect.""")))
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
示例#25
0
 registry.SpaceSeparatedListOfStrings([
     'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', 'Azure', 'Beige',
     'Bisque', 'Black', 'BlanchedAlmond', 'Blue', 'BlueViolet', 'Brown',
     'BurlyWood', 'CadetBlue', 'Chartreuse', 'Chocolate', 'Coral',
     'CornflowerBlue', 'Cornsilk', 'Crimson', 'Cyan', 'DarkBlue',
     'DarkCyan', 'DarkGoldenRod', 'DarkGray', 'DarkGreen', 'DarkKhaki',
     'DarkMagenta', 'DarkOliveGreen', 'DarkOrange', 'DarkOrchid', 'DarkRed',
     'DarkSalmon', 'DarkSeaGreen', 'DarkSlateBlue', 'DarkSlateGray',
     'DarkTurquoise', 'DarkViolet', 'DeepPink', 'DeepSkyBlue', 'DimGray',
     'DodgerBlue', 'FireBrick', 'FloralWhite', 'ForestGreen', 'Fuchsia',
     'Gainsboro', 'GhostWhite', 'Gold', 'GoldenRod', 'Gray', 'Green',
     'GreenYellow', 'HoneyDew', 'HotPink', 'IndianRed', 'Indigo', 'Ivory',
     'Khaki', 'Lavender', 'LavenderBlush', 'LawnGreen', 'LemonChiffon',
     'LightBlue', 'LightCoral', 'LightCyan', 'LightGoldenRodYellow',
     'LightGrey', 'LightGreen', 'LightPink', 'LightSalmon', 'LightSeaGreen',
     'LightSkyBlue', 'LightSlateGray', 'LightSteelBlue', 'LightYellow',
     'Lime', 'LimeGreen', 'Linen', 'Magenta', 'Maroon', 'MediumAquaMarine',
     'MediumBlue', 'MediumOrchid', 'MediumPurple', 'MediumSeaGreen',
     'MediumSlateBlue', 'MediumSpringGreen', 'MediumTurquoise',
     'MediumVioletRed', 'MidnightBlue', 'MintCream', 'MistyRose',
     'Moccasin', 'NavajoWhite', 'Navy', 'OldLace', 'Olive', 'OliveDrab',
     'Orange', 'OrangeRed', 'Orchid', 'PaleGoldenRod', 'PaleGreen',
     'PaleTurquoise', 'PaleVioletRed', 'PapayaWhip', 'PeachPuff', 'Peru',
     'Pink', 'Plum', 'PowderBlue', 'Purple', 'Red', 'RosyBrown',
     'RoyalBlue', 'SaddleBrown', 'Salmon', 'SandyBrown', 'SeaGreen',
     'SeaShell', 'Sienna', 'Silver', 'SkyBlue', 'SlateBlue', 'SlateGray',
     'Snow', 'SpringGreen', 'SteelBlue', 'Tan', 'Teal', 'Thistle', 'Tomato',
     'Turquoise', 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow',
     'YellowGreen', 'GhostRider', 'SantaFeSunset', 'CremeDeEggplant',
     'dAubergine', 'LiverBrown', 'SunburntRed', 'PicklePickle',
     'TangibleFancy', 'Cephalothorax', 'Invisible', 'Unfortunate',
     'Unwieldy', 'Obviousness', 'Invisibile', 'Detonatey', 'Pinkbomb'
 ], """The set of possible timebomb wire colors"""))
示例#26
0
        _("""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.""")))

conf.registerChannelValue(
    AutoMode, 'extra',
    registry.SpaceSeparatedListOfStrings([],
                                         _("""Extra modes that will be
    applied to a user. Example syntax: user1+o-v user2+v user3-v""")))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
示例#27
0
#     for self-flagellating maniacs, written on 1991-12-09 by
#     [email protected]. See http://insulthost.colorado.edu/

Insult = conf.registerPlugin('Insult')
conf.registerGlobalValue(
    Insult, 'allowFoul',
    registry.Boolean(
        True, """Determines whether to include foul language in
    pools of randomly chosen adjective, amount and noun words."""))
conf.registerGlobalValue(
    Insult, 'nouns',
    registry.SpaceSeparatedListOfStrings([
        'bat toenails', 'bug spit', 'cat hair', 'fish heads', 'gunk',
        'pond scum', 'rat retch', 'red dye number-9', 'Sun IPC manuals',
        'waffle-house grits', 'yoo-hoo', 'snap whippers', 'squirrel guts',
        'snake bait', 'buzzard gizzards', 'cat-hair-balls', 'pods',
        'armadillo snouts', 'entrails', 'snake snot', 'eel ooze',
        'toxic waste', 'Stimpy-drool', 'poopy', 'poop', 'openurls',
        'craptacular carpet droppings', 'cold sores', 'IE user'
    ], """Determines the base set of words used as the pool for nouns."""))
conf.registerGlobalValue(
    Insult, 'foulNouns',
    registry.SpaceSeparatedListOfStrings([
        'chicken piss', 'dog vomit', 'dung', 'stomach-bile', 'guano',
        'dog balls', 'seagull puke', 'cat bladders', 'pus', 'urine samples',
        'snake assholes', 'rat-farts', 'slurpee-backwash', 'anal warts'
    ], """Determines the set of foul words added to the pool of nouns."""))
conf.registerGlobalValue(
    Insult, 'amounts',
    registry.SpaceSeparatedListOfStrings([
        'accumulation', 'bucket', 'gob', 'coagulation', 'half-mouthful',
示例#28
0
    registry.Boolean(
        False, """Determines whether the bug snarfer will be
    enabled, such that any Bugzilla URLs and bug ### seen in the channel
    will have their information reported into the channel."""))
conf.registerGlobalValue(
    Bugzilla, 'bugSnarferTimeout',
    registry.PositiveInteger(
        300, """Users often say "bug XXX" several times in a row, in a channel.
    If "bug XXX" has been said in the last (this many) seconds, don't
    fetch its data again. If you change the value of this variable, you
    must reload this plugin for the change to take effect."""))

conf.registerChannelValue(
    Bugzilla, 'bugFormat',
    registry.SpaceSeparatedListOfStrings([
        'bug_severity', 'priority', 'target_milestone', 'assigned_to',
        'bug_status', 'short_desc'
    ], """The fields to list when describing a bug, after the URL."""))
conf.registerChannelValue(
    Bugzilla, 'attachFormat',
    registry.SpaceSeparatedListOfStrings(
        ['type', 'desc', 'filename'],
        """The fields to list when describing an attachment after announcing
    a change to that attachment."""))

conf.registerGroup(
    Bugzilla,
    'format',
    help="""How various messages should be formatted in terms of bold, colors,
         etc.""")
conf.registerChannelValue(
    Bugzilla.format, 'change',
示例#29
0
        cur.close()
        con.close()

Encyclopedia = conf.registerPlugin('Encyclopedia')

conf.registerChannelValue(Encyclopedia, 'enabled',
    registry.Boolean(True, "Enable Encyclopedia"))

conf.registerChannelValue(Encyclopedia, 'database',
    registry.String('ubuntu', 'Name of database to use'))

conf.registerChannelValue(Encyclopedia, 'relaychannel',
    registry.String('#ubuntu-ops', 'Relay channel for unauthorized edits'))

conf.registerGlobalValue(Encyclopedia, 'editchannel',
        registry.SpaceSeparatedListOfStrings(['#ubuntu-ops'], 
            'Channels where unauthorised edits are allowed.'))

conf.registerGlobalValue(Encyclopedia, 'notfoundmsg',
    registry.String('Factoid %s not found', 'Reply when factoid isn\'t found'))

conf.registerChannelValue(Encyclopedia,'prefixchar',
    registry.String('!','Prefix character for factoid display/editing'))

conf.registerGlobalValue(Encyclopedia, 'datadir',
    conf.Directory(conf.supybot.directories.data(), 'Path to dir containing factoid databases', private=True))

conf.registerChannelValue(Encyclopedia, 'alert',
    registry.SpaceSeparatedListOfStrings(['ops', 'op', 'kops', 'calltheops'], 'factoid name(s) used for alerts', private=True))

conf.registerChannelValue(Encyclopedia, 'remotedb',
    registry.String('http://ubottu.com/ubuntu.db', 'Remote location of the master database', private=True))
示例#30
0
    # 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('Googler', True)


Googler = conf.registerPlugin('Googler')
conf.registerGlobalValue(
    Googler, 'command',
    registry.String(
        utils.findBinaryInPath('googler') or '',
        _("""Determines what command will be called for the
                             googler command.""")))
conf.registerGlobalValue(
    Googler, 'arguments',
    registry.SpaceSeparatedListOfStrings(
        '', _('''Command-line arguments to pass to googler''')))
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Googler, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))

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