mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Browser compatibility fixes.
Show methods aliased into a class from other classes.
This commit is contained in:
parent
e702481d38
commit
e280c06d59
1 changed files with 8 additions and 7 deletions
15
Lib/pydoc.py
15
Lib/pydoc.py
|
@ -258,8 +258,9 @@ class HTMLDoc(Doc):
|
||||||
return '''
|
return '''
|
||||||
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<html><head><title>Python: %s</title>
|
<html><head><title>Python: %s</title>
|
||||||
<style>TT { font-family: lucida console, lucida typewriter, courier }</style>
|
<style type="text/css"><!--
|
||||||
</head><body bgcolor="#f0f0f8">
|
TT { font-family: lucida console, lucida typewriter, courier }
|
||||||
|
--></style></head><body bgcolor="#f0f0f8">
|
||||||
%s
|
%s
|
||||||
</body></html>''' % (title, contents)
|
</body></html>''' % (title, contents)
|
||||||
|
|
||||||
|
@ -440,7 +441,7 @@ class HTMLDoc(Doc):
|
||||||
|
|
||||||
modules = inspect.getmembers(object, inspect.ismodule)
|
modules = inspect.getmembers(object, inspect.ismodule)
|
||||||
|
|
||||||
if 0 and hasattr(object, '__all__'):
|
if 0 and hasattr(object, '__all__'): # disabled for now
|
||||||
visible = lambda key, all=object.__all__: key in all
|
visible = lambda key, all=object.__all__: key in all
|
||||||
else:
|
else:
|
||||||
visible = lambda key: key[:1] != '_'
|
visible = lambda key: key[:1] != '_'
|
||||||
|
@ -473,7 +474,7 @@ class HTMLDoc(Doc):
|
||||||
|
|
||||||
doc = self.markup(getdoc(object), self.preformat, fdict, cdict)
|
doc = self.markup(getdoc(object), self.preformat, fdict, cdict)
|
||||||
doc = doc and '<tt>%s</tt>' % doc
|
doc = doc and '<tt>%s</tt>' % doc
|
||||||
result = result + '<p>%s\n' % self.small(doc)
|
result = result + '<p>%s</p>\n' % self.small(doc)
|
||||||
|
|
||||||
if hasattr(object, '__path__'):
|
if hasattr(object, '__path__'):
|
||||||
modpkgs = []
|
modpkgs = []
|
||||||
|
@ -575,7 +576,7 @@ class HTMLDoc(Doc):
|
||||||
skipdocs = 0
|
skipdocs = 0
|
||||||
if inspect.ismethod(object):
|
if inspect.ismethod(object):
|
||||||
if cl:
|
if cl:
|
||||||
if not cl.__dict__.has_key(name):
|
if object.im_class is not cl:
|
||||||
base = object.im_class
|
base = object.im_class
|
||||||
url = '#%s-%s' % (base.__name__, name)
|
url = '#%s-%s' % (base.__name__, name)
|
||||||
basename = base.__name__
|
basename = base.__name__
|
||||||
|
@ -595,7 +596,7 @@ class HTMLDoc(Doc):
|
||||||
else:
|
else:
|
||||||
if (cl and cl.__dict__.has_key(realname) and
|
if (cl and cl.__dict__.has_key(realname) and
|
||||||
cl.__dict__[realname] is object):
|
cl.__dict__[realname] is object):
|
||||||
reallink = '<a href="%s">%s</a>' % (
|
reallink = '<a href="#%s">%s</a>' % (
|
||||||
cl.__name__ + '-' + realname, realname)
|
cl.__name__ + '-' + realname, realname)
|
||||||
skipdocs = 1
|
skipdocs = 1
|
||||||
else:
|
else:
|
||||||
|
@ -846,7 +847,7 @@ class TextDoc(Doc):
|
||||||
skipdocs = 0
|
skipdocs = 0
|
||||||
if inspect.ismethod(object):
|
if inspect.ismethod(object):
|
||||||
if cl:
|
if cl:
|
||||||
if not cl.__dict__.has_key(name):
|
if object.im_class is not cl:
|
||||||
base = object.im_class
|
base = object.im_class
|
||||||
basename = base.__name__
|
basename = base.__name__
|
||||||
if base.__module__ != cl.__module__:
|
if base.__module__ != cl.__module__:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue