Added check for duplicate module loading in load command

This commit is contained in:
Jeremy Fincher 2003-04-02 07:09:43 +00:00
parent f82170de74
commit 7e8aab6619

View File

@ -289,6 +289,9 @@ class OwnerCommands(CapabilityCheckingPrivmsg):
Loads the plugin <plugin> from the plugins/ directory. Loads the plugin <plugin> from the plugins/ directory.
""" """
name = getArgs(args) name = getArgs(args)
if name in [cb.name() for cb in irc.callbacks]:
irc.error('Sorry, that module is already loaded.')
return
try: try:
moduleInfo = imp.find_module(name) moduleInfo = imp.find_module(name)
except ImportError: except ImportError: