Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4bd5b099
Commit
4bd5b099
authored
Feb 27, 2001
by
Ka-Ping Yee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add display of $Revision $ and credits.
parent
eef96ac7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
10 deletions
+33
-10
Lib/pydoc.py
Lib/pydoc.py
+33
-10
No files found.
Lib/pydoc.py
View file @
4bd5b099
...
...
@@ -20,7 +20,13 @@ In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object."""
__author__
=
"Ka-Ping Yee <ping@lfw.org>"
__version__
=
"26 February 2001"
__date__
=
"26 February 2001"
__version__
=
"$Revision $"
__credits__
=
"""Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
A moose bit my sister once."""
import
sys
,
imp
,
os
,
stat
,
re
,
types
,
inspect
from
repr
import
Repr
...
...
@@ -383,8 +389,16 @@ class HTMLDoc(Doc):
filelink = '
<
a
href
=
"file:%s"
>%
s
</
a
>
' % (file, file)
except TypeError:
filelink = '
(
built
-
in
)
'
info = []
if hasattr(object, '
__version__
'):
head = head + '
(
version
:
%
s
)
' % self.escape(object.__version__)
version = str(object.__version__)
if version[:11] == '
$
Revision
$
':
version = version[11:-1]
info.append('
version
:
%
s
' % self.escape(version))
if hasattr(object, '
__date__
'):
info.append(self.escape(str(object.__date__)))
if info:
head = head + '
(
%
s
)
' % join(info, '
,
')
result = result + self.heading(
head, '
#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink)
...
...
@@ -463,6 +477,16 @@ class HTMLDoc(Doc):
result
=
result
+
self
.
bigsection
(
'Constants'
,
'#ffffff'
,
'#55aa55'
,
contents
)
if
hasattr
(
object
,
'__author__'
):
contents
=
self
.
markup
(
str
(
object
.
__author__
),
self
.
preformat
)
result
=
result
+
self
.
bigsection
(
'Author'
,
'#ffffff'
,
'#7799ee'
,
contents
)
if
hasattr
(
object
,
'__credits__'
):
contents
=
self
.
markup
(
str
(
object
.
__credits__
),
self
.
preformat
)
result
=
result
+
self
.
bigsection
(
'Credits'
,
'#ffffff'
,
'#7799ee'
,
contents
)
return
result
def
docclass
(
self
,
object
,
funcs
=
{},
classes
=
{}):
...
...
@@ -694,16 +718,15 @@ class TextDoc(Doc):
if
hasattr
(
object
,
'__version__'
):
version
=
str
(
object
.
__version__
)
if
hasattr
(
object
,
'__date__'
)
:
version
=
version
+
', '
+
str
(
object
.
__date__
)
if
version
[:
11
]
==
'$Revision$'
:
version
=
version
[
11
:
-
1
]
result
=
result
+
self
.
section
(
'VERSION'
,
version
)
if
hasattr
(
object
,
'__date__'
):
result
=
result
+
self
.
section
(
'DATE'
,
str
(
object
.
__date__
))
if
hasattr
(
object
,
'__author__'
):
author
=
str
(
object
.
__author__
)
if
hasattr
(
object
,
'__email__'
):
author
=
author
+
' <'
+
str
(
object
.
__email__
)
+
'>'
result
=
result
+
self
.
section
(
'AUTHOR'
,
author
)
result
=
result
+
self
.
section
(
'AUTHOR'
,
str
(
object
.
__author__
))
if
hasattr
(
object
,
'__credits__'
):
result
=
result
+
self
.
section
(
'CREDITS'
,
str
(
object
.
__credits__
))
return
result
def
docclass
(
self
,
object
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment