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]) pluginNames = set([os.path.basename(s) for s in args])
plugins = set([]) plugins = set([])
for pluginName in pluginNames: for pluginName in pluginNames:
if pluginName == '__pycache__':
continue
if pluginName.endswith('.py'): if pluginName.endswith('.py'):
pluginName = pluginName[:-3] pluginName = pluginName[:-3]
try: try:
pluginModule = plugin.loadPluginModule(pluginName) pluginModule = plugin.loadPluginModule(pluginName)
except ImportError as e: except ImportError as e:
s = 'Failed to load plugin %s: %s\n' \ s = 'Failed to load plugin %s: %s\n' \
'%s(pluginDirs: %s)' % (pluginName, e, s, '(pluginDirs: %s)' % (pluginName, e,
conf.supybot.directories.plugins()) conf.supybot.directories.plugins())
error(s) error(s)
plugins.add(pluginModule) plugins.add(pluginModule)