Fixed single-quote-being-quoted bug and changed directory to docs/plugins, and removed some old debugging stuff.

This commit is contained in:
Jeremy Fincher 2003-09-06 23:18:33 +00:00
parent c711dc9d2d
commit 392113f29a

View File

@ -51,14 +51,10 @@ if conf.pluginDir not in sys.path:
def makePluginDocumentation(filename): def makePluginDocumentation(filename):
pluginName = filename.split('.')[0] pluginName = filename.split('.')[0]
moduleInfo = imp.find_module(pluginName) moduleInfo = imp.find_module(pluginName)
## try:
module = imp.load_module(pluginName, *moduleInfo) module = imp.load_module(pluginName, *moduleInfo)
## except ImportError, e: directory = os.path.join('docs', 'plugins')
## print >>sys.stderr, "Plugin %s could not be imported:" % filename if not os.path.exists(directory):
## print >>sys.stderr, e os.mkdir(directory)
## return
if not os.path.exists('plugindocs'):
os.mkdir('plugindocs')
plugin = module.Class() plugin = module.Class()
if isinstance(plugin, callbacks.Privmsg) and not \ if isinstance(plugin, callbacks.Privmsg) and not \
isinstance(plugin, callbacks.PrivmsgRegexp): isinstance(plugin, callbacks.PrivmsgRegexp):
@ -88,6 +84,7 @@ def makePluginDocumentation(filename):
if hasattr(module, 'example'): if hasattr(module, 'example'):
s = module.example.encode('string-escape') s = module.example.encode('string-escape')
s = s.replace('\\n', '\n') s = s.replace('\\n', '\n')
s = s.replace("\\'", "'")
fd.write(textwrap.dedent(""" fd.write(textwrap.dedent("""
<p>Here's an example session with this plugin: <p>Here's an example session with this plugin:
<pre> <pre>