Some updates to work with the import changes and support module.Class.__doc__

This commit is contained in:
James Vega 2004-07-28 02:10:16 +00:00
parent d2ff10b25d
commit 03b183da7f

View File

@ -38,9 +38,9 @@ import textwrap
import traceback import traceback
import supybot import supybot
import supybot.src.world import supybot.world as world
supybot.src.world.documenting = True world.documenting = True
if not os.path.exists('test-conf'): if not os.path.exists('test-conf'):
os.mkdir('test-conf') os.mkdir('test-conf')
@ -54,12 +54,12 @@ supybot.directories.log: test-logs
""") """)
fd.close() fd.close()
import registry import supybot.registry as registry
registry.open(registryFilename) registry.open(registryFilename)
import conf import supybot.conf as conf
import utils import supybot.utils as utils
import callbacks import supybot.callbacks as callbacks
commandDict = {} commandDict = {}
firstChars = {} firstChars = {}
@ -187,10 +187,17 @@ def makePluginDocumentation(pluginWindow):
<link rel="next" href="%s.html"> <link rel="next" href="%s.html">
<link rel="previous" href="%s.html"> <link rel="previous" href="%s.html">
''' % (next, prev) ''' % (next, prev)
pluginhelp = getattr(module.Class, '__doc__', False)
if pluginhelp:
pluginhelp = '<div class="pluginhelp">%s</div>' %\
cgi.escape(pluginhelp)
else:
pluginhelp = ''
fd.write(textwrap.dedent(''' fd.write(textwrap.dedent('''
%s %s
<div class="plugintitle">%s</div> <div class="plugintitle">%s</div>
%s %s
%s
<div class="mainbody" style="padding: 0;"> <div class="mainbody" style="padding: 0;">
%s %s
<table> <table>
@ -198,6 +205,7 @@ def makePluginDocumentation(pluginWindow):
Detailed Help</td></tr> Detailed Help</td></tr>
''' % (genHeader(title, meta), ''' % (genHeader(title, meta),
cgi.escape(module.__doc__ or ""), cgi.escape(module.__doc__ or ""),
pluginhelp,
deprecated, deprecated,
genNavbar('../../')))) genNavbar('../../'))))
attrs = [x for x in dir(plugin) if plugin.isCommand(x) and not attrs = [x for x in dir(plugin) if plugin.isCommand(x) and not