예제 #1
0
파일: test.py 프로젝트: Hoaas/Limnoria
    def testOpNonEditable(self):
        var_name = 'testOpNonEditable' + random_string()
        conf.registerChannelValue(conf.supybot.plugins.Config, var_name,
                registry.Integer(0, 'help'), opSettable=False)
        self.assertNotError('register bar passwd', frm=self.prefix3,
                private=True)
        self.assertRegexp('whoami', 'bar', frm=self.prefix3)
        ircdb.users.getUser('bar').addCapability(self.channel + ',op')

        self.assertRegexp('config plugins.Config.%s 1' % var_name,
                '^Completely: Error: ',
                frm=self.prefix3)
        self.assertResponse('config plugins.Config.%s' % var_name,
                'Global: 0; #test: 0')

        self.assertRegexp('config channel plugins.Config.%s 1' % var_name,
                '^Completely: Error: ',
                frm=self.prefix3)
        self.assertResponse('config plugins.Config.%s' % var_name,
                'Global: 0; #test: 0')

        self.assertNotRegexp('config channel plugins.Config.%s 1' % var_name,
                '^Completely: Error: ')
        self.assertResponse('config plugins.Config.%s' % var_name,
                'Global: 0; #test: 1')
예제 #2
0
파일: config.py 프로젝트: Steap/EirBot
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('QuoteSite', True)
    conf.registerChannelValue(RSS, 'headlineSeparator',
    registry.StringSurroundedBySpaces(' \n ', """Determines what string is used to separate headlines in new feeds."""))
예제 #3
0
파일: plugin.py 프로젝트: nW44b/Limnoria
 def register_feed_config(self, name, url=''):
     self.registryValue('feeds').add(name)
     group = self.registryValue('feeds', value=False)
     conf.registerGlobalValue(group, name, registry.String(url, ''))
     feed_group = conf.registerGroup(group, name)
     conf.registerChannelValue(feed_group, 'format',
             registry.String('', _("""Feed-specific format. Defaults to
             supybot.plugins.RSS.format if empty.""")))
     conf.registerChannelValue(feed_group, 'announceFormat',
             registry.String('', _("""Feed-specific announce format.
             Defaults to supybot.plugins.RSS.announceFormat if empty.""")))
예제 #4
0
파일: plugin.py 프로젝트: Ban3/Limnoria
 def register_feed_config(self, name, url=''):
     self.registryValue('feeds').add(name)
     group = self.registryValue('feeds', value=False)
     conf.registerGlobalValue(group, name, registry.String(url, ''))
     feed_group = conf.registerGroup(group, name)
     conf.registerChannelValue(feed_group, 'format',
             registry.String('', _("""Feed-specific format. Defaults to
             supybot.plugins.RSS.format if empty.""")))
     conf.registerChannelValue(feed_group, 'announceFormat',
             registry.String('', _("""Feed-specific announce format.
             Defaults to supybot.plugins.RSS.announceFormat if empty.""")))
     conf.registerGlobalValue(feed_group, 'waitPeriod',
             registry.NonNegativeInteger(0, _("""If set to a non-zero
             value, overrides supybot.plugins.RSS.waitPeriod for this
             particular feed.""")))
예제 #5
0
파일: plugin.py 프로젝트: Hoaas/Limnoria
 def register_feed_config(self, name, url=''):
     self.registryValue('feeds').add(name)
     group = self.registryValue('feeds', value=False)
     conf.registerGlobalValue(group, name,
                              registry.String(url, """The URL for the feed
                                              %s. Note that because
                                              announced lines are cached,
                                              you may need to reload this
                                              plugin after changing this
                                              option.""" % name))
     feed_group = conf.registerGroup(group, name)
     conf.registerChannelValue(feed_group, 'format',
             registry.String('', _("""Feed-specific format. Defaults to
             supybot.plugins.RSS.format if empty.""")))
     conf.registerChannelValue(feed_group, 'announceFormat',
             registry.String('', _("""Feed-specific announce format.
             Defaults to supybot.plugins.RSS.announceFormat if empty.""")))
     conf.registerGlobalValue(feed_group, 'waitPeriod',
             registry.NonNegativeInteger(0, _("""If set to a non-zero
             value, overrides supybot.plugins.RSS.waitPeriod for this
             particular feed.""")))
예제 #6
0
def setup_config(OriginalConfig):
    # Set all string variables in the default Config class as supybot
    # registry variables.
    for attrname in dir(OriginalConfig):
        # Don't configure attributs starting with '_'
        if attrname[0] == '_':
            continue
        attr = getattr(OriginalConfig, attrname)
        # Don't configure attributes that aren't strings.
        if isinstance(attr, (str, unicode)):
            attr = attr.replace('\n', '\\n')
            # For a global value: conf.registerGlobalValue and remove the
            # channel= option from registryValue call above.
            conf.registerChannelValue(MeetBotConfigGroup, attrname,
                                      registry.String(attr, ""))
            settable_attributes.append(attrname)
        if isinstance(attr, bool):
            conf.registerChannelValue(MeetBotConfigGroup, attrname,
                                      registry.Boolean(attr, ""))
            settable_attributes.append(attrname)

    # writer_map
    # (doing the commented out commands below will erase the previously
    # stored value of a config variable)
    #if 'writer_map' in MeetBotConfigGroup._children:
    #    MeetBotConfigGroup.unregister('writer_map')
    conf.registerChannelValue(MeetBotConfigGroup, 'writer_map',
                              WriterMap(OriginalConfig.writer_map, ""))
    settable_attributes.append('writer_map')
예제 #7
0
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Factoids', True)

class FactoidFormat(registry.TemplatedString):
    """Value must include $value, otherwise the factoid's value would be left
    out."""
    requiredTemplates = ['value']

Factoids = conf.registerPlugin('Factoids')
conf.registerGroup(Factoids, 'web')
conf.registerGlobalValue(Factoids.web, 'enable',
    registry.Boolean(False, _("""Determines whether the Factoids plugins will
    be browsable on the HTTP server.""")))
conf.registerChannelValue(Factoids.web, 'channel',
    registry.Boolean(False, _("""Determines whether factoids can be displayed
    via the web server.""")))

conf.registerChannelValue(Factoids, 'requireVoice',
    registry.Boolean(False, _("""Only allows a user with voice or above on a
    channel to use the 'learn' and 'forget' commands.""")))
conf.registerChannelValue(Factoids, 'learnSeparator',
    registry.String('is', _("""Determines what separator must be used in 
    the learn command.  Defaults to 'is' -- learn <key> is <value>.  
    Users might want to change this to something else, so it's
    configurable.""")))
conf.registerChannelValue(Factoids, 'showFactoidIfOnlyOneMatch',
    registry.Boolean(True, _("""Determines whether the bot will reply with the
    single matching factoid if only one factoid matches when using the search
    command.""")))
conf.registerChannelValue(Factoids, 'replyWhenInvalidCommand',
예제 #8
0
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# 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
from supybot.i18n import PluginInternationalization, internationalizeDocstring
import os

_ = PluginInternationalization('SeattleIncidentResponse')

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

SeattleIncidentResponse = conf.registerPlugin('SeattleIncidentResponse')

conf.registerGlobalValue(SeattleIncidentResponse, 'checkinterval',
    registry.NonNegativeInteger(1, """How often, in minutes, to check for new incidents"""))
    
conf.registerGlobalValue(SeattleIncidentResponse, 'postformat',
    registry.String("[911] [{incident_number}][{incident_type}] {address}", """How often, in minutes, to check for new incidents"""))

conf.registerChannelValue(SeattleIncidentResponse, 'enabled',
    registry.Boolean(False, """Determines whether the bot will announce 911 calls in this channel"""))
예제 #9
0
파일: config.py 프로젝트: 7UR7L3/supybot
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Factoids', True)


class FactoidFormat(registry.TemplatedString):
    """Value must include $value, otherwise the factoid's value would be left
    out."""
    requiredTemplates = ['value']


Factoids = conf.registerPlugin('Factoids')
conf.registerChannelValue(
    Factoids, 'learnSeparator',
    registry.String(
        'as', """Determines what separator must be used in the
    learn command.  Defaults to 'as' -- learn <key> as <value>.  Users might
    feel more comfortable with 'is' or something else, so it's
    configurable."""))
conf.registerChannelValue(
    Factoids, 'showFactoidIfOnlyOneMatch',
    registry.Boolean(
        True, """Determines whether the bot will reply with the
    single matching factoid if only one factoid matches when using the search
    command."""))
conf.registerChannelValue(
    Factoids, 'replyWhenInvalidCommand',
    registry.Boolean(
        True, """Determines whether the bot will reply to invalid
    commands by searching for a factoid; basically making the whatis
    unnecessary when you want all factoids for a given key."""))
예제 #10
0
# coding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
###

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


# noinspection PyUnusedLocal
def configure(advanced):
    conf.registerPlugin("YouTube", True)


YouTube = conf.registerPlugin("YouTube")

conf.registerChannelValue(
    YouTube,
    "nonSnarfingRegexp",
    registry.Regexp(
        None,
        """Determines what URLs are to be snarfed and stored in the database in
    the channel; 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.""",
    ),
)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #11
0
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('AutoMode')

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


AutoMode = conf.registerPlugin('AutoMode')
conf.registerChannelValue(AutoMode, 'enable',
    registry.Boolean(True, _("""Determines whether this plugin is enabled.
    """)))
conf.registerGlobalValue(AutoMode, 'owner',
    registry.Boolean(True, _("""Determines whether this plugin will automode
    owners even if they don't have op/halfop/voice/whatever capability.""")))
conf.registerChannelValue(AutoMode, 'alternativeCapabilities',
    registry.Boolean(False, _("""Determines whether the bot will
    check for 'alternative capabilities' (ie. autoop, autohalfop,
    autovoice) in addition to/instead of classic ones.""")))
conf.registerChannelValue(AutoMode, 'fallthrough',
    registry.Boolean(False, _("""Determines whether the bot will "fall
    through" to halfop/voicing when auto-opping is turned off but
    auto-halfopping/voicing are turned on.""")))
conf.registerChannelValue(AutoMode, 'op',
    registry.Boolean(True, _("""Determines whether the bot will automatically
    op people with the <channel>,op capability when they join the channel.
예제 #12
0
파일: config.py 프로젝트: venth/Supybot
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# 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.utils as utils
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('Channel', True)


Channel = conf.registerPlugin('Channel')
conf.registerChannelValue(
    Channel, 'alwaysRejoin',
    registry.Boolean(
        True, """Determines whether the bot will always try to
    rejoin a channel whenever it's kicked from the channel."""))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #13
0
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Filter')

Filter = conf.registerPlugin('Filter')
conf.registerGroup(Filter, 'spellit')
conf.registerGlobalValue(Filter.spellit,
    'replaceLetters', registry.Boolean(True, _("""Determines whether or not to
    replace letters in the output of spellit.""")))
conf.registerGlobalValue(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 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('Filter', True)

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #14
0
        if any(map(lambda x: x <= 0, data.keys())):
            self.error(_('Dict keys must be non-negative integers.'))
            return
        errors = list(filter(bool, map(value_validator, data.values())))
        if errors:
            self.error(errors[0])
            return
        self.setValue(data)


NoisyKarma = conf.registerPlugin('NoisyKarma')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(NoisyKarma, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGroup(NoisyKarma, 'messages')
conf.registerChannelValue(
    NoisyKarma.messages, 'positive',
    KarmaMessages({},
                  _("""Messages shown for things with positive karma.
    For a given karma, the message with the closest key to the karma will
    be selected, among messages with a key greater than the karma.""")))
conf.registerChannelValue(
    NoisyKarma.messages, 'negative',
    KarmaMessages({},
                  _("""Messages shown for things with negative karma.
    For a given absolute karma, the message with the closest key to the
    karma will be selected, among messages with an absolute key greater
    than the absolute karma""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #15
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(PluginName, True)


Trackers = conf.registerPlugin('Trackers')

conf.registerGroup(Trackers, 'announce')
conf.registerChannelValue(
    Trackers.announce, 'seconds',
    registry.PositiveInteger(
        10,
        _("""Determines the amount of time in seconds the bot should
        announce tracker statuses.""")))

_events = {
    'ab': False,
    'ahd': False,
    'ar': False,
    'btn': False,
    'emp': False,
    'ggn': False,
    'mtv': False,
    'nbl': False,
    'nwcd': False,
    '32p': False,
    'ptp': False,
예제 #16
0
파일: config.py 프로젝트: Kefkius/mazabot
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('Protector', True)


Protector = conf.registerPlugin('Protector')
conf.registerChannelValue(
    Protector, 'enable',
    registry.Boolean(
        True, """Determines whether this plugin is enabled in a
    given channel."""))


class ImmuneNicks(conf.ValidNicks):
    List = ircutils.IrcSet


conf.registerChannelValue(
    Protector, 'immune',
    ImmuneNicks([], """Determines what nicks the bot will consider to
    be immune from enforcement.  These nicks will not even have their actions
    watched by this plugin.  In general, only the ChanServ for this network
    will be in this list."""))
예제 #17
0
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# 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('IgnoreFormatting', True)


IgnoreFormatting = conf.registerPlugin('IgnoreFormatting')
conf.registerChannelValue(
    IgnoreFormatting, 'enabled',
    registry.Boolean(
        False,
        """Determines whether this plugin is enabled and therefore stripping all
    formatting on incoming messages."""))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #18
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
    Web = conf.registerPlugin('Web', True)
    if yn("""This plugin also offers a snarfer that will try to fetch the
             title of URLs that it sees in the channel.  Would like you this
             snarfer to be enabled?""",
          default=False):
        Web.titleSnarfer.setValue(True)


Web = conf.registerPlugin('Web')
conf.registerChannelValue(
    Web, 'titleSnarfer',
    registry.Boolean(
        False,
        _("""Determines whether the bot will output the
    HTML title of URLs it sees in the channel.""")))
conf.registerChannelValue(
    Web, 'snarferReportIOExceptions',
    registry.Boolean(
        False,
        _("""Determines whether the bot will notfiy the user
    about network exceptions like hostnotfound, timeout ....""")))
conf.registerChannelValue(
    Web, 'snarferShowDomain',
    registry.Boolean(
        True,
        _("""Determines whether domain names should be
    displayed by the title snarfer.""")))
conf.registerChannelValue(
예제 #19
0
conf.registerGroup(Twitter.accounts, 'bot')
conf.registerGlobalValue(
    Twitter.accounts.bot, 'key',
    registry.String(
        '',
        _("""The Twitter Access Token key for the bot's
        account (%s)""") % helpGetToken))
conf.registerGlobalValue(
    Twitter.accounts.bot, 'secret',
    registry.String('',
                    _("""The Twitter Access Token secret for the bot's
        account (%s)""") % helpGetToken,
                    private=True))

conf.registerGroup(Twitter.accounts, 'channel')
conf.registerChannelValue(
    Twitter.accounts.channel, 'key',
    registry.String(
        '',
        _("""The Twitter Access Token key for this
        channel's account (%s)""") % helpGetToken))
conf.registerChannelValue(
    Twitter.accounts.channel, 'secret',
    registry.String('',
                    _("""The Twitter Access Token secret for this
        channel's account (%s)""") % helpGetToken,
                    private=True))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #20
0
###

import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Seen')


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


Seen = conf.registerPlugin('Seen')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Seen, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(
    Seen, 'minimumNonWildcard',
    registry.NonNegativeInteger(
        2,
        _("""The minimum non-wildcard characters
    required to perform a 'seen' request. Of course, it only applies if there
    is a wildcard in the request.""")))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #21
0
import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('UserInfo')
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('UserInfo', True)


UserInfo = conf.registerPlugin('UserInfo')
conf.registerChannelValue(UserInfo, 'MemberSnarfer',
                          registry.Boolean(False, """Determines if this plugin will snarf @<username>,
with the user's name and information"""))
conf.registerChannelValue(UserInfo, 'enableMembersListInChannel',
    registry.Boolean(False, """Determines if this plugin will reply with the members list
in the channel or via privmsg"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #22
0
파일: config.py 프로젝트: examknow/Sigyn
    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"""))

conf.registerGlobalValue(
    Sigyn, 'operatorNick',
    registry.String("", """oper's nick, must be filled""", private=True))
conf.registerGlobalValue(
    Sigyn, 'operatorPassword',
    registry.String("", """oper's password, must be filled""", private=True))

conf.registerGlobalValue(
    Sigyn, 'alertPeriod',
    registry.PositiveInteger(
        1, """interval between 2 alerts of same type in logChannel"""))
conf.registerGlobalValue(
    Sigyn, 'netsplitDuration',
예제 #23
0
    Web = conf.registerPlugin("Web", True)
    if yn(
        """This plugin also offers a snarfer that will try to fetch the
             title of URLs that it sees in the channel.  Would like you this
             snarfer to be enabled?""",
        default=False,
    ):
        Web.titleSnarfer.setValue(True)


Web = conf.registerPlugin("Web")
conf.registerChannelValue(
    Web,
    "titleSnarfer",
    registry.Boolean(
        False,
        """Determines whether the bot will output the HTML
    title of URLs it sees in the channel.""",
    ),
)
conf.registerChannelValue(
    Web,
    "nonSnarfingRegexp",
    registry.Regexp(
        None,
        """Determines what URLs are to be snarfed and stored
    in the database in the channel; 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.""",
    ),
)
예제 #24
0
        "if a relative path is used, "
        "it is relative to supybot.directories.logs"))
conf.registerGlobalValue(
    Judd, 'use_conf_file',
    registry.Boolean(
        True, "use the udd-cache.conf file in the plugin directory "
        "if present"))
conf.registerGlobalValue(
    Judd, 'base_path',
    registry.String("judd", "base path to the data files; "
                    "if a relative path is used, "
                    "it is relative to supybot.directories.data",
                    private=True))
conf.registerChannelValue(
    Judd, 'bold',
    registry.Boolean(
        True, "Determines whether the plugin will use bold in the "
        "responses to some of its commands."))
conf.registerChannelValue(
    Judd, 'default_release',
    registry.String("stable", "default release to use for queries"))
conf.registerChannelValue(
    Judd, 'default_arch',
    registry.String("amd64", "default architecture to use for queries"))
conf.registerChannelValue(
    Judd, 'auto_bug_throttle',
    registry.Integer(
        900, "minimum time in seconds before bug information will "
        "be shown automatically again"))
conf.registerChannelValue(
    Judd, 'auto_bug_ignore_re',
예제 #25
0
#
#
###

import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('Football')
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('Football', True)


Football = conf.registerPlugin('Football')
# This is where your configuration variables (if any) should go.  For example:
conf.registerChannelValue(Football, 'prefix', registry.Boolean(False, """Should we prefix output with the string"""))
conf.registerChannelValue(Football, 'prefixString', registry.String("NFL: ", """Prefix String."""))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #26
0
class ColorNumber(registry.String):
    """Value must be a valid color number (01, 02, 03, 04, ..., 16)"""
    def set(self, s):
        if s not in ('01', '02', '03', '04', '05', '06', '07', '08', '09',
                     '10', '11', '12', '13', '14', '15', '16'):
            self.error()
            return
        self.setValue(s)


ColorNumber = internationalizeDocstring(ColorNumber)

LinkRelay = conf.registerPlugin('LinkRelay')
conf.registerChannelValue(
    LinkRelay, 'color',
    registry.Boolean(
        False,
        _("""Determines whether the bot will color Relayed
    PRIVMSGs so as to make the messages easier to read.""")))
conf.registerChannelValue(
    LinkRelay, 'topicSync',
    registry.Boolean(
        True,
        _("""Determines whether the bot will synchronize
    topics between networks in the channels it Relays.""")))
conf.registerChannelValue(
    LinkRelay, 'hostmasks',
    registry.Boolean(
        False,
        _("""Determines whether the bot will Relay the
    hostmask of the person joining or parting the channel when he or she joins
    or parts.""")))
예제 #27
0
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('ChannelStatus', True)


ChannelStatus = conf.registerPlugin('ChannelStatus')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(ChannelStatus, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(ChannelStatus, 'listed',
    registry.Boolean(False, _("""Determines whether or not this channel will
    be publicly listed on the web server.""")))
conf.registerChannelValue(ChannelStatus, 'nicks',
    registry.Boolean(False, _("""Determines whether or not the list of users
    in this channel will be listed.""")))
conf.registerChannelValue(ChannelStatus, 'topic',
    registry.Boolean(True, _("""Determines whether or not the topic of this
    channel will be displayed.""")))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #28
0
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGroup(GitHub, 'api')
conf.registerGlobalValue(GitHub.api, 'url',
        registry.String('https://api.github.com', _("""The URL of the
        GitHub API to use. You probably don't need to edit it, but I let it
        there, just in case.""")))
conf.registerGlobalValue(GitHub, 'announces',
        registry.String('', _("""You shouldn't edit this configuration
        variable yourself, unless you know what you do. Use '@Github announce
        add' or '@Github announce remove' instead.""")))
conf.registerGlobalValue(GitHub.announces, 'secret',
        registry.SpaceSeparatedSetOfStrings(set(), _("""Set of space-separated
        secret payloads used to authenticate GitHub."""), private=True))
conf.registerChannelValue(GitHub, 'max_announce_commits',
        registry.Integer(3, _("""Determines the maximum number of commits that
        will be announced for a single push. Note that if the number of commits
        is only one over the limit, it will be announced anyway instead of
        saying "1 more commit".""")))

conf.registerGroup(GitHub, 'format')
conf.registerGroup(GitHub.format, 'before')
conf.registerChannelValue(GitHub.format.before, 'push',
        registry.String('',
        _("""Format for an optional summary line before the individual commits
        in the push event.""")))

conf.registerChannelValue(GitHub.format, 'push',
        registry.String('echo ' +
        _('$repository__owner__name/\x02$repository__name\x02 '
        '(in \x02$ref__branch\x02): $__commit__author__name committed '
        '\x02$__commit__message__firstline\x02 $__commit__url__tiny') \
예제 #29
0
파일: config.py 프로젝트: jasonn85/Racebot
    username = something("""What iRacing user name (email address) should be used to query for users?
                            This account must watch or friend any user to be known to this bot.""")
    password = something("""What is the password for that iRacing account?""")

    Racebot.iRacingUsername.setValue(username)
    Racebot.iRacingPassword.setValue(password)



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

conf.registerGlobalValue(Racebot, 'iRacingUsername',
                         registry.String('', """iRacing account (email) that will have all relevat users watched or friended."""))
conf.registerGlobalValue(Racebot, 'iRacingPassword',
                         registry.String('', """Password for the iRacing account.  Hopefully we get OAuth some day :-/""", private=True))
conf.registerChannelValue(Racebot, 'raceRegistrationAlerts',
                          registry.Boolean(True, """Determines whether the bot will broadcast in this channel whenever
                          a user joins a race"""))
conf.registerChannelValue(Racebot, 'nonRaceRegistrationAlerts',
                          registry.Boolean(False, """Determines whether the bot will broadcast in this channel whenever
                          a user joins a session other than a race (practice, qual, etc.)"""))




# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #30
0
# 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 output, expect, anything, something, yn
    conf.registerPlugin('Geekquote', True)
    output("""The Geekquote plugin has the ability to watch for geekquote
              (bash.org / qdb.us) URLs and respond to them as though the user
              had asked for the geekquote by ID""")
    if yn('Do you want the Geekquote snarfer enabled by default?'):
        conf.supybot.plugins.Geekquote.geekSnarfer.setValue(True)



Geekquote = conf.registerPlugin('Geekquote')
conf.registerChannelValue(Geekquote, 'geekSnarfer',
    registry.Boolean(False, """Determines whether the bot will automatically
    'snarf' Geekquote URLs and print information about them."""))


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #31
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('Topic', True)


class TopicFormat(registry.TemplatedString):
    "Value must include $topic, otherwise the actual topic would be left out."
    requiredTemplates = ['topic']

Topic = conf.registerPlugin('Topic')
conf.registerChannelValue(Topic, 'separator',
    registry.StringSurroundedBySpaces('|', _("""Determines what separator is
    used between individually added topics in the channel topic.""")))
conf.registerChannelValue(Topic, 'format',
    TopicFormat('$topic', _("""Determines what format is used to add
    topics in the topic.  All the standard substitutes apply, in addition to
    "$topic" for the topic itself.""")))
conf.registerChannelValue(Topic, 'recognizeTopiclen',
    registry.Boolean(True, _("""Determines whether the bot will recognize the
    TOPICLEN value sent to it by the server and thus refuse to send TOPICs
    longer than the TOPICLEN.  These topics are likely to be truncated by the
    server anyway, so this defaults to True.""")))
conf.registerChannelValue(Topic, 'default',
    registry.String('', _("""Determines what the default topic for the channel
    is.  This is used by the default command to set this topic.""")))
conf.registerChannelValue(Topic, 'alwaysSetOnJoin',
    registry.Boolean(False, _("""Determines whether the bot will set the topic
예제 #32
0
파일: config.py 프로젝트: EkiNetIrc/Sigyn
conf.registerGlobalValue(Sigyn, 'enable',
     registry.Boolean(False, """set to True to enable kill and klines, otherwise bot will only report to logChannel"""))

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("Merci de ne pas spammer les utilisateurs d'EkiNetIrc. En cas d'erreur, contactez [email protected].", """default reason used in kline's message"""))
conf.registerChannelValue(Sigyn, 'killMessage',
     registry.String("Le spam est interdit sur EkiNetIrc", """kill reason"""))
     
conf.registerGlobalValue(Sigyn, 'operatorNick',
     registry.String("", """oper's nick, must be filled""", private=True))
conf.registerGlobalValue(Sigyn, 'operatorPassword',
     registry.String("", """oper's password, must be filled""", private=True))

conf.registerGlobalValue(Sigyn, 'alertPeriod',
    registry.PositiveInteger(1,"""interval between 2 alerts of same type in logChannel"""))
conf.registerGlobalValue(Sigyn, 'netsplitDuration',
    registry.PositiveInteger(1,"""duration of netsplit ( which disable some protections )"""))

conf.registerGlobalValue(Sigyn, 'alertOnWideKline',
    registry.Integer(-1,"""alert if a kline hits more than expected users"""))

conf.registerGlobalValue(Sigyn, 'lagPermit',
예제 #33
0
        'Snow', 'SpringGreen', 'SteelBlue', 'Tan', 'Teal', 'Thistle', 'Tomato',
        'Turquoise', 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow',
        'YellowGreen'
    ], """The set of possible timebomb wire colors"""))

conf.registerGlobalValue(
    TimeBomb, 'shortcolors',
    registry.SpaceSeparatedListOfStrings([
        'red', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink', 'black',
        'brown', 'gray', 'white'
    ], """The set of possible timebomb wire colors when there are few
                wires"""))

conf.registerChannelValue(
    TimeBomb, 'randomExclusions',
    registry.SpaceSeparatedListOfStrings(
        [], """A list of nicks who should be excluded from being
            randombombed"""))

conf.registerChannelValue(
    TimeBomb, 'exclusions',
    registry.SpaceSeparatedListOfStrings(
        [], """A list of nicks who should be completely excluded from being
            bombed"""))

conf.registerChannelValue(
    TimeBomb, 'allowBombs',
    registry.Boolean(
        False, """Determines whether timebombs are allowed
            in the channel."""))
예제 #34
0
파일: config.py 프로젝트: csssuf/TriviaTime
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('TriviaTime', True)

TriviaTime = conf.registerPlugin('TriviaTime')
# CONFIGURATION
# file locations for database and question
conf.registerChannelValue(TriviaTime, 'sqlitedb', 
        registry.NormalizedString("""plugins/TriviaTime/storage/db/trivia.db""", 
                """Location of sqlite database file""")
        )

conf.registerChannelValue(TriviaTime, 'quizfile', 
        registry.NormalizedString("""plugins/TriviaTime/storage/samplequestions""", 
                """Location of question file""")
        )

# timeout, number of hints, values
conf.registerChannelValue(TriviaTime, 'showOtherHintCommand', 
        registry.NormalizedString(""".""", 
                """The command to show alternative hints""")
        )

conf.registerChannelValue(TriviaTime, 'showHintCommandKAOS', 
        registry.NormalizedString(""",""", 
예제 #35
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("DuckHunt", True)


DuckHunt = conf.registerPlugin("DuckHunt")
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Quote, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerChannelValue(
    DuckHunt,
    "autoRestart",
    registry.Boolean(
        False, """Does a new hunt automatically start when the previous one is over?"""
    ),
)

conf.registerChannelValue(
    DuckHunt, "ducks", registry.Integer(5, """Number of ducks during a hunt?""")
)

conf.registerChannelValue(
    DuckHunt,
    "minthrottle",
    registry.Integer(
        30,
        """The minimum amount of time before a new duck may be launched (in seconds)""",
    ),
예제 #36
0
_ = PluginInternationalization('ChannelLogger')


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


ChannelLogger = conf.registerPlugin('ChannelLogger')
conf.registerChannelValue(
    ChannelLogger, 'enable',
    registry.Boolean(True, _("""Determines whether logging is enabled.""")))
conf.registerGlobalValue(
    ChannelLogger, 'flushImmediately',
    registry.Boolean(
        False,
        _("""Determines whether channel logfiles will be
    flushed anytime they're written to, rather than being buffered by the
    operating system.""")))
conf.registerChannelValue(
    ChannelLogger, 'stripFormatting',
    registry.Boolean(
        True,
        _("""Determines whether formatting characters (such
    as bolding, color, etc.) are removed when writing the logs to disk.""")))
conf.registerChannelValue(
예제 #37
0
    Twitter = conf.registerPlugin('Twitter', True)
    consumer_key = something("twitter.com consumer key:");
    Twitter.consumer_key.setValue(consumer_key)
    consumer_secret = something("twitter.com consumer secret:");
    Twitter.consumer_secret.setValue(consumer_secret)

    access_key = something("twitter.com access token:");
    Twitter.access_key.setValue(access_key)
    access_secret = something("twitter.com access token secret:");
    Twitter.access_secret.setValue(access_secret)

Twitter = conf.registerPlugin('Twitter')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Twitter, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerChannelValue(Twitter, 'enabled',
        registry.Boolean(False, 'Enable this plugin'))
conf.registerGlobalValue(Twitter, 'consumer_key',
        registry.String('', "twitter.com consumer_key", private=True))
conf.registerGlobalValue(Twitter, 'consumer_secret',
        registry.String('', "twitter.com consumer_secret", private=True))
conf.registerGlobalValue(Twitter, 'access_key',
        registry.String('', "twitter.com access_key", private=True))
conf.registerGlobalValue(Twitter, 'access_secret',
        registry.String('', "twitter.com access_secret", private=True))
conf.registerGlobalValue(Twitter, 'displayReplies',
        registry.Boolean(True, "Automatically display replies?", private=False))
conf.registerGlobalValue(Twitter, 'replyAnnounceMsg',
        registry.String("Here's what Twitter has to say:", "String to use when announcing replies.", private=False))
conf.registerGlobalValue(Twitter, 'postConfirmation',
        registry.String("Posted.", "String to use when confirming a post", private=False))
conf.registerGlobalValue(Twitter, 'channelList',
예제 #38
0
파일: config.py 프로젝트: mogad0n/Limnoria
    conf.registerPlugin('Dict', True)
    output(_('The default dictd server is dict.org.'))
    if yn(_('Would you like to specify a different dictd server?')):
        server = something('What server?')
        conf.supybot.plugins.Dict.server.set(server)


Dict = conf.registerPlugin('Dict')
conf.registerGlobalValue(
    Dict, 'server',
    registry.String(
        'dict.org',
        _("""Determines what server the bot will
    retrieve definitions from.""")))
conf.registerChannelValue(
    Dict, 'default',
    registry.String(
        '*',
        _("""Determines the default dictionary the bot
    will ask for definitions in.  If this value is '*' (without the quotes)
    the bot will use all dictionaries to define words.""")))
conf.registerChannelValue(
    Dict, 'showDictName',
    registry.Boolean(
        True,
        _("""Determines whether the bot will show which
    dictionaries responded to a query, if the selected dictionary is '*'.
    """)))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #39
0
파일: config.py 프로젝트: EnderBlue/supybot
# 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:
예제 #40
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?"""))
예제 #41
0
try:
    from supybot.i18n import PluginInternationalization
    _ = 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:
예제 #42
0
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('PbinAdmin', True)


PbinAdmin = conf.registerPlugin('PbinAdmin')

conf.registerChannelValue(
    PbinAdmin, 'enabled',
    registry.Boolean(
        False, _('''Whether or not to enable PbinAdmin for the channel.''')))
conf.registerChannelValue(
    PbinAdmin, 'api_token',
    registry.String('',
                    _('''Authorization Token used to contact API.'''),
                    private=True))
conf.registerChannelValue(
    PbinAdmin, 'api_host',
    registry.String('https://pbin.domain.tld/admin',
                    _('''Full API URL to query.''')))
예제 #43
0
파일: config.py 프로젝트: tvieira/Limnoria
class FeedItemSortOrder(registry.OnlySomeStrings):
    """Valid values include 'asInFeed', 'oldestFirst', 'newestFirst'."""
    validStrings = ('asInFeed', 'oldestFirst', 'newestFirst', 'outdatedFirst',
            'updatedFirst')

RSS = conf.registerPlugin('RSS')

conf.registerGlobalValue(RSS, 'feeds',
    FeedNames([], _("""Determines what feeds should be accessible as
    commands.""")))

########
# Format

conf.registerChannelValue(RSS, 'headlineSeparator',
    registry.StringSurroundedBySpaces('|', _("""Determines what string is
    used to separate headlines in new feeds.""")))
conf.registerChannelValue(RSS, 'format',
    registry.String(_('$date: $title <$link>'), _("""The format the bot
    will use for displaying headlines of a RSS feed that is triggered
    manually. In addition to fields defined by feedparser ($published
    (the entry date), $title, $link, $description, $id, etc.), the following
    variables can be used: $feed_name, $date (parsed date, as defined in
    supybot.reply.format.time)""")))
conf.registerChannelValue(RSS, 'announceFormat',
    registry.String(_('News from $feed_name: $title <$link>'),
    _("""The format the bot will use for displaying headlines of a RSS feed
    that is announced. See supybot.plugins.RSS.format for the available
    variables.""")))

###########
예제 #44
0
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Later', True)


Later = conf.registerPlugin('Later')
conf.registerGlobalValue(
    Later, 'maximum',
    registry.NonNegativeInteger(
        0,
        _("""Determines the maximum number of
    messages to be queued for a user.  If this value is 0, there is no maximum.
    """)))
conf.registerChannelValue(
    Later, 'private',
    registry.Boolean(
        True,
        _("""Determines whether users will be notified in
    the first place in which they're seen, or in private.""")))
conf.registerGlobalValue(
    Later, 'tellOnJoin',
    registry.Boolean(
        True,
        _("""Determines whether users will be notified upon
    joining any channel the bot is in, or only upon sending a message.""")))
conf.registerGlobalValue(
    Later, 'messageExpiry',
    registry.NonNegativeInteger(
        30,
        _("""Determines the maximum number of
    days that a message will remain queued for a user. After this time elapses,
    the message will be deleted. If this value is 0, there is no maximum.""")))
예제 #45
0
    defaultChannel = anything("What channel should be default when none is given?", default=Webcal.defaultChannel._default)
    tzUrl = anything("What is the URL to the list of available time zonez?", default=Webcal.tzUrl._default)

    if advanced:
        filter = anything("What should the filter be for the iCal feed, for all channels?", default=Webcal.filter._default)
        topic = anything("What template should be used for the topic, for all channels", default=Webcal.topic._default)
    else:
        filter = Webcal.filter._default
        topic = Webcal.topic._default

    Webcal.doTopic.setValue(doTopic)
    Webcal.url.setValue(url)
    Webcal.defaultChannel.setValue(defaultChannel)
    Webcal.tzUrl.setValue(tzUrl)
    Webcal.filter.setValue(filter)
    Webcal.topic.setValue(topic)

Webcal = conf.registerPlugin('Webcal')
conf.registerChannelValue(conf.supybot.plugins.Webcal, 'url',
    registry.String('',"""Webcal URL for the channel"""))
conf.registerChannelValue(conf.supybot.plugins.Webcal, 'filter',
    registry.String('',"""What to filter on in the ical feed"""))
conf.registerChannelValue(conf.supybot.plugins.Webcal, 'topic',
    registry.String('',"""Topic template"""))
conf.registerChannelValue(conf.supybot.plugins.Webcal, 'doTopic',
    registry.Boolean(False,"""Whether to manage the topic"""))
conf.registerGlobalValue(conf.supybot.plugins.Webcal, 'defaultChannel',
    registry.String('',"""Default channel to determine schedule for /msg replies"""))
conf.registerGlobalValue(conf.supybot.plugins.Webcal, 'tzUrl',
    registry.String('http://ubottu.com/timezones.html', """URL to the list of timezones supported by the Webcal plugin"""))
예제 #46
0
###
# see LICENSE.txt for information.
###

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


NFL = conf.registerPlugin('NFL')
conf.registerGlobalValue(
    NFL, 'logURLs', registry.Boolean(True, """Should we log all URL calls?"""))
conf.registerChannelValue(
    NFL, 'requireVoiceForCalls',
    registry.Boolean(False, """Require voice for commands?"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=250:
예제 #47
0
import plugin

import supybot.conf as conf
import supybot.utils as utils
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('Currency', True)

class CurrencyCommand(registry.String):
    def setValue(self, s):
        m = plugin.Currency.currencyCommands
        if s not in m:
            raise registry.InvalidRegistryValue,\
                  format('Command must be one of %L.', m)
        registry.String.setValue(self, s)

Currency = conf.registerPlugin('Currency')
conf.registerChannelValue(Currency, 'command',
    CurrencyCommand('yahoo', format("""Sets the default command to use when
    retrieving the currency conversion.  Command must be one of %L.""",
    (plugin.Currency.currencyCommands, 'or'))))


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #48
0
# 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
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Status')

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

Status = conf.registerPlugin('Status')
conf.registerGroup(Status, 'cpu')
conf.registerChannelValue(Status.cpu, 'children',
    registry.Boolean(True, _("""Determines whether the cpu command will list
    the time taken by children as well as the bot's process.""")))
conf.registerChannelValue(Status.cpu, 'threads',
    registry.Boolean(False, _("""Determines whether the cpu command will
    provide the number of threads spawned and active.""")))
conf.registerChannelValue(Status.cpu, 'memory',
    registry.Boolean(True, _("""Determines whether the cpu command will report
    the amount of memory being used by the bot.""")))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #49
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('MCStatus', True)


MCStatus = conf.registerPlugin('MCStatus')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(MCStatus, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(MCStatus, 'statusURL',
        registry.String('http://status.mojang.com/check', _("""This is the URL
        that is queried for JSON data. You shouldn't change this unless you
        know what you are doing.""")))
conf.registerChannelValue(MCStatus, 'prefix',
        registry.String('', _("""This text is prepended to the mcstatus
        command's output.""")))
conf.registerChannelValue(MCStatus, 'suffix',
        registry.String('', _("""This text is appended to the mcstatus
        command's output.""")))
conf.registerChannelValue(MCStatus, 'separator',
        registry.StringSurroundedBySpaces('|', _("""This text is inserted between service-status
        pairs.""")))
conf.registerGroup(MCStatus, 'service')
conf.registerChannelValue(MCStatus.service, 'prefix',
        registry.String('', _("""This text is prepended to each service's
        name.""")))
conf.registerChannelValue(MCStatus.service, 'suffix',
        registry.StringWithSpaceOnRight(':', _("""This text is appended to each service's
        name.""")))
conf.registerGroup(MCStatus, 'status')
예제 #50
0
파일: config.py 프로젝트: rostob/Limnoria
            self.setValue(set())
        else:
            super().set(v)

    def setValue(self, v):
        self.lastModified = time.time()
        registry.CommaSeparatedListOfStrings.setValue(self, v)

BadWords = conf.registerPlugin('BadWords')
conf.registerGlobalValue(BadWords, 'words',
    LastModifiedSpaceSeparatedSetOfStrings([], _("""Determines what words are
    considered to be 'bad' so the bot won't say them.""")))
conf.registerChannelValue(BadWords,'requireWordBoundaries',
    registry.Boolean(False, _("""Determines whether the bot will require bad
    words to be independent words, or whether it will censor them within other
    words.  For instance, if 'darn' is a bad word, then if this is true, 'darn'
    will be censored, but 'darnit' will not.  You probably want this to be
    false. After changing this setting, the BadWords regexp needs to be
    regenerated by adding/removing a word to the list, or reloading the
    plugin.""")))
conf.registerGlobalValue(BadWords, 'phrases',
    LastModifiedCommaSeparatedSetOfStrings([], _("""Comma-separated groups
    of words that are considered to be 'bad'.""")))

class String256(registry.String):
    def __call__(self):
        s = registry.String.__call__(self)
        return s * (1024//len(s))

    def __str__(self):
        return self.value
예제 #51
0
from supybot.i18n import PluginInternationalization, internationalizeDocstring

_ = PluginInternationalization('Weather')

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


Weather = conf.registerPlugin('Weather')
conf.registerGlobalValue(Weather,'apiKey', registry.String('', ("""Your wunderground.com API key."""), private=True))
conf.registerChannelValue(Weather,'useImperial', registry.Boolean(True, ("""Use imperial units? Defaults to yes.""")))
conf.registerChannelValue(Weather,'disableColoredTemp', registry.Boolean(False, """If True, this will disable coloring temperatures based on values."""))
# conf.registerChannelValue(Weather,'useWeatherSymbols', registry.Boolean(False, """Use unicode symbols with weather conditions and for wind direction."""))
conf.registerGlobalValue(Weather,'forecast', registry.Boolean(True, ("""Display forecast in output by default?""")))
conf.registerGlobalValue(Weather,'alerts', registry.Boolean(False, ("""Display alerts by default?""")))
conf.registerGlobalValue(Weather,'almanac', registry.Boolean(False, ("""Display almanac by default?""")))
conf.registerGlobalValue(Weather,'astronomy', registry.Boolean(False, ("""Display astronomy by default?""")))
conf.registerGlobalValue(Weather,'showPressure', registry.Boolean(False, ("""Show pressure in output?""")))
conf.registerGlobalValue(Weather,'showWind', registry.Boolean(False, ("""Show wind in output?""")))
conf.registerGlobalValue(Weather,'showUpdated', registry.Boolean(False, ("""Show updated in output?""")))
conf.registerChannelValue(Weather,'showImperialAndMetric', registry.Boolean(True, ("""In channel, display output with Imperial and Metric?""")))
conf.registerGlobalValue(Weather,'lang', registry.String('EN', ("""language to use. See docs for available codes.""")))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=250:
예제 #52
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("Lyrics", True)


Lyrics = conf.registerPlugin("Lyrics")

conf.registerChannelValue(
    Lyrics,
    "google",
    registry.Integer(
        1,
        """
        Google search priority. Google plugin must be loaded.
        0 = disabled. 1 = first. 2 = second.
        """,
    ),
)

conf.registerChannelValue(
    Lyrics,
    "ddg",
    registry.Integer(
        2,
        """
        DDG search priority. DDG plugin must be loaded.
        0 = disabled. 1 = first. 2 = second.
        """,
예제 #53
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('Ottdcoop', True)


Ottdcoop = conf.registerPlugin('Ottdcoop')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Ottdcoop, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerChannelValue(Ottdcoop, 'PlayerWarner',
     registry.Boolean(False, """Determines whether the bot will auto warn clients joining as 'Player'"""))
conf.registerChannelValue(Ottdcoop, 'PlayerReply',
     registry.String('Player, please change your in game nick', """What the bot will say if it sees '*** Player joined the game'"""))
conf.registerChannelValue(Ottdcoop, 'MultiWarner',
     registry.Boolean(False, """Determines whether the bot will auto warn clients multiple joining as 'nick #number'"""))
conf.registerChannelValue(Ottdcoop, 'MultiReply',
     registry.String('$name, it appears that you have joined twice, please ask someone to join you, rather than double joining. If this is due to a time-out, you may disregard this.', """What the bot will say if it sees '*** nick #number joined the game'"""))
conf.registerGroup(Ottdcoop, 'abbr')

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #54
0
import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('CoronaLight')
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('CoronaLight', True)


CoronaLight = conf.registerPlugin('CoronaLight')

conf.registerChannelValue(CoronaLight, 'template',
    registry.String("\x02\x1F$location\x1F: Cases: \x0307$confirmed\x03 | Deaths: \x0304$dead\x03 (\x0304$ratio\x03) | Recovered: \x0309$recovered\x03 | Updated: $updated", _("""Template for replies""")))

conf.registerChannelValue(CoronaLight, 'countryFirst',
    registry.Boolean(False, _("Give preference to country name abbreviations over USA state name abbreviations")))

conf.registerGlobalValue(CoronaLight, 'cacheLifetime',
    registry.Integer(600, _("Amount of time in seconds to cache API results")))
예제 #55
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('NuWeather', True)


NuWeather = conf.registerPlugin('NuWeather')
conf.registerGroup(NuWeather, 'apikeys')
conf.registerGroup(NuWeather, 'units')
conf.registerGlobalValue(NuWeather, accountsdb.CONFIG_OPTION_NAME, accountsdb.CONFIG_OPTION)

class NuWeatherTemperatureDisplayMode(registry.OnlySomeStrings):
    validStrings = ('F/C', 'C/F', 'F', 'C')

conf.registerChannelValue(NuWeather.units, 'temperature',
    NuWeatherTemperatureDisplayMode('F/C', _("""Determines how temperatures will be displayed.
        F/C means show "50F/10C", C means display only Celsius, and so on.""")))

BACKENDS = ('darksky', 'apixu')
GEOCODE_BACKENDS = ('nominatim', 'googlemaps', 'opencage')
class NuWeatherBackend(registry.OnlySomeStrings):
    validStrings = BACKENDS
class NuWeatherGeocode(registry.OnlySomeStrings):
    validStrings = GEOCODE_BACKENDS

conf.registerChannelValue(NuWeather, 'defaultBackend',
    NuWeatherBackend(BACKENDS[0], _("""Determines the default weather backend.""")))
    
conf.registerChannelValue(NuWeather, 'geocodeBackend',
    NuWeatherGeocode(GEOCODE_BACKENDS[0], _("""Determines the default geocode backend.""")))
예제 #56
0
# conf.registerGlobalValue(Apt, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))

conf.registerGroup(Apt, 'cache')
conf.registerGlobalValue(
    Apt.cache, 'updateInterval',
    registry.NonNegativeInteger(
        3600 * 24,
        _("""Minimum interval before an
    automatic update of the cache, in seconds. Set to 0 to disable automatic
    updates.""")))

conf.registerGroup(Apt, 'defaults')
conf.registerChannelValue(
    Apt.defaults, 'archs',
    registry.CommaSeparatedListOfStrings([],
                                         _("""Default value of --archs
    for commands that accept it. Comma-separated list of CPU architectures 
    ("arm64", "amd64", "i386", ...). """)))
conf.registerChannelValue(
    Apt.defaults, 'distribs',
    registry.CommaSeparatedListOfStrings([],
                                         _("""Default value of --distribs
    for commands that accept it. Comma-separated list of distributions
    ("Ubuntu", "Debian", "Debian Backports", ...). """)))
conf.registerChannelValue(
    Apt.defaults, 'releases',
    registry.CommaSeparatedListOfStrings([],
                                         _("""Default value of --releases
    for commands that accept it. Comma-separated list of releases ("buster",
    "bionic", "stretch", "stretch-backports", ...). """)))
예제 #57
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('IMDb', True)


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

conf.registerGroup(IMDb, 'formats')

conf.registerChannelValue(IMDb, 'outputorder',
        registry.String('url;title;description;creator,director,stars;genres,plot_keys;runtime,language', 
            'Order that parts will be output. ; is line separator and , is field separator'))

conf.registerChannelValue(IMDb.formats, 'url',
        registry.String('\x02\x031,8IMDb\x03 %(url)s', 'Format for the output of imdb command'))

conf.registerChannelValue(IMDb.formats, 'title',
        registry.String('\x02\x0304\x1F%(name)s\x1F\x0311\x02 (%(year)s) %(rating)s/10', 'Format for the output of imdb command'))

conf.registerChannelValue(IMDb.formats, 'description',
        registry.String('\x0305Description\03 /\x0311 %(description)s', 'Format for the output of imdb command'))

conf.registerChannelValue(IMDb.formats, 'creator',
        registry.String('\x0305Creator\03 /\x0311 %(creator)s', 'Format for the output of imdb command'))

conf.registerChannelValue(IMDb.formats, 'director',
예제 #58
0
    validStrings = ['active', 'moderate', 'off']


Google = conf.registerPlugin('Google')
conf.registerGlobalValue(
    Google, 'referer',
    registry.String(
        '',
        _("""Determines the URL that will be sent to Google for
    the Referer field of the search requests.  If this value is empty, a
    Referer will be generated in the following format:
    http://$server/$botName""")))
conf.registerChannelValue(
    Google, 'searchSnarfer',
    registry.Boolean(
        False,
        _("""Determines whether the search snarfer is
    enabled.  If so, messages (even unaddressed ones) beginning with the word
    'google' will result in the first URL Google returns being sent to the
    channel.""")))
conf.registerChannelValue(
    Google, 'colorfulFilter',
    registry.Boolean(
        False,
        _("""Determines whether the word 'google' in the
    bot's output will be made colorful (like Google's logo).""")))
conf.registerChannelValue(
    Google, 'bold',
    registry.Boolean(True, _("""Determines whether results are bolded.""")))
conf.registerChannelValue(
    Google, 'oneToOne',
    registry.Boolean(
예제 #59
0
    added DATETIME,
    oldvalue VARCHAR(200) NOT NULL
)""")

    except:
        con.rollback()
        raise
    else:
        con.commit()
    finally:
        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',
예제 #60
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('Karma', True)


conf.registerPlugin('Karma')

conf.registerChannelValue(
    conf.supybot.plugins.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(
    conf.supybot.plugins.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(
    conf.supybot.plugins.Karma, 'rankingDisplay',
    registry.Integer(
        3, """Determines how many highest/lowest karma things are
    shown when karma is called with no arguments."""))
conf.registerChannelValue(
    conf.supybot.plugins.Karma, 'mostDisplay',
    registry.Integer(