From e71865d02f7198249ac0ddc88a44ba82f55032ab Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 29 Oct 2011 13:28:46 +0200 Subject: [PATCH] Edit the script to generate the doc for unofficial plugins. --- append_config_doc.py | 10 ++++++---- generate_plugin_doc.py | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/append_config_doc.py b/append_config_doc.py index 6c01ecd..d8bbd4c 100644 --- a/append_config_doc.py +++ b/append_config_doc.py @@ -18,14 +18,16 @@ class ConfigPlugin(Config.Config): # Commands instances are converted into SynchronizedAndFirewalled from supybot.callbacks import SynchronizedAndFirewalled as Commands -sys.path.append('/home/progval/workspace/Supybot/Limnoria/plugins') +sys.path.append('/home/progval/workspace/Supybot/Supybot-plugins') def main(): pluginNames = sys.argv[1:] for pluginName in pluginNames: - supybot = __import__('supybot.plugins.%s.config' % pluginName) - pluginConfig = getattr(getattr(supybot.plugins, pluginName).config, - pluginName) # combo! + #supybot = __import__('supybot.plugins.%s.config' % pluginName) + supybot = __import__('%s.config' % pluginName) + #pluginConfig = getattr(getattr(supybot.plugins, pluginName).config, + # pluginName) # combo! + pluginConfig = getattr(supybot.config, pluginName) filename = 'use/plugins/%s.rst' % pluginName.lower() configRoot = 'supybot.plugins.%s' % pluginName with open(filename, 'a') as fd: diff --git a/generate_plugin_doc.py b/generate_plugin_doc.py index a6fb46b..7810bcb 100644 --- a/generate_plugin_doc.py +++ b/generate_plugin_doc.py @@ -11,11 +11,13 @@ from supybot.callbacks import SynchronizedAndFirewalled as Commands validCommandName = re.compile('^[a-z]+$') +sys.path.append('/home/progval/workspace/Supybot/Supybot-plugins') + def main(): pluginNames = sys.argv[1:] for pluginName in pluginNames: - supybot = __import__('supybot.plugins.%s.plugin' % pluginName) - PluginClass = getattr(supybot.plugins, pluginName).plugin.Class + supybot = __import__('%s.plugin' % pluginName) + PluginClass = supybot.plugin.Class filename = 'use/plugins/%s.rst' % pluginName.lower() try: os.unlink(filename)