• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python conf.registerChannelValue函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中supybot.conf.registerChannelValue函数的典型用法代码示例。如果您正苦于以下问题:Python registerChannelValue函数的具体用法?Python registerChannelValue怎么用?Python registerChannelValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了registerChannelValue函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: testOpNonEditable

    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')
开发者ID:Hoaas,项目名称:Limnoria,代码行数:25,代码来源:test.py


示例2: configure

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."""))
开发者ID:Steap,项目名称:EirBot,代码行数:9,代码来源:config.py


示例3: register_feed_config

 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.""")))
开发者ID:nW44b,项目名称:Limnoria,代码行数:11,代码来源:plugin.py


示例4: register_feed_config

 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.""")))
开发者ID:Ban3,项目名称:Limnoria,代码行数:15,代码来源:plugin.py


示例5: register_feed_config

 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.""")))
开发者ID:Hoaas,项目名称:Limnoria,代码行数:21,代码来源:plugin.py


示例6: setup_config

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')
开发者ID:JohnVillalovos,项目名称:meetbot,代码行数:29,代码来源:supybotconfig.py


示例7: something

    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:
开发者ID:jasonn85,项目名称:Racebot,代码行数:29,代码来源:config.py


示例8: DAMAGES

# 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"""))
开发者ID:thefinn93,项目名称:SeattleIncidentResponse,代码行数:30,代码来源:config.py


示例9: configure

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:
开发者ID:GLolol,项目名称:ProgVal-Supybot-plugins,代码行数:30,代码来源:config.py


示例10: PluginInternationalization

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.
开发者ID:4poc,项目名称:competitionbot,代码行数:31,代码来源:config.py


示例11: PluginInternationalization

#
#
###

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:
开发者ID:reticulatingspline,项目名称:Football,代码行数:30,代码来源:config.py


示例12: configure

# 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:
开发者ID:cloph,项目名称:supybot-YouTube,代码行数:30,代码来源:config.py


示例13: netsplit

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',
开发者ID:EkiNetIrc,项目名称:Sigyn,代码行数:32,代码来源:config.py


示例14: something

    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',
开发者ID:hdonnay,项目名称:supybot-twitter,代码行数:32,代码来源:config.py


示例15: TORT

# 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:
开发者ID:D0MF,项目名称:supybot-plugins-1,代码行数:30,代码来源:config.py


示例16: 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,
    "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.""",
    ),
)
开发者ID:prashantpawar,项目名称:supybot-rothbot,代码行数:31,代码来源:config.py


示例17: configure

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:
开发者ID:D0MF,项目名称:supybot-plugins-1,代码行数:30,代码来源:config.py


示例18: TORT

# 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:
开发者ID:EnderBlue,项目名称:supybot,代码行数:30,代码来源:config.py


示例19: variables

    # 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')
开发者ID:GlitterCakes,项目名称:PoohBot,代码行数:31,代码来源:config.py


示例20: configure

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(""",""", 
开发者ID:csssuf,项目名称:TriviaTime,代码行数:32,代码来源:config.py



注:本文中的supybot.conf.registerChannelValue函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python conf.registerGlobalValue函数代码示例发布时间:2022-05-27
下一篇:
Python conf.get函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap