mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Fix for bug #829300
This commit is contained in:
parent
d54ec97253
commit
300004ca62
@ -72,6 +72,7 @@ def loadPluginModule(name):
|
|||||||
def loadPluginClass(irc, module):
|
def loadPluginClass(irc, module):
|
||||||
"""Loads the plugin Class from the given module into the given irc."""
|
"""Loads the plugin Class from the given module into the given irc."""
|
||||||
callback = module.Class()
|
callback = module.Class()
|
||||||
|
assert not irc.getCallback(callback.name())
|
||||||
irc.addCallback(callback)
|
irc.addCallback(callback)
|
||||||
if hasattr(callback, 'configure'):
|
if hasattr(callback, 'configure'):
|
||||||
callback.configure(irc)
|
callback.configure(irc)
|
||||||
@ -285,10 +286,9 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
the end.
|
the end.
|
||||||
"""
|
"""
|
||||||
name = privmsgs.getArgs(args)
|
name = privmsgs.getArgs(args)
|
||||||
for cb in irc.callbacks:
|
if irc.getCallback(name):
|
||||||
if cb.name() == name:
|
irc.error(msg, 'That module is already loaded.')
|
||||||
irc.error(msg, 'That module is already loaded.')
|
return
|
||||||
return
|
|
||||||
try:
|
try:
|
||||||
module = loadPluginModule(name)
|
module = loadPluginModule(name)
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
|
@ -83,6 +83,7 @@ class OwnerTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
|
|
||||||
def testLoad(self):
|
def testLoad(self):
|
||||||
self.assertError('load Owner')
|
self.assertError('load Owner')
|
||||||
|
self.assertError('load owner')
|
||||||
self.assertNotError('load Misc')
|
self.assertNotError('load Misc')
|
||||||
self.assertNotError('list Owner')
|
self.assertNotError('list Owner')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user