supybot-plugin-doc: Fix bugs with --plugins-dir

This commit is contained in:
Valentin Lorentz 2021-04-05 12:25:44 +02:00
parent 6b9de3d09d
commit 524e409322

View File

@ -291,13 +291,15 @@ if __name__ == '__main__':
pluginNames = set([os.path.basename(s) for s in args])
plugins = set([])
for pluginName in pluginNames:
if pluginName == '__pycache__':
continue
if pluginName.endswith('.py'):
pluginName = pluginName[:-3]
try:
pluginModule = plugin.loadPluginModule(pluginName)
except ImportError as e:
s = 'Failed to load plugin %s: %s\n' \
'%s(pluginDirs: %s)' % (pluginName, e, s,
'(pluginDirs: %s)' % (pluginName, e,
conf.supybot.directories.plugins())
error(s)
plugins.add(pluginModule)