mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 12:12:54 +01:00
Spelled publicly correctly, and moved the proper registration of the public attribute from Owner to conf.registerPlugin.
This commit is contained in:
parent
a7dcf7604b
commit
a3f136279f
@ -107,10 +107,7 @@ def loadPluginClass(irc, module, register=None):
|
|||||||
public = True
|
public = True
|
||||||
if hasattr(cb, 'public'):
|
if hasattr(cb, 'public'):
|
||||||
public = cb.public
|
public = cb.public
|
||||||
conf.registerPlugin(name, register)
|
conf.registerPlugin(name, register, public)
|
||||||
conf.supybot.plugins.get(name).register('public',
|
|
||||||
registry.Boolean(public, """Determines whether this plugin is
|
|
||||||
publically visible."""))
|
|
||||||
assert not irc.getCallback(name)
|
assert not irc.getCallback(name)
|
||||||
irc.addCallback(cb)
|
irc.addCallback(cb)
|
||||||
return cb
|
return cb
|
||||||
|
@ -95,10 +95,13 @@ def registerChannelValue(group, name, value):
|
|||||||
value.supplyDefault = True
|
value.supplyDefault = True
|
||||||
return group.register(name, value)
|
return group.register(name, value)
|
||||||
|
|
||||||
def registerPlugin(name, currentValue=None):
|
def registerPlugin(name, currentValue=None, public=True):
|
||||||
registerGlobalValue(supybot.plugins, name,
|
group = registerGlobalValue(supybot.plugins, name,
|
||||||
registry.Boolean(False, """Determines whether this plugin is loaded by
|
registry.Boolean(False, """Determines whether this plugin is loaded by
|
||||||
default.""", showDefault=False))
|
default.""", showDefault=False))
|
||||||
|
registerGlobalValue(group, 'public',
|
||||||
|
registry.Boolean(public, """Determines whether this plugin is
|
||||||
|
publicly visible."""))
|
||||||
if currentValue is not None:
|
if currentValue is not None:
|
||||||
supybot.plugins.get(name).setValue(currentValue)
|
supybot.plugins.get(name).setValue(currentValue)
|
||||||
return registerGroup(users.plugins, name)
|
return registerGroup(users.plugins, name)
|
||||||
|
Loading…
Reference in New Issue
Block a user