Removed possible double-listing of plugins in getPlugins().

This commit is contained in:
Jeremy Fincher 2003-10-11 10:29:11 +00:00
parent 2140a8ac20
commit f41a802b82

View File

@ -42,12 +42,12 @@ def getPlugins():
filenames = [] filenames = []
for dir in conf.pluginDirs: for dir in conf.pluginDirs:
filenames.extend(os.listdir(dir)) filenames.extend(os.listdir(dir))
plugins = [] plugins = sets.Set([])
for filename in filenames: for filename in filenames:
if filename.endswith('.py') and filename[0].isupper(): if filename.endswith('.py') and filename[0].isupper():
plugins.append(os.path.splitext(filename)[0]) plugins.add(os.path.splitext(filename)[0])
if 'OwnerCommands' in plugins: plugins.discard('OwnerCommands')
plugins.remove('OwnerCommands') plugins = list(plugins)
plugins.sort() plugins.sort()
return plugins return plugins