Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 987ec90

Browse files
committed
Small formatting improvements.
1 parent 3bda879 commit 987ec90

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

Lib/pydoc.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ def heading(self, title, fgcol, bgcol, extras=''):
269269
<table width="100%%" cellspacing=0 cellpadding=2 border=0>
270270
<tr bgcolor="%s">
271271
<td valign=bottom><small>&nbsp;<br></small
272-
><font color="%s" face="helvetica">&nbsp;<br>%s</font></td
272+
><font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
273273
><td align=right valign=bottom
274-
><font color="%s" face="helvetica">%s</font></td></tr></table>
274+
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
275275
''' % (bgcol, fgcol, title, fgcol, extras or '&nbsp;')
276276

277277
def section(self, title, fgcol, bgcol, contents, width=20,
@@ -287,9 +287,11 @@ def section(self, title, fgcol, bgcol, contents, width=20,
287287
''' % (bgcol, fgcol, title)
288288
if prelude:
289289
result = result + '''
290-
<tr bgcolor="%s"><td>%s</td>
291-
<td colspan=2>%s</td></tr>''' % (bgcol, marginalia, prelude)
292-
result = result + '''
290+
<tr bgcolor="%s"><td rowspan=2>%s</td>
291+
<td colspan=2>%s</td></tr>
292+
<tr><td>%s</td>''' % (bgcol, marginalia, prelude, gap)
293+
else:
294+
result = result + '''
293295
<tr><td bgcolor="%s">%s</td><td>%s</td>''' % (bgcol, marginalia, gap)
294296

295297
return result + '<td width="100%%">%s</td></tr></table>' % contents
@@ -556,7 +558,7 @@ def docclass(self, object, name=None, funcs={}, classes={}):
556558
title = title + '(%s)' % join(parents, ', ')
557559
doc = self.markup(
558560
getdoc(object), self.preformat, funcs, classes, mdict)
559-
doc = self.small('<tt>%s<br>&nbsp;</tt>' % doc)
561+
doc = self.small(doc and '<tt>%s<br>&nbsp;</tt>' % doc or '<tt>&nbsp;</tt>')
560562
return self.section(title, '#000000', '#ffc8d8', contents, 10, doc)
561563

562564
def formatvalue(self, object):
@@ -584,7 +586,7 @@ def docroutine(self, object, name=None,
584586
skipdocs = 1
585587
else:
586588
note = (object.im_self and
587-
'method of ' + self.repr(object.im_self) or
589+
' method of ' + self.repr(object.im_self) or
588590
' unbound %s method' % object.im_class.__name__)
589591
object = object.im_func
590592

@@ -610,15 +612,16 @@ def docroutine(self, object, name=None,
610612
decl = '<em>lambda</em>'
611613
argspec = argspec[1:-1] # remove parentheses
612614

613-
decl = title + argspec + (note and self.small(self.grey(note)))
615+
decl = title + argspec + (note and self.small(self.grey(
616+
'<font face="helvetica, arial">%s</font>' % note)))
614617

615618
if skipdocs:
616-
return '<dl><dt>%s</dl>' % decl
619+
return '<dl><dt>%s</dl>\n' % decl
617620
else:
618621
doc = self.markup(
619622
getdoc(object), self.preformat, funcs, classes, methods)
620623
doc = doc and '<tt>%s</tt>' % doc
621-
return '<dl><dt>%s<dd>%s</dl>' % (decl, self.small(doc))
624+
return '<dl><dt>%s<dd>%s</dl>\n' % (decl, self.small(doc))
622625

623626
def docother(self, object, name=None):
624627
"""Produce HTML documentation for a data object."""

0 commit comments

Comments
 (0)