From a16bb77cba7dd9010e02f46e773a16f3db19c41e Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 18 Sep 2003 05:52:55 +0000 Subject: [PATCH] Extracted loadPlugin{Module,Class} behavior into separate functions that can be exported to all modules. --- src/OwnerCommands.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/OwnerCommands.py b/src/OwnerCommands.py index 21e606300..9f779265b 100644 --- a/src/OwnerCommands.py +++ b/src/OwnerCommands.py @@ -247,20 +247,14 @@ class OwnerCommands(privmsgs.CapabilityCheckingPrivmsg): """ name = privmsgs.getArgs(args) callbacks = irc.removeCallback(name) - if callbacks: try: - moduleInfo = imp.find_module(name, conf.pluginDirs) - module = imp.load_module(name, *moduleInfo) - linecache.checkcache() + module = loadPluginModule(name) for callback in callbacks: callback.die() del callback gc.collect() - callback = module.Class() - irc.addCallback(callback) - if hasattr(callback, 'configure'): - callback.configure(irc) + callback = loadPluginClass(irc, module) irc.reply(msg, conf.replySuccess) except ImportError: for callback in callbacks: