]> granicus.if.org Git - python/commitdiff
Merged changes from the 1.5.2p2 release.
authorFred Drake <fdrake@acm.org>
Mon, 3 Apr 2000 04:19:14 +0000 (04:19 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 3 Apr 2000 04:19:14 +0000 (04:19 +0000)
Doc/texinputs/boilerplate.tex
Doc/texinputs/ltxmarkup.sty
Doc/texinputs/python.sty
Doc/tools/buildindex.py
Doc/tools/getpagecounts
Doc/tools/mkdvi.sh
Doc/tools/mkhowto
Doc/tools/mkhtml.sh
Doc/tools/mkmodindex
Doc/tools/mksourcepkg
Doc/tools/node2label.pl

index 30bc37cd740630d736100e95716f95821ca6d3f9..b1a07a4e3ef252bd7e13b2f7555ee984ecb9aa9a 100644 (file)
@@ -1,8 +1,8 @@
 \author{Guido van Rossum}
 
 \authoraddress{
-       Corporation for National Research Initiatives (CNRI) \\
-       1895 Preston White Drive, Reston, Va 20191, USA \\
+       Corporation for National Research Initiatives \\
+       1895 Preston White Drive, Reston, VA 20191, USA \\
        E-mail: \email{guido@python.org}
 }
 
index 62ef4f3ca395cc02684c9a48f70a4aaf8252364b..4b769be237e85b1facea174970c2d489b7be799e 100644 (file)
@@ -18,7 +18,7 @@
       \let\op=\py@ltx@optparam%
       \let\p=\py@ltx@param%
       #2}}]
-    %\item[\code{\e end\{{\bfseries #1}\}}]
+    \item[\code{\e end\{{\bfseries #1}\}}]
     \index{#1 environment@\idxcode{#1} environment}
     \index{environments!#1@\idxcode{#1}}
 }{\end{fulllineitems}}
index 76ae86ffedfe180f69fee44c98ca5b3044544ece..3ec42c568ad48f72a23e0cb51822c34957f9f90e 100644 (file)
   \typeout{*** MACRO exmodindex IS OBSOLETE -- USE declaremodule INSTEAD!}}
 
 % Additional string for an index entry
-\newcommand{\index@subitem}{}
-\newcommand{\setindexsubitem}[1]{\renewcommand{\index@subitem}{#1}}
-\newcommand{\ttindex}[1]{\index{#1@{\py@idxcode{#1}} \index@subitem}}
-
+\newif\ifpy@usingsubitem\py@usingsubitemfalse
+\newcommand{\py@indexsubitem}{}
+\newcommand{\setindexsubitem}[1]{\renewcommand{\py@indexsubitem}{ #1}%
+                                 \py@usingsubitemtrue}
+\newcommand{\ttindex}[1]{%
+  \ifpy@usingsubitem
+    \index{#1@{\py@idxcode{#1}}\py@indexsubitem}%
+  \else%
+    \index{#1@{\py@idxcode{#1}}}%
+  \fi%
+}
 \newcommand{\withsubitem}[2]{%
   \begingroup%
-  \def\index@subitem{#1}#2%
+    \ifpy@usingsubitem%
+      \def\index@subitem{#1}#2%
+    \else%
+      \def\index@subitem{#1}#2%
+      \py@usingsubitemfalse%
+    \fi
   \endgroup%
 }
 
 
 
 \newcommand{\py@reset}{
+  \py@usingsubitemfalse
   \py@ProcessModSynopsis
   \renewcommand{\py@thisclass}{}
   \renewcommand{\py@thismodule}{}
 %
 %     \begin{funcdesc}{myfunc}{\optional{parm1\optional{, parm2}}}
 %
+\let\py@badkey=\@undefined
+
 \newcommand{\optional}[1]{%
   {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}}
 
+% This can be used when a function or method accepts an varying number 
+% of arguments, such as by using the *args syntax in the parameter list.
+\newcommand{\py@moreargs}{...}
+
+% This can be used when you don't want to document the parameters to a 
+% function or method, but simply state that it's an alias for
+% something else.
+\newcommand{\py@unspecified}{...}
+
 % C functions ------------------------------------------------------------
-% \begin{cfuncdesc}{type}{name}{arglist}
-\newenvironment{cfuncdesc}[3]{
+% \begin{cfuncdesc}[refcount]{type}{name}{arglist}
+% Note that the [refcount] slot should only be filled in by
+% tools/anno-api.py; it pulls the value from the refcounts database.
+\newenvironment{cfuncdesc}[4][\py@badkey]{
   \begin{fulllineitems}
-    \item[\code{#1 \bfcode{#2}(\py@varvars{#3})}\index{#2@{\py@idxcode{#2()}}}]
+    \item[\code{#2 \bfcode{#3}(\py@varvars{#4})}\index{#3@{\py@idxcode{#3()}}}]
+    \ifx#1\@undefined\else%
+      \emph{Return value: \textbf{#1 reference}.}\\
+    \fi
 }{\end{fulllineitems}}
 
 % C variables ------------------------------------------------------------
 }{\end{fulllineitems}}
 
 % C data types -----------------------------------------------------------
-% \begin{ctypedesc}{typedef name}
-\newenvironment{ctypedesc}[1]{
+% \begin{ctypedesc}[index name]{typedef name}
+\newenvironment{ctypedesc}[2][\py@badkey]{
   \begin{fulllineitems}
-    \item[\bfcode{#1}\ttindex{#1}]
+    \item[\bfcode{#2}%
+    \ifx#1\@undefined%
+      \withsubitem{(C type)}{\ttindex{#2}}%
+    \else%
+      \withsubitem{(C type)}{\ttindex{#1}}%
+    \fi]
+}{\end{fulllineitems}}
+
+% Funky macros -----------------------------------------------------------
+% \begin{csimplemacro}{name}
+% -- "simple" because it has no args; NOT for constant definitions!
+\newenvironment{csimplemacrodesc}[1]{
+  \begin{fulllineitems}
+    \item[\bfcode{#1}\withsubitem{(macro)}{\ttindex{#1}}]
 }{\end{fulllineitems}}
 
 % simple functions (not methods) -----------------------------------------
 \newcommand{\email}[1]{{\small\textsf{#1}}}
 \newcommand{\newsgroup}[1]{{\small\textsf{#1}}}
 
-\newcommand{\py@varvars}[1]{{\def\,{\/{\char`\,}}\var{#1}}}
+%\newcommand{\py@varvars}[1]{{\def\,{\/{\char`\,}}\var{#1}}}
+\newcommand{\py@varvars}[1]{%
+  {\let\unspecified=\py@unspecified%
+   \let\moreargs=\py@moreargs%
+   \def\,{\/{\char`\,}}\var{#1}}}
 % let's see if this breaks anything now; we may be able to simplify...
 \renewcommand{\py@varvars}[1]{\var{#1}}
 
index 81bd311d0307f7afbf427c96bc2d6f4f91b0b0af..245122133b759e107581c6c91cbda5b9a4aaeabc 100755 (executable)
@@ -11,6 +11,8 @@ import sys
 class Node:
     __rmjunk = re.compile("<#\d+#>")
 
+    continuation = 0
+
     def __init__(self, link, str, seqno):
         self.links = [link]
         self.seqno = seqno
@@ -77,7 +79,7 @@ def split_entry(str, which):
     return stuff
 
 
-_rmtt = re.compile(r"(.*)<tt(?: class=[a-z0-9]+)?>(.*)</tt>(.*)$",
+_rmtt = re.compile(r"""(.*)<tt(?: class=['"][a-z0-9]+["'])?>(.*)</tt>(.*)$""",
                    re.IGNORECASE)
 _rmparens = re.compile(r"\(\)")
 
@@ -175,6 +177,22 @@ def split_columns(nodes, columns=1):
             start = i * colheight
             end = start + colheight
             cols.append(nodes[start:end])
+    #
+    # If items continue across columns, make sure they are marked
+    # as continuations so the user knows to look at the previous column.
+    #
+    for i in range(len(cols) - 1):
+        try:
+            prev = cols[i][-1]
+            next = cols[i + 1][0]
+        except IndexError:
+            return cols
+        else:
+            n = min(len(prev.key), len(next.key))
+            for j in range(n):
+                if prev.key[j] != next.key[j]:
+                    break
+                next.continuation = j + 1
     return cols
 
 
@@ -204,8 +222,12 @@ def format_column(nodes):
         for i in range(count, len(current) - 1):
             term = node.text[i]
             level = level + 1
-            append("\n<dt>%s\n<dd>\n%s<dl compact>"
-                   % (term, level * DL_LEVEL_INDENT))
+            if node.continuation > i:
+                extra = " (continued)"
+            else:
+                extra = ""
+            append("\n<dt>%s%s\n<dd>\n%s<dl compact>"
+                   % (term, extra, level * DL_LEVEL_INDENT))
         append("\n%s<dt>%s%s</a>"
                % (level * DL_LEVEL_INDENT, node.links[0], node.text[-1]))
         for link in node.links[1:]:
index ef14053a69f04bda89502c50e9e5685d0ddb75b4..53a28e1453f27e8674f3143714f97f4179ed051f 100755 (executable)
@@ -43,13 +43,26 @@ class PageCounter:
     PREFIX = """\
 This is the PostScript version of the standard Python documentation.
 If you plan to print this, be aware that some of the documents are
-long.  The following manuals are included:
+long.  It is formatted for printing on two-sided paper; if you do plan
+to print this, *please* print two-sided if you have a printer capable
+of it!  To locate published copies of the larger manuals, or other
+Python reference material, consult the PSA Online Bookstore at:
+
+             http://www.python.org/psa/bookstore/
+
+The following manuals are included:
 """
     SUFFIX = """\
 
 
 If you have any questions, comments, or suggestions regarding these
 documents, please send them via email to python-docs@python.org.
+
+If you would like to support the development and maintenance of
+documentation for Python, please consider joining the Python Software
+Activity (PSA; see http://www.python.org/psa/), or urging your
+organization to join the PSA or the Python Consortium (see
+http://www.python.org/consortium/).
 """
 
 def count_pages(filename):
index 3269a287ee070ec01d3c67cac4604b7856c82acb..880192d1c3fa4a5fb7c72f6ba91d4a32089e86d1 100755 (executable)
@@ -34,7 +34,7 @@ fi
 
 part=$1; shift 1
 
-TEXINPUTS=$srcdir/$part:$TEXINPUTS
+TEXINPUTS=.:$srcdir/$part:$TEXINPUTS
 export TEXINPUTS
 
 echo $srcdir'/tools/newind.py >'$part'.ind'
index 621aa8e5ecba27898dd444fb2c4a6563359110a9..043ac57f46d712c8836c56c5a5d467d20da23522 100755 (executable)
@@ -330,6 +330,8 @@ class Job:
         if texfile[:2] == os.curdir + os.sep:
             texfile = texfile[2:]
         # build the command line and run LaTeX2HTML:
+        if not os.path.isdir(builddir):
+            os.mkdir(builddir)
         args = [LATEX2HTML_BINARY,
                 "-init_file", L2H_INIT_FILE,
                 "-init_file", self.l2h_aux_init_file,
index 85a66b780b8b66b1d53fca1145f56231344cc594..304839c60ad2f482b1527d500d3f3a84ff2855b8 100755 (executable)
@@ -27,12 +27,16 @@ export TEXINPUTS
 
 if [ -d $part ] ; then
     rm -f $part/*.html
+else
+    mkdir $part
 fi
 
 echo "latex2html -init_file $srcdir/perl/l2hinit.perl -dir $part" \
  "${1:+$@} $srcdir/$part/$part.tex"
 latex2html \
  -no_auto_link \
+ -up_url '../index.html' \
+ -up_title 'Documentation Index' \
  -init_file $srcdir/perl/l2hinit.perl \
  -address '<hr>See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.' \
  -dir $part \
index 4400cea5719a426ec78143daf5f79d24e5482e07..14568d129ea1b42417f0fc910103dfbce91ad5a0 100755 (executable)
@@ -47,8 +47,9 @@ def error(msg, rc=2):
 
 
 _rx = re.compile(
-    '<dt><a href="(module-.*\.html)">'
-    '([a-zA-Z_][a-zA-Z0-9_.]*(\s*<em>\(.*\)</em>)?)</a>')
+    "<dt><a href='(module-.*\.html)#l2h-\d+'><tt class='module'>"
+    "([a-zA-Z_][a-zA-Z0-9_.]*</tt>(\s*<em>"
+    "\(<span class='platform'>.*</span>\)</em>)?)</a>")
 
 def main():
     outputfile = "-"
index 00c6c50e0c87e0f2345dc18a52d74cc01f46cbd5..260ae6d33bed9980ea712d1763d0aef78630033c 100755 (executable)
@@ -105,7 +105,9 @@ def main():
                run("tar cf - Python-%s | gzip -9 >%s.tgz"
                    % (release, archive))
           elif format == "zip":
-               run("zip -r9 %s.zip Python-%s"
+               if os.path.exists(archive + ".zip"):
+                    os.unlink(archive + ".zip")
+               run("zip -q -r9 %s.zip Python-%s"
                    % (archive, release))
 
      # clean up the work area:
index a59d68ed59916d2499f9081ef4779d1bf5294cdc..f8bc1a68e6bf2f51764a05b696e358436a2324c8 100755 (executable)
@@ -32,16 +32,16 @@ foreach $label (keys %internal_labels) {
 while (<>) {
   # don't want to do one s/// per line per node
   # so look for lines with hrefs, then do s/// on nodes present
-  if (/(HREF|href)=\"([^\#\"]*)html[\#\"]/) {
-    @parts = split(/(HREF|href)\=\"/);
+  if (/(HREF|href)=[\"\']([^\#\"\']*)html[\#\"\']/) {
+    @parts = split(/(HREF|href)\=[\"\']/);
     shift @parts;
     for $node (@parts) {
-      $node =~ s/[\#\"].*$//g;
+      $node =~ s/[\#\"\'].*$//g;
       chop($node);
       if (defined($nodes{$node})) {
        $label = $nodes{$node};
-       if (s/(HREF|href)=\"$node([\#\"])/$1=\"$label.html$2/g) {
-         s/(HREF|href)=\"$label.html#(l2h-)?SECTION\d+/$1=\"$label.html/g;
+       if (s/(HREF|href)=([\"\'])$node([\#\"\'])/href=$2$label.html$3/g) {
+         s/(HREF|href)=([\"\'])$label.html/href=$2$label.html/g;
          $newnames{$node} = "$label.html";
        }
       }