本文整理汇总了Python中supybot.conf.registerGroup函数的典型用法代码示例。如果您正苦于以下问题:Python registerGroup函数的具体用法?Python registerGroup怎么用?Python registerGroup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了registerGroup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: registerBugzilla
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?"""))
开发者ID:zapster,项目名称:cacaobot,代码行数:58,代码来源:plugin.py
示例2: clear_repos
def clear_repos(self):
"Remove all defined repositories."
plugin_group = conf.supybot.plugins.get('Git')
try:
plugin_group.unregister('repos')
except registry.NonExistentRegistryEntry:
pass
conf.registerGroup(plugin_group, 'repos')
conf.supybot.plugins.Git.repolist.setValue('')
self.assertNotError('reload Git')
expected = ['The operation succeeded.',
'Git reinitialized with 0 repositories.',
'The operation succeeded.'
]
self.assertResponses('reload Git', expected)
开发者ID:gmorell,项目名称:supybot-git,代码行数:15,代码来源:test.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_jira_install
def register_jira_install(self, handle):
group = conf.registerGroup(conf.supybot.plugins.JIRA.installs, handle)
conf.registerGlobalValue(group, "url",
registry.String("", "URL of the JIRA install, e.g. " \
"http://issues.foresightlinux.org/jira"))
conf.registerGlobalValue(group, "username",
registry.String("", "Username to login the JIRA install",
private=True))
conf.registerGlobalValue(group, "password",
registry.String("", "Password to login the JIRA install",
private=True))
开发者ID:amirdt22,项目名称:supybot-jira,代码行数:11,代码来源:plugin.py
示例5: repo_option
def repo_option(reponame, option):
''' Return a repo-specific option, registering on the fly. '''
repos = global_option('repos')
try:
repo = repos.get(reponame)
except registry.NonExistentRegistryEntry:
repo = conf.registerGroup(repos, reponame)
try:
return repo.get(option)
except registry.NonExistentRegistryEntry:
conf.registerGlobalValue(repo, option, _REPO_OPTIONS[option]())
return repo.get(option)
开发者ID:mapreri,项目名称:MPR-supybot,代码行数:12,代码来源:config.py
示例6: watch_option
def watch_option(watchname, option):
''' Return a watch-specific option, registering on the fly. '''
watches = global_option('watches')
try:
watch = watches.get(watchname)
except registry.NonExistentRegistryEntry:
watch = conf.registerGroup(watches, watchname)
try:
return watch.get(option)
except registry.NonExistentRegistryEntry:
conf.registerGlobalValue(watch, option, _WATCH_OPTIONS[option]())
return watch.get(option)
开发者ID:leamas,项目名称:supybot-bz,代码行数:12,代码来源:config.py
示例7: registerBugtracker
def registerBugtracker(name, url='', description='', trackertype=''):
conf.supybot.plugins.Bugtracker.bugtrackers().add(name)
group = conf.registerGroup(conf.supybot.plugins.Bugtracker.bugtrackers, name)
URL = conf.registerGlobalValue(group, 'url', registry.String(url, ''))
DESC = conf.registerGlobalValue(group, 'description', registry.String(description, ''))
TRACKERTYPE = conf.registerGlobalValue(group, 'trackertype', registry.String(trackertype, ''))
if url:
URL.setValue(url)
if description:
DESC.setValue(description)
if trackertype:
if defined_bugtrackers.has_key(trackertype.lower()):
TRACKERTYPE.setValue(trackertype.lower())
else:
raise BugtrackerError("Unknown trackertype: %s" % trackertype)
开发者ID:bnrubin,项目名称:Bugtracker,代码行数:15,代码来源:plugin.py
示例8: 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
示例9: 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
示例10: Networks
conf.registerGlobalValue(Services, 'disabledNetworks',
Networks(_('QuakeNet').split(), _("""Determines what networks this plugin
will be disabled on.""")))
conf.registerGlobalValue(Services, 'noJoinsUntilIdentified',
registry.Boolean(False, _("""Determines whether the bot will not join any
channels until it is identified. This may be useful, for instances, if
you have a vhost that isn't set until you're identified, or if you're
joining +r channels that won't allow you to join unless you identify.""")))
conf.registerGlobalValue(Services, 'ghostDelay',
registry.PositiveInteger(60, _("""Determines how many seconds the bot will
wait between successive GHOST attempts.""")))
conf.registerGlobalValue(Services, 'NickServ',
ValidNickOrEmptyString('', _("""Determines what nick the 'NickServ' service
has.""")))
conf.registerGroup(Services.NickServ, 'password')
conf.registerGlobalValue(Services, 'ChanServ',
ValidNickOrEmptyString('', _("""Determines what nick the 'ChanServ' service
has.""")))
conf.registerChannelValue(Services.ChanServ, 'password',
registry.String('', _("""Determines what password the bot will use with
ChanServ."""), private=True))
conf.registerChannelValue(Services.ChanServ, 'op',
registry.Boolean(False, _("""Determines whether the bot will request to get
opped by the ChanServ when it joins the channel.""")))
conf.registerChannelValue(Services.ChanServ, 'halfop',
registry.Boolean(False, _("""Determines whether the bot will request to get
half-opped by the ChanServ when it joins the channel.""")))
conf.registerChannelValue(Services.ChanServ, 'voice',
registry.Boolean(False, _("""Determines whether the bot will request to get
voiced by the ChanServ when it joins the channel.""")))
开发者ID:Athemis,项目名称:Limnoria,代码行数:31,代码来源:config.py
示例11: configure
_ = lambda x:x
internationalizeDocstring = 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('Trigger', True)
Trigger = conf.registerPlugin('Trigger')
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(Trigger, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGroup(Trigger, 'triggers')
for trigger in 'join part privmsg notice highlight nick quit kick'.split(' '):
conf.registerChannelValue(Trigger.triggers, trigger,
registry.String('', _("""Command triggered by %ss""" % trigger),
private=True))
conf.registerGlobalValue(Trigger.triggers, 'connect',
registry.String('', _("""Command triggered on connect. This shouldn't be
a Supybot command, but an IRC command (as given to ircquote)."""),
private=True))
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
开发者ID:AlanBell,项目名称:Supybot-plugins,代码行数:30,代码来源:config.py
示例12: ValidNonPrivmsgsHandling
class ValidNonPrivmsgsHandling(registry.OnlySomeStrings):
validStrings = ('privmsg', 'notice', 'nothing')
conf.registerChannelValue(LinkRelay, 'nonPrivmsgs',
ValidNonPrivmsgsHandling('privmsg', _("""Determines whether the
bot will use PRIVMSGs (privmsg), NOTICEs (notice), for non-PRIVMSG Relay
messages (i.e., joins, parts, nicks, quits, modes, etc.), or whether it
won't relay such messages (nothing)""")))
conf.registerGlobalValue(LinkRelay, 'relays',
registry.String('', _("""You shouldn't edit this configuration variable
yourself unless you know what you do. Use @LinkRelay {add|remove} instead.""")))
conf.registerGlobalValue(LinkRelay, 'substitutes',
registry.String('', _("""You shouldn't edit this configuration variable
yourself unless you know what you do. Use @LinkRelay (no)substitute instead.""")))
conf.registerGroup(LinkRelay, 'colors')
for name, color in {'info': '02',
'truncated': '14',
'mode': '14',
'join': '14',
'part': '14',
'kick': '14',
'nick': '14',
'quit': '14'}.items():
conf.registerChannelValue(LinkRelay.colors, name,
ColorNumber(color, _("""Color used for relaying %s.""") % color))
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
开发者ID:Albnetwork,项目名称:Supybot-plugins,代码行数:30,代码来源:config.py
示例13: configure
import supybot.conf as conf
import supybot.registry as registry
def configure(advanced):
from supybot.questions import expect, anything, something, yn
WhatCD = conf.registerPlugin('WhatCD', 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):
WhatCD.titleSnarfer.setValue(True)
WhatCD = conf.registerPlugin('WhatCD')
conf.registerGlobalValue(WhatCD, 'username', registry.String('', '''the what.cd username to use'''))
conf.registerGlobalValue(WhatCD, 'password', registry.String('', '''the what.cd password to use'''))
conf.registerGlobalValue(WhatCD, 'max_results', registry.String('3', '''the number of results to display from what.cd torrent searches'''))
conf.registerGroup(WhatCD, 'fetch')
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
开发者ID:GlitterCakes,项目名称:PoohBot,代码行数:21,代码来源:config.py
示例14: configure
# without the i18n module
_ = lambda x: x
from .local import accountsdb
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('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):
开发者ID:GLolol,项目名称:SupyPlugins,代码行数:31,代码来源:config.py
示例15: _
conf.registerChannelValue(RelayNext, 'color',
registry.Boolean(True, _("""Determines whether the bot will color relayed
PRIVMSGs so as to make the messages easier to read.""")))
conf.registerChannelValue(RelayNext, 'hostmasks',
registry.Boolean(True, _("""Determines whether the bot will relay the
hostmask of the person joining or parting the channel when he or she joins
or parts.""")))
conf.registerChannelValue(RelayNext, 'noHighlight',
registry.Boolean(False, _("""Determines whether the bot should prefix nicks
with a hyphen (-) to prevent excess highlights (in PRIVMSGs and actions).""")))
conf.registerChannelValue(RelayNext, 'showPrefixes',
registry.Boolean(False, _("""Determines whether the bot should status prefixes
(@, %, +) when relaying.""")))
conf.registerGroup(RelayNext, 'antiflood')
conf.registerChannelValue(RelayNext.antiflood, 'enable',
registry.Boolean(False, _("""Determines whether flood prevention should be enabled
for the given channel.""")))
conf.registerChannelValue(RelayNext.antiflood, 'seconds',
registry.PositiveInteger(20, _("""Determines how many seconds messages should be queued
for flood protection.""")))
conf.registerChannelValue(RelayNext.antiflood, 'maximum',
registry.PositiveInteger(15, _("""Determines the maximum amount of incoming messages
the bot will allow from a relay channel before flood protection is triggered.""")))
conf.registerChannelValue(RelayNext.antiflood.maximum, 'nonPrivmsgs',
registry.PositiveInteger(10, _("""Determines the maximum amount of incoming non-PRIVMSG events
the bot will allow from a relay channel before flood protection is triggered.""")))
conf.registerChannelValue(RelayNext.antiflood, 'timeout',
registry.PositiveInteger(60, _("""Determines the amount of time in seconds the bot should
block messages if flood protection is triggered.""")))
开发者ID:Hasimir,项目名称:glolol-supy-plugins,代码行数:30,代码来源:config.py
示例16: Copyright
###
# Copyright (c) 2013, Nils Brinkmann
# All rights reserved.
#
#
###
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('Subversion', True)
Subversion = conf.registerPlugin('Subversion')
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(Subversion, 'someConfigVariableName',
# registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGroup(Subversion, 'notifiers')
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
开发者ID:HyperEye,项目名称:supybot-svn,代码行数:27,代码来源:config.py
示例17: ignored
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.""",
),
)
conf.registerChannelValue(
Web,
"ignoreNicks",
registry.String(
" ",
"""Determines the nicks who shall be ignored (because
they are bots or other URL Snarfing bots.""",
),
)
conf.registerGroup(Web, "fetch")
conf.registerGlobalValue(
Web.fetch,
"maximum",
registry.NonNegativeInteger(
0,
"""Determines the maximum number of
bytes the bot will download via the 'fetch' command in this plugin.""",
),
)
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
开发者ID:prashantpawar,项目名称:supybot-rothbot,代码行数:30,代码来源:config.py
示例18: PluginInternationalization
###
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Owner')
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('Owner', True)
Owner = conf.registerPlugin('Owner', True)
conf.registerGlobalValue(Owner, 'public',
registry.Boolean(True, """Determines whether this plugin is publicly
visible."""))
conf.registerGlobalValue(Owner, 'quitMsg',
registry.String('', """Determines what quit message will be used by default.
If the quit command is called without a quit message, this will be used. If
this value is empty, the nick of the person giving the quit command will be
used."""))
conf.registerGroup(conf.supybot.commands, 'renames', orderAlphabetically=True)
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
开发者ID:4poc,项目名称:competitionbot,代码行数:30,代码来源:config.py
示例19: 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("Pacman", True)
Pacman = conf.registerPlugin("Pacman")
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(Pacman, 'someConfigVariableName',
# registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGroup(Pacman, "pkg")
conf.registerGlobalValue(
Pacman.pkg,
"max",
registry.NonNegativeInteger(
2,
"""Indique le maximum de paquets
à afficher (commande 'pkg' et 'aur').""",
),
)
conf.registerGroup(Pacman, "pkgfile")
conf.registerGlobalValue(
Pacman.pkgfile,
"max",
registry.NonNegativeInteger(
开发者ID:WnP,项目名称:archange,代码行数: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('String', True)
String = conf.registerPlugin('String')
conf.registerGroup(String, 'levenshtein')
conf.registerGlobalValue(String.levenshtein, 'max',
registry.PositiveInteger(256, """Determines the maximum size of a string
given to the levenshtein command. The levenshtein command uses an O(m*n)
algorithm, which means that with strings of length 256, it can take 1.5
seconds to finish; with strings of length 384, though, it can take 4
seconds to finish, and with strings of much larger lengths, it takes more
and more time. Using nested commands, strings can get quite large, hence
this variable, to limit the size of arguments passed to the levenshtein
command."""))
conf.registerGroup(String, 're')
conf.registerGlobalValue(String.re, 'timeout',
registry.PositiveFloat(0.1, """Determines the maximum time, in seconds, that
a regular expression is given to execute before being terminated. Since
there is a possibility that user input for the re command can cause it to
eat up large amounts of ram or cpu time, it's a good idea to keep this
开发者ID:Chalks,项目名称:Supybot,代码行数:31,代码来源:config.py
注:本文中的supybot.conf.registerGroup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论