added try/catch block to plugin loading
This commit is contained in:
parent
184f7cb8a4
commit
2a43f59a58
@ -97,8 +97,9 @@ class basexmpp(object):
|
||||
# discover relative "path" to the plugins module from the main app, and import it.
|
||||
# TODO:
|
||||
# gross, this probably isn't necessary anymore, especially for an installed module
|
||||
try:
|
||||
if pluginModule:
|
||||
module = __import__("%s.%s" % (pluginModule, plugin), globals(), locals(), [plugin])
|
||||
module = __import__(pluginModule, globals(), locals(), [plugin])
|
||||
else:
|
||||
module = __import__("%s.%s" % (globals()['plugins'].__name__, plugin), globals(), locals(), [plugin])
|
||||
# init the plugin class
|
||||
@ -108,6 +109,8 @@ class basexmpp(object):
|
||||
if hasattr(self.plugin[plugin], 'xep'):
|
||||
xep = "(XEP-%s) " % self.plugin[plugin].xep
|
||||
logging.debug("Loaded Plugin %s%s" % (xep, self.plugin[plugin].description))
|
||||
except:
|
||||
logging.error("Unable to load plugin: %s" %(plugin) )
|
||||
|
||||
def register_plugins(self):
|
||||
"""Initiates all plugins in the plugins/__init__.__all__"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user