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
6cb2ac22
Commit
6cb2ac22
authored
Jun 02, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A nicety (author lost).
parent
41c302fc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
146 additions
and
0 deletions
+146
-0
Doc/custlib.py
Doc/custlib.py
+73
-0
Doc/tools/custlib.py
Doc/tools/custlib.py
+73
-0
No files found.
Doc/custlib.py
0 → 100644
View file @
6cb2ac22
# Generate custlib.tex, which is a site-specific library document.
# Phase I: list all the things that can be imported
import
glob
,
os
,
sys
,
string
modules
=
{}
for
modname
in
sys
.
builtin_module_names
:
modules
[
modname
]
=
modname
for
dir
in
sys
.
path
:
# Look for *.py files
filelist
=
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.py'
))
for
file
in
filelist
:
path
,
file
=
os
.
path
.
split
(
file
)
base
,
ext
=
os
.
path
.
splitext
(
file
)
modules
[
string
.
lower
(
base
)]
=
base
# Look for shared library files
filelist
=
(
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.so'
))
+
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.sl'
))
+
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.o'
))
)
for
file
in
filelist
:
path
,
file
=
os
.
path
.
split
(
file
)
base
,
ext
=
os
.
path
.
splitext
(
file
)
if
base
[
-
6
:]
==
'module'
:
base
=
base
[:
-
6
]
modules
[
string
.
lower
(
base
)]
=
base
# Minor oddity: the types module is documented in libtypes2.tex
if
modules
.
has_key
(
'types'
):
del
modules
[
'types'
]
;
modules
[
'types2'
]
=
None
# Phase II: find all documentation files (lib*.tex)
# and eliminate modules that don't have one.
docs
=
{}
filelist
=
glob
.
glob
(
'lib*.tex'
)
for
file
in
filelist
:
modname
=
file
[
3
:
-
4
]
docs
[
modname
]
=
modname
mlist
=
modules
.
keys
()
mlist
=
filter
(
lambda
x
,
docs
=
docs
:
docs
.
has_key
(
x
),
mlist
)
mlist
.
sort
()
mlist
=
map
(
lambda
x
,
docs
=
docs
:
docs
[
x
],
mlist
)
modules
=
mlist
# Phase III: write custlib.tex
# Write the boilerplate
# XXX should be fancied up.
print
"""
\
docume
n
tstyle[twoside,11pt,myformat]{report}
\
\
title{Python Library Reference}
\
\
input{boilerplate}
\
\
makeindex % tell
\
\
index to actually write the .idx file
\
\
begin{document}
\
\
pagenumbering{roman}
\
\
maketitle
\
\
input{copyright}
\
\
begin{abstract}
\
\
noindent This is a customized version of the Python Library Reference.
\
\
end{abstract}
\
\
pagebreak
{
\
\
parskip = 0mm
\
\
tableofcontents}
\
\
pagebreak
\
\
pagenumbering{arabic}"""
for
modname
in
mlist
:
print
"
\
\
input{lib%s}"
%
(
modname
,)
# Write the end
print
"""
\
\
input{custlib.ind} % Index
\
\
end{document}"""
Doc/tools/custlib.py
0 → 100644
View file @
6cb2ac22
# Generate custlib.tex, which is a site-specific library document.
# Phase I: list all the things that can be imported
import
glob
,
os
,
sys
,
string
modules
=
{}
for
modname
in
sys
.
builtin_module_names
:
modules
[
modname
]
=
modname
for
dir
in
sys
.
path
:
# Look for *.py files
filelist
=
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.py'
))
for
file
in
filelist
:
path
,
file
=
os
.
path
.
split
(
file
)
base
,
ext
=
os
.
path
.
splitext
(
file
)
modules
[
string
.
lower
(
base
)]
=
base
# Look for shared library files
filelist
=
(
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.so'
))
+
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.sl'
))
+
glob
.
glob
(
os
.
path
.
join
(
dir
,
'*.o'
))
)
for
file
in
filelist
:
path
,
file
=
os
.
path
.
split
(
file
)
base
,
ext
=
os
.
path
.
splitext
(
file
)
if
base
[
-
6
:]
==
'module'
:
base
=
base
[:
-
6
]
modules
[
string
.
lower
(
base
)]
=
base
# Minor oddity: the types module is documented in libtypes2.tex
if
modules
.
has_key
(
'types'
):
del
modules
[
'types'
]
;
modules
[
'types2'
]
=
None
# Phase II: find all documentation files (lib*.tex)
# and eliminate modules that don't have one.
docs
=
{}
filelist
=
glob
.
glob
(
'lib*.tex'
)
for
file
in
filelist
:
modname
=
file
[
3
:
-
4
]
docs
[
modname
]
=
modname
mlist
=
modules
.
keys
()
mlist
=
filter
(
lambda
x
,
docs
=
docs
:
docs
.
has_key
(
x
),
mlist
)
mlist
.
sort
()
mlist
=
map
(
lambda
x
,
docs
=
docs
:
docs
[
x
],
mlist
)
modules
=
mlist
# Phase III: write custlib.tex
# Write the boilerplate
# XXX should be fancied up.
print
"""
\
docume
n
tstyle[twoside,11pt,myformat]{report}
\
\
title{Python Library Reference}
\
\
input{boilerplate}
\
\
makeindex % tell
\
\
index to actually write the .idx file
\
\
begin{document}
\
\
pagenumbering{roman}
\
\
maketitle
\
\
input{copyright}
\
\
begin{abstract}
\
\
noindent This is a customized version of the Python Library Reference.
\
\
end{abstract}
\
\
pagebreak
{
\
\
parskip = 0mm
\
\
tableofcontents}
\
\
pagebreak
\
\
pagenumbering{arabic}"""
for
modname
in
mlist
:
print
"
\
\
input{lib%s}"
%
(
modname
,)
# Write the end
print
"""
\
\
input{custlib.ind} % Index
\
\
end{document}"""
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