Commit ca89bea7 by devttys0

Added sanity checks in core/plugin.py in case user plugins directory does not exist.

parent cf10f5b2
......@@ -170,8 +170,9 @@ class Plugins(object):
}
for key in plugins.keys():
plugins[key]['path'] = self.settings.paths[key][self.settings.PLUGINS]
plugins[key]['path'] = self.settings.get_file_path(key, self.settings.PLUGINS)
if plugins[key]['path']:
for file_name in os.listdir(plugins[key]['path']):
if file_name.endswith(self.MODULE_EXTENSION):
module = file_name[:-len(self.MODULE_EXTENSION)]
......@@ -203,7 +204,12 @@ class Plugins(object):
def _load_plugin_modules(self, plugins):
for module in plugins['modules']:
try:
file_path = os.path.join(plugins['path'], module + self.MODULE_EXTENSION)
except KeyboardInterrupt as e:
raise e
except Exception:
continue
try:
plugin = imp.load_source(module, file_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment