From: Ka-Ping Yee Date: Fri, 23 Mar 2001 13:35:45 +0000 (+0000) Subject: Small formatting improvements. X-Git-Tag: v2.1b2~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=987ec903d624be4c8ba423182013fa3b72e01bd5;p=python Small formatting improvements. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index f011d6d69e..e34fccbbf0 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -269,9 +269,9 @@ class HTMLDoc(Doc):  
%s
 
 
%s
%s
+>%s ''' % (bgcol, fgcol, title, fgcol, extras or ' ') def section(self, title, fgcol, bgcol, contents, width=20, @@ -287,9 +287,11 @@ class HTMLDoc(Doc): ''' % (bgcol, fgcol, title) if prelude: result = result + ''' -%s -%s''' % (bgcol, marginalia, prelude) - result = result + ''' +%s +%s +%s''' % (bgcol, marginalia, prelude, gap) + else: + result = result + ''' %s%s''' % (bgcol, marginalia, gap) return result + '%s' % contents @@ -556,7 +558,7 @@ class HTMLDoc(Doc): title = title + '(%s)' % join(parents, ', ') doc = self.markup( getdoc(object), self.preformat, funcs, classes, mdict) - doc = self.small('%s
 
' % doc) + doc = self.small(doc and '%s
 
' % doc or ' ') return self.section(title, '#000000', '#ffc8d8', contents, 10, doc) def formatvalue(self, object): @@ -584,7 +586,7 @@ class HTMLDoc(Doc): skipdocs = 1 else: note = (object.im_self and - 'method of ' + self.repr(object.im_self) or + ' method of ' + self.repr(object.im_self) or ' unbound %s method' % object.im_class.__name__) object = object.im_func @@ -610,15 +612,16 @@ class HTMLDoc(Doc): decl = 'lambda' argspec = argspec[1:-1] # remove parentheses - decl = title + argspec + (note and self.small(self.grey(note))) + decl = title + argspec + (note and self.small(self.grey( + '%s' % note))) if skipdocs: - return '
%s
' % decl + return '
%s
\n' % decl else: doc = self.markup( getdoc(object), self.preformat, funcs, classes, methods) doc = doc and '%s' % doc - return '
%s
%s
' % (decl, self.small(doc)) + return '
%s
%s
\n' % (decl, self.small(doc)) def docother(self, object, name=None): """Produce HTML documentation for a data object."""