Incorporated Jan-Hein's changes and texinfo conversion.

This commit is contained in:
Guido van Rossum 1992-12-08 14:37:55 +00:00
parent 2a7178efe1
commit 95cd2ef162
17 changed files with 4681 additions and 19 deletions

View File

@ -20,6 +20,7 @@ ref:
lib:
touch lib.ind
latex lib
./fix_hack lib.idx
makeindex lib
latex lib
dvips lib >lib.ps
@ -31,10 +32,15 @@ qua:
latex qua
dvips lib >lib.ps
libinfo:
@echo This may take a while...
python -c 'import partparse; partparse.main()' lib[1-5].tex
sh fix.sh
clean:
rm -f @* *~ *.aux *.idx *.ilg *.ind *.log *.toc *.blg *.bbl
# Sources: .tex, .bib, .sty
# Useful results: .dvi, .ps
clobber: clean
rm -f *.dvi *.ps
rm -f *.dvi *.ps *.info *.info-[0-9]*

View File

@ -8,7 +8,7 @@ The following are the LaTeX source files:
tut.tex The tutorial
lib.tex, lib[1-5].tex The library reference
ref.tex The reference manual
ref.tex, ref[1-8].tex The reference manual
qua.tex, quabib.bib Article published in CWI Quarterly
All except qua.tex use the style option file "myformat.sty". This
@ -35,3 +35,53 @@ local conventions; at my site, I use dvips and lpr. For example:
If you don't have latex, you can ftp the pre-formatted PosytScript
versions of the documents; see "../misc/FTP" for information about
ftp-ing Python files.
Making the INFO version of the Library Reference
------------------------------------------------
The Library Reference can now also be read in hypertext form using the
Emacs INFO system. This uses Texinfo format as an intermediate step.
It requires texinfo version 2 (we have used 2.14).
To build the info files (python-lib.info*), say "make libinfo". This
takes a while, even on machines with 33 MIPS and 16 Mbytes :-) You can
ignore the output.
But first you'll have to change a site dependency in fix.el: if
texinfo 2.xx is installed by default at your site, comment out the two
lines starting with "(setq load-path"; if it isn't, change the path!
(I'm afraid that if you don't have texinfo 2.xx this won't work -- use
archie to locate a version and ftp to fetch it.)
The files used by the conversion process are:
partparse.py the dirty-written Python script that converts
LaTeX sources to texi files. Output is left in
`@out.texi'
texi{pre,post}.dat these files will be put before and after the
result
fix.sh calls emacs in order to update all the nodes and
menus. After this, makeinfo will convert the
texinfo-source to the info-file(s). Assumption:
the texi-source is called `@out.texi'
fix.el the elisp-file executed by emacs. Two calls to
'texinfo-all-menus-update are necessary in
some cases
fix_hack executable shell script that fixes the results
of the underscore hack. {\ptt \char'137} is
back-translated to a simple underscore. This is
needed for the texindex program
handy.el some handy Emacs-macro's that helped converting
``old'' documentation to a format that could be
understood by the converter scipt (partparse.py).
(You don't really need this, but, as the name
says, these macros are "handy")
A Million thanks for Jan-Hein B\"uhrman for writing and debugging the
convertor and related scripts, and for fixing the LaTeX sources and
writing new macros for myformat.sty!

6
Doc/fix.el Normal file
View File

@ -0,0 +1,6 @@
; load the new texinfo package (2.xx) if not installed by default
(setq load-path
(cons "/ufs/jh/lib/emacs/texinfo" load-path))
(find-file "@out.texi")
(texinfo-all-menus-update t)
(texinfo-all-menus-update t)

1
Doc/fix_hack Executable file
View File

@ -0,0 +1 @@
sed -e 's/{\\ptt[ ]*\\char[ ]*'"'"'137}/_/g' <"$1" > "@$1" && mv "@$1" $1

23
Doc/info/texipost.dat Normal file
View File

@ -0,0 +1,23 @@
@node Function Index, , ,
@unnumbered Function Index
@printindex fn
@node Variable Index, , ,
@unnumbered Variable Index
@printindex vr
@node Module Index, , ,
@unnumbered Module Index
@printindex pg
@node Concept Index, , ,
@unnumbered Concept Index
@printindex cp
@summarycontents
@contents
@bye

93
Doc/info/texipre.dat Normal file
View File

@ -0,0 +1,93 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename python-lib.info
@settitle Python library reference
@setchapternewpage odd
@footnotestyle end
@c %**end of header
@ifinfo
This file describes the built-in types, exceptions and functions and the
standard modules that come with the Python system. It assumes basic
knowledge about the Python language. For an informal introduction to
the language, see the Python Tutorial. The Python Reference Manual
gives a more formal definition of the language. (These manuals are not
yet available in INFO or Texinfo format.)
Copyright (C) 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam,
The Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@end ifinfo
@titlepage
@title Python library reference
@author Guido van Rossum
@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1991, 1992 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
@center All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@end titlepage
@node Top, Overview, (dir), (dir)
@top The Python library
@ifinfo
This file describes the built-in types, exceptions and functions and the
standard modules that come with the Python system. It assumes basic
knowledge about the Python language. For an informal introduction to
the language, see the @cite{Python Tutorial}. The @cite{Python
Reference Manual} gives a more formal definition of the language.
(These manuals are not yet available in INFO or Texinfo format.)
This version corresponds roughly to Python version 0.9.8 (yet to be
released).
@strong{Warning:} we have just finished converting the original LaTeX
manual into Texinfo. This is a difficult process and it is quite
possible that errors have been introduced in the conversion. Please
report any errors you find by e-mail to the author,
@t{Guido.van.Rossum@@cwi.nl}.
@end ifinfo
@c placeholder for the master menu -- patched by texinfo-all-menus-update
@menu
@end menu

View File

@ -1,4 +1,5 @@
\documentstyle[twoside,11pt,myformat]{report}
%\includeonly{lib5}
\title{\bf
Python Library Reference
@ -15,7 +16,8 @@
\makeindex
\begin{document}
%\showthe\fam
%\showthe\ttfam
\pagenumbering{roman}
\maketitle
@ -42,7 +44,6 @@ language.
\pagebreak
\pagenumbering{arabic}
\include{lib1} % intro; built-in types, functions and exceptions
\include{lib2} % built-in modules
\include{lib3} % standard modules

View File

@ -1,4 +1,5 @@
\documentstyle[twoside,11pt,myformat]{report}
%\includeonly{lib5}
\title{\bf
Python Library Reference
@ -15,7 +16,8 @@
\makeindex
\begin{document}
%\showthe\fam
%\showthe\ttfam
\pagenumbering{roman}
\maketitle
@ -42,7 +44,6 @@ language.
\pagebreak
\pagenumbering{arabic}
\include{lib1} % intro; built-in types, functions and exceptions
\include{lib2} % built-in modules
\include{lib3} % standard modules

View File

@ -13,7 +13,7 @@
\parskip = 2mm
% Frequently used system name
\newcommand{\UNIX}{U{\sc nix}}
%\newcommand{\UNIX}{U{\sc nix}}
% Variable used by begin code command
\newlength{\codewidth}
@ -40,7 +40,9 @@
% Underscores are not magic throughout the Python documentation.
% This still only gives the right effect in the tt font!!!
\catcode`_=12
\def\_{\ifnum\fam=\ttfam \char'137\else{\tt\char'137}\fi}
\catcode`\_=12
\catcode`\_=\active\def_{\ifnum\fam=\ttfam \char'137 \else{\tt\char'137}\fi}
% Define \itembreak: force the text after an item to start on a new line
\newcommand{\itembreak}{
@ -94,22 +96,104 @@
}
% Define \funcitem{func}{args}: define a function item
\newcommand{\funcitem}[2]{
\ttindex{#1}
\item[{\tt #1(#2)}]
\newcommand{\funcitem}[2]{%
\ttindex{#1}%
%\item[{\tt #1(#2)}]
\item[\code{#1(\varvars{#2})}]
\
}
% from user-level, fulllineitems should be called as an environment
\def\fulllineitems{\list{}{\labelwidth \leftmargin \labelsep 0pt
\rightmargin 0pt \topsep -\parskip \partopsep \parskip
\itemsep -\parsep
\let\makelabel\itemnewline}}
\let\endfulllineitems\endlist
% funcdesc should be called as an \begin{funcdesc} ... \end{funcdesc}
\newcommand{\funcline}[2]{\item[\code{#1(\varvars{#2})}]\ttindex{#1}}
\newcommand{\funcdesc}[2]{\fulllineitems\funcline{#1}{#2}}
\let\endfuncdesc\endfulllineitems
% same for excdesc
\newcommand{\excline}[1]{\item[\code{#1}]\ttindex{#1}}
\newcommand{\excdesc}[1]{\fulllineitems\excline{#1}}
\let\endexcdesc\endfulllineitems
% same for datadesc
\newcommand{\dataline}[1]{\item[\code{#1}]\ttindex{#1}}
\newcommand{\datadesc}[1]{\fulllineitems\dataline{#1}}
\let\enddatadesc\endfulllineitems
% Define \dataitem{name}: define a data item
\newcommand{\dataitem}[1]{
\ttindex{#1}
\newcommand{\dataitem}[1]{%
\ttindex{#1}%
\item[{\tt #1}]
\
}
% Define \excitem{name}: define an exception item
\newcommand{\excitem}[1]{
\ttindex{#1}
\newcommand{\excitem}[1]{%
\ttindex{#1}%
\item[{\tt #1}]
\itembreak
}
\let\nodename=\label
\newcommand{\ABC}{{\sc abc}}
\newcommand{\UNIX}{{\sc Unix}}
\newcommand{\ASCII}{{\sc ascii}}
%\newcommand{\C}{{\bf C}}
\newcommand{\C}{C}
\newcommand{\EOF}{{\sc eof}}
% code is the most difficult one...
%\frenchspacing removed, because \section, etc., can't handle it
\newcommand{\code}[1]{{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}%
\mbox{\tt #1}}}
%This one does not work
%%%% myspecials, same as dospecials, but without {, } and \
%%%\def\myspecials{\do\ \do\$\do\&%
%%% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
%%%\newcommand{\code}[1]{\begingroup \catcode``=13 \@noligs
%%%\tt \let\do\@makeother \myspecials
%%%#1\endgroup}
\newcommand{\kbd}[1]{\mbox{\tt #1}}
\newcommand{\key}[1]{\mbox{\tt #1}}
\newcommand{\samp}[1]{\mbox{`\code{#1}'}}
\newcommand{\var}[1]{\mbox{\it#1\/}}
\let\file=\samp
\newcommand{\dfn}[1]{{\sl #1\/}}
\newcommand{\emph}[1]{{\em #1\/}}
\newcommand{\strong}[1]{{\bf #1}}
%\newcommand{\varvars}[1]{{\catcode`\,=\active\def,{\tt\char`\,\/tt}\var{#1}}}
%\newcommand{\varvars}[1]{{\def\,{\/{\tt\char`\,}}\var{#1}}}
\newcommand{\varvars}[1]{{\def\,{\/{\tt\char`\,}}\def\({\/{\tt\char`\(}}\def\){\/{\tt\char`\)}}\var{#1}}}
\newif\iftexi\texifalse
%not supported yet%\newif\iflatex\latextrue
\newenvironment{tableiii}[5]{\begin{center}\def\lineiii##1##2##3{\csname#2\endcsname{##1}&##2&##3\\}\begin{tabular}{#1}\hline#3&#4&#5\\
\hline}{\hline\end{tabular}\end{center}}
\newcommand{\itemnewline}[1]{\@tempdima\linewidth
\advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}}
\newcommand{\sectcode}[1]{{\tt #1}}
%%%
%%%\let\orgchapter\chapter
%%%\def\chapter#1{{\let\code\sectcode\orgchapter{#1}}}
%%%\let\orgsection\section
%%%\def\section#1{{\let\code\sectcode\orgsection{#1}}}
%%%\let\orgsubsection\subsection
%%%\def\subsection#1{{\let\code\sectcode\orgsubsection{#1}}}
%%%\let\orgsubsubsection\subsubsection
%%%\def\subsubsection#1{{\let\code\sectcode\orgsubsubsection{#1}}}
%%%\let\orgsubsubsubsection\subsubsubsection
%%%\def\subsubsubsection#1{{\let\code\sectcode\orgsubsubsubsection{#1}}}

2137
Doc/partparse.py Normal file

File diff suppressed because it is too large Load Diff

23
Doc/texipost.dat Normal file
View File

@ -0,0 +1,23 @@
@node Function Index, , ,
@unnumbered Function Index
@printindex fn
@node Variable Index, , ,
@unnumbered Variable Index
@printindex vr
@node Module Index, , ,
@unnumbered Module Index
@printindex pg
@node Concept Index, , ,
@unnumbered Concept Index
@printindex cp
@summarycontents
@contents
@bye

93
Doc/texipre.dat Normal file
View File

@ -0,0 +1,93 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename python-lib.info
@settitle Python library reference
@setchapternewpage odd
@footnotestyle end
@c %**end of header
@ifinfo
This file describes the built-in types, exceptions and functions and the
standard modules that come with the Python system. It assumes basic
knowledge about the Python language. For an informal introduction to
the language, see the Python Tutorial. The Python Reference Manual
gives a more formal definition of the language. (These manuals are not
yet available in INFO or Texinfo format.)
Copyright (C) 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam,
The Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@end ifinfo
@titlepage
@title Python library reference
@author Guido van Rossum
@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1991, 1992 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
@center All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@end titlepage
@node Top, Overview, (dir), (dir)
@top The Python library
@ifinfo
This file describes the built-in types, exceptions and functions and the
standard modules that come with the Python system. It assumes basic
knowledge about the Python language. For an informal introduction to
the language, see the @cite{Python Tutorial}. The @cite{Python
Reference Manual} gives a more formal definition of the language.
(These manuals are not yet available in INFO or Texinfo format.)
This version corresponds roughly to Python version 0.9.8 (yet to be
released).
@strong{Warning:} we have just finished converting the original LaTeX
manual into Texinfo. This is a difficult process and it is quite
possible that errors have been introduced in the conversion. Please
report any errors you find by e-mail to the author,
@t{Guido.van.Rossum@@cwi.nl}.
@end ifinfo
@c placeholder for the master menu -- patched by texinfo-all-menus-update
@menu
@end menu

6
Doc/tools/fix.el Normal file
View File

@ -0,0 +1,6 @@
; load the new texinfo package (2.xx) if not installed by default
(setq load-path
(cons "/ufs/jh/lib/emacs/texinfo" load-path))
(find-file "@out.texi")
(texinfo-all-menus-update t)
(texinfo-all-menus-update t)

1
Doc/tools/fix_hack Executable file
View File

@ -0,0 +1 @@
sed -e 's/{\\ptt[ ]*\\char[ ]*'"'"'137}/_/g' <"$1" > "@$1" && mv "@$1" $1

2137
Doc/tools/partparse.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2527,8 +2527,8 @@ left-to-right. Thus, if an attribute is not found in
(recursively) in the base classes of \verb\Base1\, and only if it is
not found there, it is searched in \verb\Base2\, and so on.
(To some people breadth first --- searching \verb\Base2\ and
\verb\Base3\ before the base classes of \verb\Base1\ --- looks more
(To some people breadth first---searching \verb\Base2\ and
\verb\Base3\ before the base classes of \verb\Base1\---looks more
natural. However, this would require you to know whether a particular
attribute of \verb\Base1\ is actually defined in \verb\Base1\ or in
one of its base classes before you can figure out the consequences of

View File

@ -2527,8 +2527,8 @@ left-to-right. Thus, if an attribute is not found in
(recursively) in the base classes of \verb\Base1\, and only if it is
not found there, it is searched in \verb\Base2\, and so on.
(To some people breadth first --- searching \verb\Base2\ and
\verb\Base3\ before the base classes of \verb\Base1\ --- looks more
(To some people breadth first---searching \verb\Base2\ and
\verb\Base3\ before the base classes of \verb\Base1\---looks more
natural. However, this would require you to know whether a particular
attribute of \verb\Base1\ is actually defined in \verb\Base1\ or in
one of its base classes before you can figure out the consequences of