From 2306d246e8c5bb928a432726178047b8d50776f5 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Tue, 25 Sep 2001 03:18:32 +0000 Subject: [PATCH] + Got rid of all instances of . Under IE5, GUI-mode pydoc has always been close to useless, because the -ified docstrings were too small to read, even after cranking up my default font size just for pydoc. Now it reads fine under my defaults (as does most of the web <0.5 wink>). If it's thought important to play tricks with font size, tough, then someone should rework pydoc to use style sheets, and (more) predictable percentage-of-default size controls. + Tried to ensure that all
and
tags are closed. I've read (but don't know) that some browsers get confused if they're not, and esp. when style sheets are in use too. --- Lib/pydoc.py | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index c3f33a094c..78ec71439f 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -348,8 +348,8 @@ TT { font-family: lucidatypewriter, lucida console, courier } return ''' - 
+ 
%s
 
 
%s
%s
''' % (bgcol, fgcol, title, fgcol, extras or ' ') @@ -362,8 +362,8 @@ TT { font-family: lucidatypewriter, lucida console, courier } result = '''

- + ''' % (bgcol, fgcol, title) if prelude: result = result + ''' @@ -399,7 +399,6 @@ TT { font-family: lucidatypewriter, lucida console, courier } result = result + '' return '
 
%s
 
+%s
%s
' % result - def small(self, text): return '%s' % text def grey(self, text): return '%s' % text def namelink(self, name, *dicts): @@ -478,14 +477,14 @@ TT { font-family: lucidatypewriter, lucida console, courier } for entry in tree: if type(entry) is type(()): c, bases = entry - result = result + '

' + result = result + '
' result = result + self.classlink(c, modname) if bases and bases != (parent,): parents = [] for base in bases: parents.append(self.classlink(base, modname)) result = result + '(' + join(parents, ', ') + ')' - result = result + '\n
' + result = result + '\n' elif type(entry) is type([]): result = result + '
\n%s
\n' % self.formattree( entry, modname, c) @@ -552,7 +551,7 @@ TT { font-family: lucidatypewriter, lucida console, courier } doc = self.markup(getdoc(object), self.preformat, fdict, cdict) doc = doc and '%s' % doc - result = result + '

%s

\n' % self.small(doc) + result = result + '

%s

\n' % doc if hasattr(object, '__path__'): modpkgs = [] @@ -646,7 +645,7 @@ TT { font-family: lucidatypewriter, lucida console, courier } if value.__doc__ is not None: doc = self.markup(value.__doc__, self.preformat, funcs, classes, mdict) - push('
%s
\n' % doc) + push('
%s
\n' % doc) for attr, tag in [("fset", " setter"), ("fget", " getter"), ("fdel", " deleter")]: @@ -671,7 +670,7 @@ TT { font-family: lucidatypewriter, lucida console, courier } else: doc = self.markup(getdoc(value), self.preformat, funcs, classes, mdict) - doc = '
' + self.small('%s' % doc) + doc = '
%s' % doc push('
%s%s
\n' % (base, doc)) push('\n') return attrs @@ -737,15 +736,13 @@ TT { font-family: lucidatypewriter, lucida console, courier } for base in bases: parents.append(self.classlink(base, object.__module__)) title = title + '(%s)' % join(parents, ', ') - doc = self.markup( - getdoc(object), self.preformat, funcs, classes, mdict) - doc = self.small(doc and '%s
 
' % doc or - self.small(' ')) + doc = self.markup(getdoc(object), self.preformat, funcs, classes, mdict) + doc = doc and '%s
 
' % doc or ' ' return self.section(title, '#000000', '#ffc8d8', contents, 5, doc) def formatvalue(self, object): """Format an argument default value as text.""" - return self.small(self.grey('=' + self.repr(object))) + return self.grey('=' + self.repr(object)) def docroutine(self, object, name=None, mod=None, funcs={}, classes={}, methods={}, cl=None): @@ -791,16 +788,16 @@ TT { font-family: lucidatypewriter, lucida console, courier } else: argspec = '(...)' - decl = title + argspec + (note and self.small(self.grey( - '%s' % note))) + decl = title + argspec + (note and self.grey( + '%s' % note)) if skipdocs: - return '
%s
\n' % decl + return '
%s
\n' % decl else: doc = self.markup( getdoc(object), self.preformat, funcs, classes, methods) - doc = doc and '
' + self.small('%s' % doc) - return '
%s%s
\n' % (decl, doc) + doc = doc and '
%s
' % doc + return '
%s
%s
\n' % (decl, doc) def docother(self, object, name=None, mod=None): """Produce HTML documentation for a data object.""" @@ -1801,8 +1798,8 @@ def serve(port, callback=None, completer=None): for dir in pathdirs(): indices.append(html.index(dir, seen)) contents = heading + join(indices) + '''

- -pydoc by Ka-Ping Yee <ping@lfw.org>''' + +pydoc by Ka-Ping Yee <ping@lfw.org>''' self.send_document('Index of Modules', contents) def log_message(self, *args): pass -- 2.40.0