Really make supybot-wizard see the new-style plugins.

This commit is contained in:
James Vega 2005-05-06 02:31:42 +00:00
parent 5948a710eb
commit 903e605c77

View File

@ -61,17 +61,17 @@ import supybot.questions as questions
from supybot.questions import output, yn, anything, something, expect, getpass from supybot.questions import output, yn, anything, something, expect, getpass
def getPlugins(pluginDirs): def getPlugins(pluginDirs):
filenames = [] plugins = set([])
join = os.path.join
for pluginDir in pluginDirs: for pluginDir in pluginDirs:
try: try:
filenames.extend(os.listdir(pluginDir)) for filename in os.listdir(pluginDir):
except OSError: fname = join(pluginDir, filename)
continue if (filename.endswith('.py') or os.path.isdir(fname)) \
plugins = sets.Set([])
for filename in filenames:
if (filename.endswith('.py') or os.path.isdir(filename)) \
and filename[0].isupper(): and filename[0].isupper():
plugins.add(os.path.splitext(filename)[0]) plugins.add(os.path.splitext(filename)[0])
except OSError:
continue
plugins.discard('Owner') plugins.discard('Owner')
plugins = list(plugins) plugins = list(plugins)
plugins.sort() plugins.sort()