Updated. Not finished, but Vee2d2 needs it.

This commit is contained in:
Jeremy Fincher 2004-02-06 04:39:47 +00:00
parent 6e062306f2
commit aff2e6f718

View File

@ -76,10 +76,10 @@ def describePlugin(module, showUsage):
def clearLoadedPlugins(plugins, pluginRegistry): def clearLoadedPlugins(plugins, pluginRegistry):
for plugin in plugins: for plugin in plugins:
try: try:
pluginKey = pluginRegistry.getChild(plugin) pluginKey = pluginRegistry.get(plugin)
if pluginKey(): if pluginKey():
plugins.remove(plugin) plugins.remove(plugin)
except KeyError: except registry.NonExistentRegistryEntry:
continue continue
_windowsVarRe = re.compile(r'%(\w+)%') _windowsVarRe = re.compile(r'%(\w+)%')
@ -314,6 +314,7 @@ def main():
output("""That's not a valid nick. Go ahead and pick another.""") output("""That's not a valid nick. Go ahead and pick another.""")
# conf.supybot.user # conf.supybot.user
if advanced:
output("""If you've ever done a /whois on a person, you know that IRC output("""If you've ever done a /whois on a person, you know that IRC
provides a way for users to show the world their full name. What would provides a way for users to show the world their full name. What would
you like your bot's full name to be? If you don't care, just press you like your bot's full name to be? If you don't care, just press
@ -374,24 +375,25 @@ def main():
except registry.InvalidRegistryValue: except registry.InvalidRegistryValue:
# FIXME: say which ones weren't channels. # FIXME: say which ones weren't channels.
output("""Not all of those are valid IRC channels. Be sure to output("""Not all of those are valid IRC channels. Be sure to
prefix the channel with # (or +, or !, or &, but no one uses those prefix the channel with # (or +, or !, or &, but no one uses
channels, really).""") those channels, really).""")
### ###
# Plugins # Plugins
### ###
def configurePlugin(module, advanced): def configurePlugin(module, advanced):
if hasattr(module, 'configure'): if hasattr(module, 'configure'):
output("""Beginning configuration for %s..."""%module.Class.__name__) output("""Beginning configuration for %s...""" %
module.Class.__name__)
module.configure(advanced) module.configure(advanced)
print # Blank line :) print # Blank line :)
output("""Done!""") output("""Done!""")
else: else:
conf.registerPlugin(module, currentValue=True) conf.registerPlugin(module.__name__, currentValue=True)
plugins = getPlugins(pluginDirs) plugins = getPlugins(pluginDirs)
for s in ('Admin', 'User', 'Channel', 'Misc', 'Config'): for s in ('Admin', 'User', 'Channel', 'Misc', 'Config'):
configurePlugin(s, advanced) configurePlugin(loadPlugin(s), advanced)
clearLoadedPlugins(plugins, conf.supybot.plugins) clearLoadedPlugins(plugins, conf.supybot.plugins)
output("""Now we're going to run you through plugin configuration. There's output("""Now we're going to run you through plugin configuration. There's