]> granicus.if.org Git - python/commitdiff
Remove all \bcode / \ecode cruft; this is no longer needed. See previous
authorFred Drake <fdrake@acm.org>
Fri, 13 Feb 1998 06:58:54 +0000 (06:58 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 13 Feb 1998 06:58:54 +0000 (06:58 +0000)
checkin of myformat.sty.

Change "\renewcommand{\indexsubitem}{(...)}" to "\setindexsubitem{(...)}"
everywhere.

Some other minor nits that I happened to come across.

241 files changed:
Doc/lib/libaifc.tex
Doc/lib/libal.tex
Doc/lib/libamoeba.tex
Doc/lib/libanydbm.tex
Doc/lib/libarray.tex
Doc/lib/libaudioop.tex
Doc/lib/libbase64.tex
Doc/lib/libbasehttp.tex
Doc/lib/libbastion.tex
Doc/lib/libbinascii.tex
Doc/lib/libcd.tex
Doc/lib/libcgi.tex
Doc/lib/libcmath.tex
Doc/lib/libcode.tex
Doc/lib/libcommands.tex
Doc/lib/libcopy.tex
Doc/lib/libcopyreg.tex
Doc/lib/libcrypt.tex
Doc/lib/libdbm.tex
Doc/lib/libdis.tex
Doc/lib/liberrno.tex
Doc/lib/libexcs.tex
Doc/lib/libfcntl.tex
Doc/lib/libfl.tex
Doc/lib/libfm.tex
Doc/lib/libfnmatch.tex
Doc/lib/libformatter.tex
Doc/lib/libftplib.tex
Doc/lib/libfuncs.tex
Doc/lib/libgdbm.tex
Doc/lib/libgetopt.tex
Doc/lib/libgl.tex
Doc/lib/libglob.tex
Doc/lib/libgopherlib.tex
Doc/lib/libgrp.tex
Doc/lib/libgzip.tex
Doc/lib/libhtmllib.tex
Doc/lib/libhttplib.tex
Doc/lib/libimageop.tex
Doc/lib/libimgfile.tex
Doc/lib/libimghdr.tex
Doc/lib/libimp.tex
Doc/lib/libjpeg.tex
Doc/lib/liblocale.tex
Doc/lib/libmailbox.tex
Doc/lib/libmailcap.tex
Doc/lib/libmarshal.tex
Doc/lib/libmath.tex
Doc/lib/libmd5.tex
Doc/lib/libmimetools.tex
Doc/lib/libmimify.tex
Doc/lib/libmpz.tex
Doc/lib/libni.tex
Doc/lib/libnntplib.tex
Doc/lib/liboperator.tex
Doc/lib/libos.tex
Doc/lib/libpanel.tex
Doc/lib/libparser.tex
Doc/lib/libpdb.tex
Doc/lib/libpickle.tex
Doc/lib/libposix.tex
Doc/lib/libposixfile.tex
Doc/lib/libppath.tex
Doc/lib/libpprint.tex
Doc/lib/libprofile.tex
Doc/lib/libpwd.tex
Doc/lib/libqueue.tex
Doc/lib/libquopri.tex
Doc/lib/librand.tex
Doc/lib/librandom.tex
Doc/lib/libre.tex
Doc/lib/libregex.tex
Doc/lib/libregsub.tex
Doc/lib/libresource.tex
Doc/lib/librexec.tex
Doc/lib/librfc822.tex
Doc/lib/librgbimg.tex
Doc/lib/librotor.tex
Doc/lib/libselect.tex
Doc/lib/libsgmllib.tex
Doc/lib/libshelve.tex
Doc/lib/libsignal.tex
Doc/lib/libsite.tex
Doc/lib/libsocket.tex
Doc/lib/libsocksvr.tex
Doc/lib/libsoundex.tex
Doc/lib/libstat.tex
Doc/lib/libstdwin.tex
Doc/lib/libstring.tex
Doc/lib/libstruct.tex
Doc/lib/libsun.tex
Doc/lib/libsys.tex
Doc/lib/libsyslog.tex
Doc/lib/libtempfile.tex
Doc/lib/libtemplate.tex
Doc/lib/libtermios.tex
Doc/lib/libthread.tex
Doc/lib/libtime.tex
Doc/lib/libtraceback.tex
Doc/lib/libtypes.tex
Doc/lib/libtypes2.tex
Doc/lib/liburllib.tex
Doc/lib/liburlparse.tex
Doc/lib/libuser.tex
Doc/lib/libuserdict.tex
Doc/lib/libwhichdb.tex
Doc/lib/libwhrandom.tex
Doc/lib/libxdrlib.tex
Doc/lib/libxmllib.tex
Doc/lib/libzlib.tex
Doc/libaifc.tex
Doc/libal.tex
Doc/libamoeba.tex
Doc/libanydbm.tex
Doc/libarray.tex
Doc/libaudioop.tex
Doc/libbase64.tex
Doc/libbasehttp.tex
Doc/libbastion.tex
Doc/libbinascii.tex
Doc/libcd.tex
Doc/libcgi.tex
Doc/libcmath.tex
Doc/libcode.tex
Doc/libcommands.tex
Doc/libcopy.tex
Doc/libcopyreg.tex
Doc/libcrypt.tex
Doc/libctb.tex
Doc/libdbm.tex
Doc/libdis.tex
Doc/liberrno.tex
Doc/libexcs.tex
Doc/libfcntl.tex
Doc/libfl.tex
Doc/libfm.tex
Doc/libfnmatch.tex
Doc/libformatter.tex
Doc/libftplib.tex
Doc/libfuncs.tex
Doc/libgdbm.tex
Doc/libgetopt.tex
Doc/libgl.tex
Doc/libglob.tex
Doc/libgopherlib.tex
Doc/libgrp.tex
Doc/libgzip.tex
Doc/libhtmllib.tex
Doc/libhttplib.tex
Doc/libimageop.tex
Doc/libimgfile.tex
Doc/libimghdr.tex
Doc/libimp.tex
Doc/libjpeg.tex
Doc/liblocale.tex
Doc/libmacconsole.tex
Doc/libmacdnr.tex
Doc/libmacfs.tex
Doc/libmacic.tex
Doc/libmacos.tex
Doc/libmacostools.tex
Doc/libmacspeech.tex
Doc/libmactcp.tex
Doc/libmacui.tex
Doc/libmailbox.tex
Doc/libmailcap.tex
Doc/libmarshal.tex
Doc/libmath.tex
Doc/libmd5.tex
Doc/libmimetools.tex
Doc/libmimify.tex
Doc/libmpz.tex
Doc/libni.tex
Doc/libnntplib.tex
Doc/liboperator.tex
Doc/libos.tex
Doc/libpanel.tex
Doc/libparser.tex
Doc/libpdb.tex
Doc/libpickle.tex
Doc/libposix.tex
Doc/libposixfile.tex
Doc/libppath.tex
Doc/libpprint.tex
Doc/libprofile.tex
Doc/libpwd.tex
Doc/libqueue.tex
Doc/libquopri.tex
Doc/librand.tex
Doc/librandom.tex
Doc/libre.tex
Doc/libregex.tex
Doc/libregsub.tex
Doc/libresource.tex
Doc/librexec.tex
Doc/librfc822.tex
Doc/librgbimg.tex
Doc/librotor.tex
Doc/libselect.tex
Doc/libsgmllib.tex
Doc/libshelve.tex
Doc/libsignal.tex
Doc/libsite.tex
Doc/libsocket.tex
Doc/libsocksvr.tex
Doc/libsoundex.tex
Doc/libstat.tex
Doc/libstdwin.tex
Doc/libstring.tex
Doc/libstruct.tex
Doc/libsun.tex
Doc/libsys.tex
Doc/libsyslog.tex
Doc/libtempfile.tex
Doc/libtemplate.tex
Doc/libtermios.tex
Doc/libthread.tex
Doc/libtime.tex
Doc/libtraceback.tex
Doc/libtypes.tex
Doc/libtypes2.tex
Doc/liburllib.tex
Doc/liburlparse.tex
Doc/libuser.tex
Doc/libuserdict.tex
Doc/libwhichdb.tex
Doc/libwhrandom.tex
Doc/libxdrlib.tex
Doc/libxmllib.tex
Doc/libzlib.tex
Doc/mac/libctb.tex
Doc/mac/libmacconsole.tex
Doc/mac/libmacdnr.tex
Doc/mac/libmacfs.tex
Doc/mac/libmacic.tex
Doc/mac/libmacos.tex
Doc/mac/libmacostools.tex
Doc/mac/libmacspeech.tex
Doc/mac/libmactcp.tex
Doc/mac/libmacui.tex
Doc/templates/module.tex

index 590f0d42eb8109844f0913902f0073efdfa4c2a8..19af8f36ece8de5ed77baec9d4581aacf5f2049f 100644 (file)
@@ -23,7 +23,7 @@ second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
 
 Module \code{aifc} defines the following function:
 
-\renewcommand{\indexsubitem}{(in module aifc)}
+\setindexsubitem{(in module aifc)}
 \begin{funcdesc}{open}{file\, mode}
 Open an AIFF or AIFF-C file and return an object instance with
 methods that are described below.  The argument file is either a
@@ -38,7 +38,7 @@ samples you are going to write in total and use
 Objects returned by \code{aifc.open()} when a file is opened for
 reading have the following methods:
 
-\renewcommand{\indexsubitem}{(aifc object method)}
+\setindexsubitem{(aifc object method)}
 \begin{funcdesc}{getnchannels}{}
 Return the number of audio channels (1 for mono, 2 for stereo).
 \end{funcdesc}
index 5655be66a946b95a60ca484fc563b39710ffbf6e..63bdf1b888ac1b30b18a5b71124210dffeef6c63 100644 (file)
@@ -25,7 +25,7 @@ documented upper limit.)
 
 The module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module al)}
+\setindexsubitem{(in module al)}
 
 \begin{funcdesc}{openport}{name\, direction\optional{\, config}}
 The name and direction arguments are strings.  The optional config
@@ -59,7 +59,7 @@ as returned by \code{al.queryparams}.
 Configuration objects (returned by \code{al.newconfig()} have the
 following methods:
 
-\renewcommand{\indexsubitem}{(audio configuration object method)}
+\setindexsubitem{(audio configuration object method)}
 
 \begin{funcdesc}{getqueuesize}{}
 Return the queue size.
@@ -106,7 +106,7 @@ Set the maximum value for floating sample formats.
 Port objects (returned by \code{al.openport()} have the following
 methods:
 
-\renewcommand{\indexsubitem}{(audio port object method)}
+\setindexsubitem{(audio port object method)}
 
 \begin{funcdesc}{closeport}{}
 Close the port.
@@ -167,7 +167,7 @@ the C header file \file{<audio.h>} except that the name prefix
 \samp{AL_} is omitted.  Read the module source for a complete list of
 the defined names.  Suggested use:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import al
 from AL import *
-\end{verbatim}\ecode
+\end{verbatim}
index 747c5f3e671fde727b37e9ae1d6bcca4c5a1fa92..10059eeacccb11351aa0ed5e805b74f1f42f45a6 100644 (file)
@@ -10,7 +10,7 @@ the exception \code{amoeba.error = 'amoeba.error'}.
 
 The module \code{amoeba} defines the following items:
 
-\renewcommand{\indexsubitem}{(in module amoeba)}
+\setindexsubitem{(in module amoeba)}
 \begin{funcdesc}{name_append}{path\, cap}
 Stores a capability in the Amoeba directory tree.
 Arguments are the pathname (a string) and the capability (a capability
@@ -77,15 +77,15 @@ and
 \emph{a2c}(U).
 For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> amoeba.name_lookup('/profile/cap')
 aa:1c:95:52:6a:fa/14(ff)/8e:ba:5b:8:11:1a
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The following methods are defined for capability objects.
 
-\renewcommand{\indexsubitem}{(capability method)}
+\setindexsubitem{(capability method)}
 \begin{funcdesc}{dir_list}{}
 Returns a list of the names of the entries in an Amoeba directory.
 \end{funcdesc}
index b55b6715a2cf4b769502697e93179a94648f5e34..722d395d1568493f704f403d5b253f6198ff0066 100644 (file)
@@ -9,7 +9,7 @@ will be used.   Both modules provide the same interface:
 
 % not the best solution, but it's what you get for documenting both
 % at the same time.
-\renewcommand{\indexsubitem}{(in modules anydbm, dumbdbm)}
+\setindexsubitem{(in modules anydbm, dumbdbm)}
 
 \begin{funcdesc}{open}{filename\optional{\, flag\, mode}}
 Open the database file \var{filename} and return a corresponding object.  
index 8490fc8e00d20c137a42bb8077ee9879fbaaea53..7ba3954a31f672d68fb21bc8686bd5a9aded55ed 100644 (file)
@@ -36,7 +36,7 @@ See also built-in module \code{struct}.
 
 The module defines the following function:
 
-\renewcommand{\indexsubitem}{(in module array)}
+\setindexsubitem{(in module array)}
 
 \begin{funcdesc}{array}{typecode\optional{\, initializer}}
 Return a new array whose items are restricted by \var{typecode}, and
@@ -124,9 +124,9 @@ numbers.  The string is guaranteed to be able to be converted back to
 an array with the same type and value using reverse quotes
 (\code{``}).  Examples:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 array('l')
 array('c', 'hello world')
 array('l', [1, 2, 3, 4, 5])
 array('d', [1.0, 2.0, 3.14])
-\end{verbatim}\ecode
+\end{verbatim}
index b7001554b76a9aaa3d57bf862d6189a0b8e85224..69a3a83de867796ffedd6f8f554dbb339a981595 100644 (file)
@@ -13,7 +13,7 @@ otherwise the sample size (in bytes) is always a parameter of the operation.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module audioop)}
+\setindexsubitem{(in module audioop)}
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unknown number of bytes
 per sample, etc.
@@ -201,7 +201,7 @@ distinction between mono and stereo fragments, i.e.\ all samples are
 treated equal.  If this is a problem the stereo fragment should be split
 into two mono fragments first and recombined later.  Here is an example
 of how to do that:
-\bcode\begin{verbatim}
+\begin{verbatim}
 def mul_stereo(sample, width, lfactor, rfactor):
     lsample = audioop.tomono(sample, width, 1, 0)
     rsample = audioop.tomono(sample, width, 0, 1)
@@ -210,7 +210,7 @@ def mul_stereo(sample, width, lfactor, rfactor):
     lsample = audioop.tostereo(lsample, width, 1, 0)
     rsample = audioop.tostereo(rsample, width, 0, 1)
     return audioop.add(lsample, rsample, width)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If you use the ADPCM coder to build network packets and you want your
 protocol to be stateless (i.e.\ to be able to tolerate packet loss)
@@ -231,7 +231,7 @@ They are primarily meant to do echo cancellation.  A reasonably
 fast way to do this is to pick the most energetic piece of the output
 sample, locate that in the input sample and subtract the whole output
 sample from the input sample:
-\bcode\begin{verbatim}
+\begin{verbatim}
 def echocancel(outputdata, inputdata):
     pos = audioop.findmax(outputdata, 800)    # one tenth second
     out_test = outputdata[pos*2:]
@@ -244,4 +244,4 @@ def echocancel(outputdata, inputdata):
     postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata))
     outputdata = prefill + audioop.mul(outputdata,2,-factor) + postfill
     return audioop.add(inputdata, outputdata, 2)
-\end{verbatim}\ecode
+\end{verbatim}
index 831287b1931a796fcfbb7e77988104827ae4a8eb..f196451f9390889954c323f798359235ed984162 100644 (file)
@@ -12,7 +12,7 @@ output produced by the \file{uuencode} program.  For example, the
 string \code{'www.python.org'} is encoded as the string
 \code{'d3d3LnB5dGhvbi5vcmc=\e n'}.  
 
-\renewcommand{\indexsubitem}{(in module base64)}
+\setindexsubitem{(in module base64)}
 
 \begin{funcdesc}{decode}{input, output}
 Decode the contents of the \var{input} file and write the resulting
index 1f7b6da291cc8f4d7b59abae6bc4f024a6547ddb..c28b0b850a50d0b087da9ed6cbcc6ae1221795ad 100644 (file)
@@ -7,7 +7,7 @@
 \index{URL}
 \index{httpd}
 
-\renewcommand{\indexsubitem}{(in module BaseHTTPServer)}
+\setindexsubitem{(in module BaseHTTPServer)}
 
 This module defines two classes for implementing HTTP servers
 (web servers). Usually, this module isn't used directly, but is used
@@ -21,13 +21,13 @@ subclass. It creates and listens at the web socket, dispatching the
 requests to a handler. Code to create and run the server looks like
 this:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def run(server_class=BaseHTTPServer.HTTPServer,
         handler_class=BaseHTTPServer.BaseHTTPRequestHandler):
   server_address = ('', 8000)
   httpd = server_class(server_address, handler_class)
   httpd.serve_forever()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The \code{HTTPServer} class builds on the \code{TCPServer} class by
 storing the server address as instance
@@ -49,7 +49,7 @@ from the request. For example, for the request \code{SPAM}, the
 the relevant information is stored into instance variables of the
 handler.
 
-\renewcommand{\indexsubitem}{(BaseHTTPRequestHandler instance variable)}
+\setindexsubitem{(BaseHTTPRequestHandler instance variable)}
 
 \code{BaseHTTPRequestHandler} has the following instance variables:
 
@@ -88,7 +88,7 @@ Proper adherance to the HTTP protocol must be used when writing
 to this stream.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(BaseHTTPRequestHandler class variable)}
+\setindexsubitem{(BaseHTTPRequestHandler class variable)}
 
 \code{BaseHTTPRequestHandler} has the following class variables:
 
@@ -138,7 +138,7 @@ error response, and \var{longmessage} as the \var{explain} key
 (see the \code{error_message_format} class variable).
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(BaseHTTPRequestHandler method)}
+\setindexsubitem{(BaseHTTPRequestHandler method)}
 
 A \code{BaseHTTPRequestHandler} instance has the following methods:
 
index dd302844d407634889eef645260ce1243fd1346d..e9bcc1f71678ea9e7c6bd9401fa3bc66655b2212 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{Bastion}}
 \label{module-Bastion}
 \stmodindex{Bastion}
-\renewcommand{\indexsubitem}{(in module Bastion)}
+\setindexsubitem{(in module Bastion)}
 
 % I'm concerned that the word 'bastion' won't be understood by people
 % for whom English is a second language, making the module name
index 4ff59aefaaae3e6f17d678fa29a1c389990612fa..02b247c991d6a52a775e46d45e64c4baa6bc21a5 100644 (file)
@@ -9,7 +9,7 @@ decoded), on other platforms only the data fork is handled.
 
 The \code{binhex} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module binhex)}
+\setindexsubitem{(in module binhex)}
 
 \begin{funcdesc}{binhex}{input\, output}
 Convert a binary file with filename \var{input} to binhex file
@@ -54,7 +54,7 @@ Jansen.
 
 The \code{uu} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module uu)}
+\setindexsubitem{(in module uu)}
 
 \begin{funcdesc}{encode}{in_file\, out_file\optional{\, name\, mode}}
 Uuencode file \var{in_file} into file \var{out_file}.  The uuencoded
@@ -82,7 +82,7 @@ bit-manipuation of large amounts of data is slow in python.
 
 The \code{binascii} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module binascii)}
+\setindexsubitem{(in module binascii)}
 
 \begin{funcdesc}{a2b_uu}{string}
 Convert a single line of uuencoded data back to binary and return the
index 6e64b777609baede8cf3905ffd224ed04e2daaca..b3ca8b243988293e39654be4faaebbb7cf36b53f 100644 (file)
@@ -29,7 +29,7 @@ track.
 
 Module \code{cd} defines the following functions and constants:
 
-\renewcommand{\indexsubitem}{(in module cd)}
+\setindexsubitem{(in module cd)}
 
 \begin{funcdesc}{createparser}{}
 Create and return an opaque parser object.  The methods of the parser
@@ -115,7 +115,7 @@ objects (see below).
 Player objects (returned by \code{cd.open()}) have the following
 methods:
 
-\renewcommand{\indexsubitem}{(CD player object method)}
+\setindexsubitem{(CD player object method)}
 
 \begin{funcdesc}{allowremoval}{}
 Unlocks the eject button on the CD-ROM drive permitting the user to
@@ -235,7 +235,7 @@ Pauses the CD if it is playing, and makes it play if it is paused.
 Parser objects (returned by \code{cd.createparser()}) have the
 following methods:
 
-\renewcommand{\indexsubitem}{(CD parser object method)}
+\setindexsubitem{(CD parser object method)}
 
 \begin{funcdesc}{addcallback}{type\, func\, arg}
 Adds a callback for the parser.  The parser has callbacks for eight
index 6b50ec8823216a1afba16331ab5420583fb590cd..f115263de1c120069326bb454702aaa84d23a994 100644 (file)
@@ -7,7 +7,7 @@
 \indexii{MIME}{headers}
 \index{URL}
 
-\renewcommand{\indexsubitem}{(in module cgi)}
+\setindexsubitem{(in module cgi)}
 
 Support module for CGI (Common Gateway Interface) scripts.
 
@@ -40,20 +40,20 @@ by a blank line.  The first section contains a number of headers,
 telling the client what kind of data is following.  Python code to
 generate a minimal header section looks like this:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print "Content-type: text/html"     # HTML is following
 print                               # blank line, end of headers
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The second section is usually HTML, which allows the client software
 to display nicely formatted text with header, in-line images, etc.
 Here's Python code that prints a simple piece of HTML:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print "<TITLE>CGI script output</TITLE>"
 print "<H1>This is my first CGI script</H1>"
 print "Hello, world!"
-\end{verbatim}\ecode
+\end{verbatim}
 %
 (It may not be fully legal HTML according to the letter of the
 standard, but any browser will understand it.)
@@ -77,7 +77,7 @@ dictionary.  For instance, the following code (which assumes that the
 \code{Content-type} header and blank line have already been printed) checks that 
 the fields \code{name} and \code{addr} are both set to a non-empty string:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 form = cgi.FieldStorage()
 form_ok = 0
 if form.has_key("name") and form.has_key("addr"):
@@ -88,7 +88,7 @@ if not form_ok:
     print "Please fill in the name and addr fields."
     return
 ...further form processing here...
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Here the fields, accessed through \code{form[key]}, are themselves instances
 of \code{FieldStorage} (or \code{MiniFieldStorage}, depending on the form encoding).
@@ -101,7 +101,7 @@ name), use the \code{type()} function to determine whether you have a single
 instance or a list of instances.  For example, here's code that
 concatenates any number of username fields, separated by commas:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 username = form["username"]
 if type(username) is type([]):
     # Multiple username fields specified
@@ -116,7 +116,7 @@ if type(username) is type([]):
 else:
     # Single username field specified
     usernames = username.value
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If a field represents an uploaded file, the value attribute reads the 
 entire file in memory as a string.  This may not be what you want.  You can 
@@ -124,7 +124,7 @@ test for an uploaded file by testing either the filename attribute or the
 file attribute.  You can then read the data at leasure from the file 
 attribute:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 fileitem = form["userfile"]
 if fileitem.file:
     # It's an uploaded file; count lines
@@ -133,7 +133,7 @@ if fileitem.file:
         line = fileitem.file.readline()
         if not line: break
         linecount = linecount + 1
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The file upload draft standard entertains the possibility of uploading
 multiple files from one field (using a recursive \code{multipart/*}
@@ -267,9 +267,9 @@ Make sure that your script is readable and executable by ``others''; the
 that the first line of the script contains \code{\#!} starting in column 1
 followed by the pathname of the Python interpreter, for instance:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 #!/usr/local/bin/python
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Make sure the Python interpreter exists and is executable by ``others''.
 
@@ -289,11 +289,11 @@ If you need to load modules from a directory which is not on Python's
 default module search path, you can change the path in your script,
 before importing other modules, e.g.:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import sys
 sys.path.insert(0, "/usr/home/joe/lib/python")
 sys.path.insert(0, "/usr/local/lib/python")
-\end{verbatim}\ecode
+\end{verbatim}
 %
 (This way, the directory inserted last will be searched first!)
 
@@ -327,9 +327,9 @@ Give it the right mode etc, and send it a request.  If it's installed
 in the standard \file{cgi-bin} directory, it should be possible to send it a
 request by entering a URL into your browser of the form:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If this gives an error of type 404, the server cannot find the script
 -- perhaps you need to install it in a different directory.  If it
@@ -345,9 +345,9 @@ The next step could be to call the \code{cgi} module's \code{test()}
 function from your script: replace its main code with the single
 statement
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 cgi.test()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This should produce the same results as those gotten from installing
 the \file{cgi.py} file itself.
@@ -380,7 +380,7 @@ Here are the rules:
 
 For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import sys
 import traceback
 print "Content-type: text/html"
@@ -391,7 +391,7 @@ try:
 except:
     print "\n\n<PRE>"
     traceback.print_exc()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Notes: The assignment to \code{sys.stderr} is needed because the traceback
 prints to \code{sys.stderr}.
@@ -402,13 +402,13 @@ If you suspect that there may be a problem in importing the traceback
 module, you can use an even more robust approach (which only uses
 built-in modules):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import sys
 sys.stderr = sys.stdout
 print "Content-type: text/plain"
 print
 ...your code here...
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This relies on the Python interpreter to print the traceback.  The
 content type of the output is set to plain text, which disables all
index c9886bbd38f20326a1a7a75533a43e7c01e7aa59..147fa6ee5f1ce5cc69d2f7458420658436ae38ef 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-cmath}
 
 \bimodindex{cmath}
-\renewcommand{\indexsubitem}{(in module cmath)}
+\setindexsubitem{(in module cmath)}
 This module is always available.
 It provides access to mathematical functions for complex numbers.
 The functions are:
index a2d77fe4f60511560637aace2d91f3f90a632002..04790a0d5ec3700a4513ed96d97355c46d2c3af7 100644 (file)
@@ -7,7 +7,7 @@ objects.
 
 The \code{code} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module code)}
+\setindexsubitem{(in module code)}
 
 \begin{funcdesc}{compile_command}{source, \optional{filename\optional{, symbol}}}
 This function is useful for programs that want to emulate Python's
index e82907729cb7b19c34fde55c665bdacf1fc2289e..e65e954f636d611da9991d79effe0b0acc66cde3 100644 (file)
@@ -11,7 +11,7 @@ The \code{commands} module is only usable on systems which support
 
 The \code{commands} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module commands)}
+\setindexsubitem{(in module commands)}
 \begin{funcdesc}{getstatusoutput}{cmd}
 Execute the string \var{cmd} in a shell with \code{os.popen()} and return
 a 2-tuple (status, output).  \var{cmd} is actually run as
index 60a5b420e55eb51d1f7d6864e50a28a612488013..1d1fd2218ffd5d2010aa39c235cb743ce5d24362 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{copy}}
 \label{module-copy}
 \stmodindex{copy}
-\renewcommand{\indexsubitem}{(copy function)}
+\setindexsubitem{(copy function)}
 \ttindex{copy}
 \ttindex{deepcopy}
 
@@ -9,12 +9,12 @@ This module provides generic (shallow and deep) copying operations.
 
 Interface summary:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import copy
 
 x = copy.copy(y)        # make a shallow copy of y
 x = copy.deepcopy(y)    # make a deep copy of y
-\end{verbatim}\ecode
+\end{verbatim}
 %
 For module specific errors, \code{copy.error} is raised.
 
@@ -76,7 +76,7 @@ to control pickling: they can define methods called
 \code{__setstate__()}.  See the description of module \code{pickle}
 for information on these methods.
 \refstmodindex{pickle}
-\renewcommand{\indexsubitem}{(copy protocol)}
+\setindexsubitem{(copy protocol)}
 \ttindex{__getinitargs__}
 \ttindex{__getstate__}
 \ttindex{__setstate__}
index dffcf430c643d28ee6251bc639d2d7c6cc27ecf8..cffc3958235784a82ce3c23ee128ecc098ba159c 100644 (file)
@@ -12,7 +12,7 @@ future as well.  It provides configuration information about object
 constructors which are not classes.  Such constructors may be factory
 functions or class instances.
 
-\renewcommand{\indexsubitem}{(in module copy_reg)}
+\setindexsubitem{(in module copy_reg)}
 
 \begin{funcdesc}{constructor}{object}
   Declares \var{object} to be a valid constructor.
index 0ec6e807acceb9387b881d720706688efdf96e13..64a9bfcc56a24f6cbb2e140905fb20487871c2b9 100644 (file)
@@ -9,7 +9,7 @@ allowing Python scripts to accept typed passwords from the user, or
 attempting to crack \UNIX{} passwords with a dictionary.
 \index{crypt(3)}
 
-\renewcommand{\indexsubitem}{(in module crypt)}
+\setindexsubitem{(in module crypt)}
 \begin{funcdesc}{crypt}{word\, salt} 
 \var{word} will usually be a user's password.  \var{salt} is a
 2-character string which will be used to select one of 4096 variations
index 551a153dd7de1f80d17c7c8d3330fdefe2c91598..416a6b0d57f1ea7c1623ca038ec71bba0b0c2ae1 100644 (file)
@@ -14,7 +14,7 @@ using the GNU GDBM library.
 
 The module defines the following constant and functions:
 
-\renewcommand{\indexsubitem}{(in module dbm)}
+\setindexsubitem{(in module dbm)}
 \begin{excdesc}{error}
 Raised on dbm-specific errors, such as I/O errors. \code{KeyError} is
 raised for general mapping errors like specifying an incorrect key.
index 2e4442b5ec6a24cfdd9a171d3d082041a3e0c2a8..b8998ddd87762f70afdb0ac6a8c7e6cf2e4ac6b4 100644 (file)
@@ -11,10 +11,10 @@ this module takes as an input is defined in the file
 
 Example: Given the function myfunc
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def myfunc(alist):
   return len(alist)
-\end{verbatim}\ecode
+\end{verbatim}
 
 the following command can be used to get the disassembly of \code{myfunc()}:
 
@@ -33,7 +33,7 @@ the following command can be used to get the disassembly of \code{myfunc()}:
 
 The \code{dis} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module dis)}
+\setindexsubitem{(in module dis)}
 
 \begin{funcdesc}{dis}{\optional{bytesource}}
 Disassemble the \var{bytesource} object. \var{bytesource} can denote
@@ -107,7 +107,7 @@ Sequence of byte codes of boolean operations.
 The Python compiler currently generates the following byte code
 instructions.
 
-\renewcommand{\indexsubitem}{(byte code insns)}
+\setindexsubitem{(byte code insns)}
 
 \begin{opcodedesc}{STOP_CODE}{}
 Indicates end-of-code to the compiler, not used by the interpreter.
@@ -507,5 +507,5 @@ default parameters, which are found below TOS.
 Pushes a slice object on the stack.  \var{argc} must be 2 or 3.  If it
 is 2, \code{slice(TOS1, TOS)} is pushed; if it is 3,
 \code{slice(TOS2, TOS1, TOS)} is pushed.
-See the \code{slice()} built-in function.
+See the \code{slice()}\bifuncindex{slice} built-in function.
 \end{opcodedesc}
index 2c4526678359312ca2006078e7db87c007938a29..cf5f8540da94177089151a72884b424550effba3 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{errno}}
 \stmodindex{errno}
 
-\renewcommand{\indexsubitem}{(in module errno)}
+\setindexsubitem{(in module errno)}
 
 This module makes available standard errno system symbols.
 The value of each symbol is the corresponding integer value.
index 758c14a751dfcc1ec6782839d4e4c45f6b1cdf54..bb27b1627878f233f32e7fb9a92c3dfc124db2b7 100644 (file)
@@ -52,7 +52,7 @@ situation in which the interpreter raises the same exception; but
 beware that there is nothing to prevent user code from raising an
 inappropriate error.
 
-\renewcommand{\indexsubitem}{(built-in exception base class)}
+\setindexsubitem{(built-in exception base class)}
 
 The following exceptions are only used as base classes for other
 exceptions.  When string-based standard exceptions are used, they
@@ -87,7 +87,7 @@ index used on a mapping or sequence is invalid: \code{IndexError},
 \code{KeyError}.
 \end{excdesc}
 
-\renewcommand{\indexsubitem}{(built-in exception)}
+\setindexsubitem{(built-in exception)}
 
 The following exceptions are the exceptions that are actually raised.
 They are class objects, except when the \code{-X} option is used to
index 5dab2838dc8a9e7b8557ae98d345c4837b4c840a..8af4ee31450df24e27ce9c99099b055e0f4eb70e 100644 (file)
@@ -11,7 +11,7 @@ file or socket object.
 
 The module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module struct)}
+\setindexsubitem{(in module struct)}
 
 \begin{funcdesc}{fcntl}{fd\, op\optional{\, arg}}
   Perform the requested operation on file descriptor \code{\var{fd}}.
@@ -56,7 +56,7 @@ script, found in the \file{Tools/scripts} directory.
 
 Examples (all on a SVR4 compliant system):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import struct, FCNTL
 
 file = open(...)
@@ -64,7 +64,7 @@ rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
 
 lockdata = struct.pack('hhllhh', FCNTL.F_WRLCK, 0, 0, 0, 0, 0)
 rv = fcntl(file.fileno(), FCNTL.F_SETLKW, lockdata)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Note that in the first example the return value variable \code{rv} will
 hold an integer value; in the second example it will hold a string
index 1c58a7eabd44e4df471352528a992a20c96d28db..4fa62a8f8edf0df26b4193816cbd0cb9b7f298ae 100644 (file)
@@ -41,7 +41,7 @@ Module \code{fl} defines the following functions.  For more information
 about what they do, see the description of the equivalent C function
 in the FORMS documentation:
 
-\renewcommand{\indexsubitem}{(in module fl)}
+\setindexsubitem{(in module fl)}
 \begin{funcdesc}{make_form}{type\, width\, height}
 Create a form with given type, width and height.  This returns a
 \dfn{form} object, whose methods are described below.
@@ -146,7 +146,7 @@ kinds of FORMS object also have some methods specific to that kind;
 these methods are listed here.
 
 \begin{flushleft}
-\renewcommand{\indexsubitem}{(form object method)}
+\setindexsubitem{(form object method)}
 \begin{funcdesc}{show_form}{placement\, bordertype\, name}
   Show the form.
 \end{funcdesc}
@@ -389,7 +389,7 @@ documentation:
 Besides methods specific to particular kinds of FORMS objects, all
 FORMS objects also have the following methods:
 
-\renewcommand{\indexsubitem}{(FORMS object method)}
+\setindexsubitem{(FORMS object method)}
 \begin{funcdesc}{set_call_back}{function\, argument}
 Set the object's callback function and argument.  When the object
 needs interaction, the callback function will be called with two
@@ -468,10 +468,10 @@ the C header file \file{<forms.h>} except that the name prefix
 \samp{FL_} is omitted.  Read the module source for a complete list of
 the defined names.  Suggested use:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import fl
 from FL import *
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{flp}}
 \label{module-flp}
index fa469fc9ca320149bc7805c0f41f220d842e557e..9d22123c0f8aed4e1c378ebd5cd9abb7d7a82d34 100644 (file)
@@ -14,7 +14,7 @@ details of font info; individual glyph metrics; and printer matching.
 
 It supports the following operations:
 
-\renewcommand{\indexsubitem}{(in module fm)}
+\setindexsubitem{(in module fm)}
 \begin{funcdesc}{init}{}
 Initialization function.
 Calls \code{fminit()}.
@@ -50,7 +50,7 @@ Returns the current font search path.
 
 Font handle objects support the following operations:
 
-\renewcommand{\indexsubitem}{(font handle method)}
+\setindexsubitem{(font handle method)}
 \begin{funcdesc}{scalefont}{factor}
 Returns a handle for a scaled version of this font.
 Calls \code{fmscalefont(\var{fh}, \var{factor})}.
index ecb77d3146503e1f04d7c84ebb1cf973667635db..7aa12957c2181b6e0816efb6f305586a3666c07d 100644 (file)
@@ -18,7 +18,7 @@ special to this module.  See module \code{glob}\refstmodindex{glob}
 for pathname expansion (\code{glob} uses \code{fnmatch()} to
 match filename segments).
 
-\renewcommand{\indexsubitem}{(in module fnmatch)}
+\setindexsubitem{(in module fnmatch)}
 
 \begin{funcdesc}{fnmatch}{filename, pattern}
 Test whether the \var{filename} string matches the \var{pattern}
index 124ca52f458f2ee3f3d25841881b656f00a06603..1a5150d4afd3756c67a175b98b3bc55707fe45a8 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-formatter}
 \stmodindex{formatter}
 
-\renewcommand{\indexsubitem}{(in module formatter)}
+\setindexsubitem{(in module formatter)}
 
 This module supports two interface definitions, each with mulitple
 implementations.  The \emph{formatter} interface is used by the
@@ -47,14 +47,14 @@ be called without having to track whether the property was changed.
 
 The following attributes are defined for formatter instance objects:
 
-\renewcommand{\indexsubitem}{(formatter object data)}
+\setindexsubitem{(formatter object data)}
 
 \begin{datadesc}{writer}
 The writer instance with which the formatter interacts.
 \end{datadesc}
 
 
-\renewcommand{\indexsubitem}{(formatter object method)}
+\setindexsubitem{(formatter object method)}
 
 \begin{funcdesc}{end_paragraph}{blanklines}
 Close any open paragraphs and insert at least \code{blanklines}
@@ -187,7 +187,7 @@ Two implementations of formatter objects are provided by this module.
 Most applications may use one of these classes without modification or
 subclassing.
 
-\renewcommand{\indexsubitem}{(in module formatter)}
+\setindexsubitem{(in module formatter)}
 
 \begin{funcdesc}{NullFormatter}{\optional{writer\code{ = None}}}
 A formatter which does nothing.  If \code{writer} is omitted, a
@@ -215,7 +215,7 @@ Note that while most applications can use the \code{AbstractFormatter}
 class as a formatter, the writer must typically be provided by the
 application.
 
-\renewcommand{\indexsubitem}{(writer object method)}
+\setindexsubitem{(writer object method)}
 
 \begin{funcdesc}{flush}{}
 Flush any buffered output or device control events.
@@ -307,7 +307,7 @@ Three implementations of the writer object interface are provided as
 examples by this module.  Most applications will need to derive new
 writer classes from the \code{NullWriter} class.
 
-\renewcommand{\indexsubitem}{(in module formatter)}
+\setindexsubitem{(in module formatter)}
 
 \begin{funcdesc}{NullWriter}{}
 A writer which only provides the interface definition; no actions are
index 86c3b3e0a66a54fc4ab3ab1fb53c6ca5d2cad23b..39f565722db6d3afc5e183c0893a52243bbcab36 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{ftplib}
 \indexii{FTP}{protocol}
 
-\renewcommand{\indexsubitem}{(in module ftplib)}
+\setindexsubitem{(in module ftplib)}
 
 This module defines the class \code{FTP} and a few related items.  The
 \code{FTP} class implements the client side of the FTP protocol.  You
@@ -14,7 +14,7 @@ more information on FTP (File Transfer Protocol), see Internet \rfc{959}.
 
 Here's a sample session using the \code{ftplib} module:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> from ftplib import FTP
 >>> ftp = FTP('ftp.cwi.nl')   # connect to host, default port
 >>> ftp.login()               # user anonymous, passwd user@hostname
@@ -27,7 +27,7 @@ dr-xr-srwt 105 ftp-usr  pdmaint     1536 Mar 21 14:32 ..
  .
  .
 >>> ftp.quit()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module defines the following items:
 
@@ -68,7 +68,7 @@ not begin with a digit in the range 1--5.
 
 FTP instances have the following methods:
 
-\renewcommand{\indexsubitem}{(FTP object method)}
+\setindexsubitem{(FTP object method)}
 
 \begin{funcdesc}{set_debuglevel}{level}
 Set the instance's debugging level.  This controls the amount of
index 6d1cbce6980cdb001d5feb324b35d7fed778e284..6a2b0a57be13a0a32dff8ca5247c0c0c919508ad 100644 (file)
@@ -5,7 +5,7 @@ The Python interpreter has a number of functions built into it that
 are always available.  They are listed here in alphabetical order.
 
 
-\renewcommand{\indexsubitem}{(built-in function)}
+\setindexsubitem{(built-in function)}
 
 \begin{funcdesc}{__import__}{name\optional{, globals\optional{, locals\optional{, fromlist}}}}
 This function is invoked by the \code{import} statement.  It
@@ -135,14 +135,14 @@ class instances are callable if they have an attribute \code{__call__}.
   and for class instances, methods are not included.
   The resulting list is sorted alphabetically.  For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import sys
 >>> dir()
 ['sys']
 >>> dir(sys)
 ['argv', 'exit', 'modules', 'path', 'stderr', 'stdin', 'stdout']
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{divmod}{a\, b}
@@ -166,12 +166,12 @@ class instances are callable if they have an attribute \code{__call__}.
   called.  The return value is the result of the evaluated expression.
   Syntax errors are reported as exceptions.  Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> x = 1
 >>> print eval('x+1')
 2
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
   This function can also be used to execute arbitrary code objects
   (e.g.\ created by \code{compile()}).  In this case pass a code
@@ -448,7 +448,7 @@ there's no reliable way to determine whether this is the case.}
   greater than \var{stop}.  \var{step} must not be zero (or else an
   exception is raised).  Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> range(10)
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 >>> range(1, 11)
@@ -464,7 +464,7 @@ there's no reliable way to determine whether this is the case.}
 >>> range(1, 0)
 []
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{raw_input}{\optional{prompt}}
@@ -473,13 +473,13 @@ there's no reliable way to determine whether this is the case.}
   converts it to a string (stripping a trailing newline), and returns that.
   When \EOF{} is read, \code{EOFError} is raised. Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = raw_input('--> ')
 --> Monty Python's Flying Circus
 >>> s
 "Monty Python's Flying Circus"
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 
 If the \code{readline} module was loaded, then
 \code{raw_input()} will use it to provide elaborate
@@ -604,10 +604,10 @@ built-in types.
 \obindex{type}
 For instance:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import types
 >>> if isinstance(x, types.StringType): print "It's a string"
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{vars}{\optional{object}}
index ea655a3e21ff3a4d2c21b5e7bed2c99aca6d760b..d42bf851b4fffe630a80cc00dce7250393c94904 100644 (file)
@@ -15,7 +15,7 @@ Printing a \code{gdbm} object doesn't print the keys and values, and the
 
 The module defines the following constant and functions:
 
-\renewcommand{\indexsubitem}{(in module gdbm)}
+\setindexsubitem{(in module gdbm)}
 \begin{excdesc}{error}
 Raised on \code{gdbm}-specific errors, such as I/O errors. \code{KeyError} is
 raised for general mapping errors like specifying an incorrect key.
@@ -57,12 +57,12 @@ method returns the starting key.
 Returns the key that follows \var{key} in the traversal.  The
 following code prints every key in the database \code{db}, without having to
 create a list in memory that contains them all:
-\bcode\begin{verbatim}
+\begin{verbatim}
 k=db.firstkey()
 while k!=None:
     print k
     k=db.nextkey(k)
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{reorganize}{}
index a9210b02aee6c3c9549bc43512e15360c8fcba31..286cf58555766df795c3b7a7061608f30ca306aa 100644 (file)
@@ -45,7 +45,7 @@ be mixed.
 
 An example using only \UNIX{} style options:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import getopt, string
 >>> args = string.split('-a -b -cfoo -d bar a1 a2')
 >>> args
@@ -56,11 +56,11 @@ An example using only \UNIX{} style options:
 >>> args
 ['a1', 'a2']
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using long option names is equally easy:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
 >>> args = string.split(s)
 >>> args
@@ -72,7 +72,7 @@ Using long option names is equally easy:
 >>> args
 ['a1', 'a2']
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The exception
 \code{getopt.error}
index b1686819369e326002662228aa33f0478852b174..b694d86cd0c593fab5be4e75bb8868468dde341a 100644 (file)
@@ -41,15 +41,15 @@ All (short, long, unsigned) integer arguments or return values that are
 only used to specify the length of an array argument are omitted.
 For example, the C call
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 lmdef(deftype, index, np, props)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is translated to Python as
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 lmdef(deftype, index, props)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \item
 Output arguments are omitted from the argument list; they are
@@ -60,22 +60,22 @@ because of the previous rule) and an output argument, the return value
 comes first in the tuple.
 Examples: the C call
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 getmcolor(i, &red, &green, &blue)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is translated to Python as
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 red, green, blue = getmcolor(i)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \end{itemize}
 
 The following functions are non-standard or have special argument
 conventions:
 
-\renewcommand{\indexsubitem}{(in module gl)}
+\setindexsubitem{(in module gl)}
 \begin{funcdesc}{varray}{argument}
 %JHXXX the argument-argument added
 Equivalent to but faster than a number of
@@ -160,7 +160,7 @@ No method is provided to detect buffer overrun.
 
 Here is a tiny but complete example GL program in Python:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import gl, GL, time
 
 def main():
@@ -182,7 +182,7 @@ def main():
     time.sleep(5)
 
 main()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Modules \sectcode{GL} and \sectcode{DEVICE}}
 \nodename{GL and DEVICE}
index 3f21b39e32a2b55c3b40741360ed761a8dc007a8..58193c98e8f6826aedf3519b10d3393bc8a279b0 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{glob}}
 \label{module-glob}
 \stmodindex{glob}
-\renewcommand{\indexsubitem}{(in module glob)}
+\setindexsubitem{(in module glob)}
 
 The \code{glob} module finds all the pathnames matching a specified
 pattern according to the rules used by the \UNIX{} shell.  No tilde
@@ -25,7 +25,7 @@ For example, consider a directory containing only the following files:
 will produce the following results.  Notice how any leading components
 of the path are preserved.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import glob
 >>> glob.glob('./[0-9].*')
 ['./1.gif', './2.txt']
@@ -33,4 +33,4 @@ of the path are preserved.
 ['1.gif', 'card.gif']
 >>> glob.glob('?.gif')
 ['1.gif']
-\end{verbatim}\ecode
+\end{verbatim}
index b0ebcf726e110932d891e246d77e658030d98c0d..eb6d2a68676bcc328963acc3f046db4ab4a23945 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{gopherlib}
 \indexii{Gopher}{protocol}
 
-\renewcommand{\indexsubitem}{(in module gopherlib)}
+\setindexsubitem{(in module gopherlib)}
 
 This module provides a minimal implementation of client side of the
 the Gopher protocol.  It is used by the module \code{urllib} to handle
index ab904853310f8a73330a4f6cc8095e7e82401059..478097d06fed0240ade9732e5fec92c987fd60ba 100644 (file)
@@ -19,7 +19,7 @@ A \code{KeyError} exception is raised if the entry asked for cannot be found.
 
 It defines the following items:
 
-\renewcommand{\indexsubitem}{(in module grp)}
+\setindexsubitem{(in module grp)}
 \begin{funcdesc}{getgrgid}{gid}
 Return the group database entry for the given numeric group ID.
 \end{funcdesc}
index f832da79c75996518fd80c6ac989805b381dfe48..df99e5deb82dd9cff12b5c1626dad4469bacbee5 100644 (file)
@@ -12,7 +12,7 @@ or decompressing the data so it looks like an ordinary file object.
 object, though it's not possible to use the \code{seek()} and
 \code{tell()} methods to access the file randomly.
 
-\renewcommand{\indexsubitem}{(in module gzip)}
+\setindexsubitem{(in module gzip)}
 \begin{funcdesc}{open}{fileobj\optional{\, filename\optional{\, mode\, compresslevel}}}
   Returns a new \code{GzipFile} object on top of \var{fileobj}, which
   can be a regular file, a \code{StringIO} object, or any object which
index b9b29d49fbfc11bfeb7c9077f8132ced539c85b3..b05c4702b4e8a901d24d60904813b43c5113b02d 100644 (file)
@@ -4,7 +4,7 @@
 \index{HTML}
 \index{hypertext}
 
-\renewcommand{\indexsubitem}{(in module htmllib)}
+\setindexsubitem{(in module htmllib)}
 
 This module defines a class which can serve as a base for parsing text
 files formatted in the HyperText Mark-up Language (HTML).  The class
@@ -40,10 +40,10 @@ incomplete elements are saved in a buffer.  To force processing of all
 unprocessed data, call the \method{close()} method.
 
 For example, to parse the entire contents of a file, use:
-\bcode\begin{verbatim}
+\begin{verbatim}
 parser.feed(open('myfile.html').read())
 parser.close()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \item
 The interface to define semantics for HTML tags is very simple: derive
@@ -71,7 +71,7 @@ handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements.
 In addition to tag methods, the \class{HTMLParser} class provides some
 additional methods and instance variables for use within tag methods.
 
-\renewcommand{\indexsubitem}{(HTMLParser attribute)}
+\setindexsubitem{(HTMLParser attribute)}
 
 \begin{datadesc}{formatter}
 This is the formatter instance associated with the parser.
@@ -85,7 +85,7 @@ as within a \code{<PRE>} element.  The default value is false.  This
 affects the operation of \method{handle_data()} and \method{save_end()}.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(HTMLParser method)}
+\setindexsubitem{(HTMLParser method)}
 
 \begin{funcdesc}{anchor_bgn}{href\, name\, type}
 This method is called at the start of an anchor region.  The arguments
index 0bca8adc96001475f628fbfab0be6234fb240ba5..ed59c9cfd3121f3a9e802b0d05f0659914e9facb 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{httplib}
 \index{HTTP}
 
-\renewcommand{\indexsubitem}{(in module httplib)}
+\setindexsubitem{(in module httplib)}
 
 This module defines a class which implements the client side of the
 HTTP protocol.  It is normally not used directly --- the module
@@ -20,11 +20,11 @@ method should be used to connect to a server.  For example, the
 following calls all create instances that connect to the server at the
 same host and port:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> h1 = httplib.HTTP('www.cwi.nl')
 >>> h2 = httplib.HTTP('www.cwi.nl:80')
 >>> h3 = httplib.HTTP('www.cwi.nl', 80)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Once an \code{HTTP} instance has been connected to an HTTP server, it
 should be used as follows:
@@ -51,7 +51,7 @@ file object that it returns.
 
 \code{HTTP} instances have the following methods:
 
-\renewcommand{\indexsubitem}{(HTTP method)}
+\setindexsubitem{(HTTP method)}
 
 \begin{funcdesc}{set_debuglevel}{level}
 Set the debugging level (the amount of debugging output printed).
@@ -112,7 +112,7 @@ methods.
 
 Here is an example session:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import httplib
 >>> h = httplib.HTTP('www.cwi.nl')
 >>> h.putrequest('GET', '/index.html')
@@ -125,4 +125,4 @@ Here is an example session:
 >>> data = f.read() # Get the raw HTML
 >>> f.close()
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
index 48f9188009b3934e0fb38127a5598b40d4fc90df..e5d494dbf4cc07681ab9c96e10618c236919b9c2 100644 (file)
@@ -9,7 +9,7 @@ by \code{gl.lrectwrite} and the \code{imgfile} module.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module imageop)}
+\setindexsubitem{(in module imageop)}
 
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unknown number of bits
index 96afc9bb0797ed71c8885ba0c04bc18943fd1542..098d59b4d1e8a8fb1b9280763b33ae6686f2f5d9 100644 (file)
@@ -9,7 +9,7 @@ is enough in some cases.  Currently, colormap files are not supported.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module imgfile)}
+\setindexsubitem{(in module imgfile)}
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unsupported file type, etc.
 \end{excdesc}
index e8ec4e9448c288992fae0e02bb119ac8a570609a..71ef9491e5d994514b1d1e13bf7733787bb15fe1 100644 (file)
@@ -7,7 +7,7 @@ file or byte stream.
 
 The \code{imghdr} module defines the following function:
 
-\renewcommand{\indexsubitem}{(in module imghdr)}
+\setindexsubitem{(in module imghdr)}
 
 \begin{funcdesc}{what}{filename\optional{\, h}}
 Tests the image data contained in the file named by \var{filename},
@@ -54,8 +54,8 @@ the test succeeded, or \code{None} if it failed.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import imghdr
 >>> imghdr.what('/tmp/bass.gif')
 'gif'
-\end{verbatim}\ecode
+\end{verbatim}
index 0ba07703ffead94d28b90dd1aad120ff38461149..5ad2fff29e1fbc2e64bfbec99271697c77ef976b 100644 (file)
@@ -7,7 +7,7 @@ This module provides an interface to the mechanisms used to implement
 the \code{import} statement.  It defines the following constants and
 functions:
 
-\renewcommand{\indexsubitem}{(in module imp)}
+\setindexsubitem{(in module imp)}
 
 \begin{funcdesc}{get_magic}{}
 Return the magic string value used to recognize byte-compiled code
@@ -206,7 +206,7 @@ up to Python 1.4 (i.e., no hierarchical module names).  (This
 \code{imp.find_module()} has been extended and
 \code{imp.load_module()} has been added in 1.4.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import imp import sys
 
 def __import__(name, globals=None, locals=None, fromlist=None):
@@ -227,7 +227,7 @@ def __import__(name, globals=None, locals=None, fromlist=None):
         # Since we may exit via an exception, close fp explicitly.
         if fp:
             fp.close()
-\end{verbatim}\ecode
+\end{verbatim}
 
 A more complete example that implements hierarchical module names and
 includes a \code{reload()} function can be found in the standard
index 0d1dc1ce4c20d3f8d97c6ea27ea706e104199581..75691cf9a5d1c4aae4cf17151dc1f999f12bf24f 100644 (file)
@@ -10,7 +10,7 @@ documentation provided with the software.
 
 The \code{jpeg} module defines these functions:
 
-\renewcommand{\indexsubitem}{(in module jpeg)}
+\setindexsubitem{(in module jpeg)}
 \begin{funcdesc}{compress}{data\, w\, h\, b}
 Treat data as a pixmap of width \var{w} and height \var{h}, with \var{b} bytes per
 pixel.  The data is in SGI GL order, so the first pixel is in the
index a0ecf39226b659412944aca2e34adcdb7e97e2f2..84eaf7516f31d8c9ef7f3c4402237552a9bf3098 100644 (file)
@@ -16,7 +16,7 @@ available.
 
 The \code{locale} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module locale)}
+\setindexsubitem{(in module locale)}
 
 \begin{funcdesc}{setlocale}{category\optional{\, value}}
 If \var{value} is specified, modifies the locale setting for the
@@ -31,10 +31,10 @@ If no \var{value} is specified, the current setting for the
 
 \code{setlocale()} is not thread safe on most systems. Applications
 typically start with a call of
-\bcode\begin{verbatim}
+\begin{verbatim}
 import locale
 locale.setlocale(locale.LC_ALL,"")
-\end{verbatim}\ecode
+\end{verbatim}
 This sets the locale for all categories to the user's default setting
 (typically specified in the \code{LANG} environment variable). If the
 locale is not changed thereafter, using multithreading should not
@@ -182,9 +182,9 @@ Exception raised when \code{setlocale()} fails.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import locale
 >>> locale.open(locale.LC_ALL,"de") #setting locale to German
 >>> locale.strcoll("f\344n","foo")  #comparing a string containing an umlaut 
 >>> can.close()
-\end{verbatim}\ecode
+\end{verbatim}
index 42bdfda54129f7a6b7d8522f8e3e85548c59636e..d616f36014596135e10043ea0591972d5e413add 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-mailbox}
 \stmodindex{mailbox}
 
-\renewcommand{\indexsubitem}{(in module mailbox)}
+\setindexsubitem{(in module mailbox)}
 
 This module defines a number of classes that allow easy and uniform
 access to mail messages in a (unix) mailbox.
index b475b1192c3ec1a2eddb738d7d338017beb6358c..ecc8369925eba5c691c58a412163ab8751886f04 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{mailcap}}
 \label{module-mailcap}
 \stmodindex{mailcap}
-\renewcommand{\indexsubitem}{(in module mailcap)}
+\setindexsubitem{(in module mailcap)}
 
 Mailcap files are used to configure how MIME-aware applications such
 as mail readers and Web browsers react to files with different MIME
@@ -69,9 +69,9 @@ will override settings in the system mailcap files
 \end{funcdesc}
 
 An example usage:
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import mailcap
 >>> d=mailcap.getcaps()
 >>> mailcap.findmatch(d, 'video/mpeg', filename='/tmp/tmp1223')
 ('xmpeg /tmp/tmp1223', {'view': 'xmpeg %s'})
-\end{verbatim}\ecode
+\end{verbatim}
index dc4ed98f02ab50fead35648fbaf613bb4f764a23..fddbba45b34fd736647fe996720956a387e7fda9 100644 (file)
@@ -54,7 +54,7 @@ operating on strings.
 
 The module defines these functions:
 
-\renewcommand{\indexsubitem}{(in module marshal)}
+\setindexsubitem{(in module marshal)}
 
 \begin{funcdesc}{dump}{value\, file}
   Write the value on the open file.  The value must be a supported
index c40030b30f72e01a446cb35ac13079c7976947b1..7f5679c8567ede486981b919f2fa950b536491e8 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-math}
 
 \bimodindex{math}
-\renewcommand{\indexsubitem}{(in module math)}
+\setindexsubitem{(in module math)}
 This module is always available.
 It provides access to the mathematical functions defined by the \C{}
 standard.
index bbf71726393e3509069ec172122e3f62d09ba620..946d00d138775f5300349bf1f1b23ee9a754b8a0 100644 (file)
@@ -14,23 +14,23 @@ so far using the \code{digest()} method.
 For example, to obtain the digest of the string {\tt"Nobody inspects
 the spammish repetition"}:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import md5
 >>> m = md5.new()
 >>> m.update("Nobody inspects")
 >>> m.update(" the spammish repetition")
 >>> m.digest()
 '\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
-\end{verbatim}\ecode
+\end{verbatim}
 %
 More condensed:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> md5.new("Nobody inspects the spammish repetition").digest()
 '\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\renewcommand{\indexsubitem}{(in module md5)}
+\setindexsubitem{(in module md5)}
 
 \begin{funcdesc}{new}{\optional{arg}}
 Return a new md5 object.  If \var{arg} is present, the method call
@@ -44,7 +44,7 @@ For backward compatibility reasons, this is an alternative name for the
 
 An md5 object has the following methods:
 
-\renewcommand{\indexsubitem}{(md5 method)}
+\setindexsubitem{(md5 method)}
 \begin{funcdesc}{update}{arg}
 Update the md5 object with the string \var{arg}.  Repeated calls are
 equivalent to a single call with the concatenation of all the
index 41a62bab664903a7ffe7c2fcd582429ec01aa325..94601b3a0b95ca2d885e355ccbc2da98b9cf1969 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-mimetools}
 \stmodindex{mimetools}
 
-\renewcommand{\indexsubitem}{(in module mimetools)}
+\setindexsubitem{(in module mimetools)}
 
 This module defines a subclass of the class \code{rfc822.Message} and
 a number of utility functions that are useful for the manipulation for
@@ -52,7 +52,7 @@ file \var{output}.  The block size is currently fixed at 8192.
 The \code{mimetools.Message} class defines the following methods in
 addition to the \code{rfc822.Message} class:
 
-\renewcommand{\indexsubitem}{(mimetool.Message method)}
+\setindexsubitem{(mimetool.Message method)}
 
 \begin{funcdesc}{getplist}{}
 Return the parameter list of the \code{Content-type} header.  This is
index 171e7d26f053f5b79ff46b757834cb252ee1c0fc..298275583b55c865b243a75bcb10cadee67476ab 100644 (file)
@@ -1,6 +1,6 @@
 \section{Standard Module \sectcode{mimify}}
 \stmodindex{mimify}
-\renewcommand{\indexsubitem}{(in module mimify)}
+\setindexsubitem{(in module mimify)}
 
 The mimify module defines two functions to convert mail messages to
 and from MIME format.  The mail message can be either a simple message
index 7ab5fe793843074f1fc3c2419f11901e24769e06..07b217026f735d3f7284ba9e42da1bba10c92a33 100644 (file)
@@ -24,7 +24,7 @@ You create an mpz-number by calling the function called \code{mpz} (see
 below for an exact description). An mpz-number is printed like this:
 \code{mpz(\var{value})}.
 
-\renewcommand{\indexsubitem}{(in module mpz)}
+\setindexsubitem{(in module mpz)}
 \begin{funcdesc}{mpz}{value}
   Create a new mpz-number. \var{value} can be an integer, a long,
   another mpz-number, or even a string. If it is a string, it is
@@ -69,7 +69,7 @@ return mpz-numbers.
 
 An mpz-number has one method:
 
-\renewcommand{\indexsubitem}{(mpz method)}
+\setindexsubitem{(mpz method)}
 \begin{funcdesc}{binary}{}
   Convert this mpz-number to a binary string, where the number has been
   stored as an array of radix-256 digits, least significant digit first.
index 219f081512aea7514f9fd41600bd71a311e3a019..8a251da7f458ff5530abe2349ca3c5c6f2ad7467 100644 (file)
@@ -28,20 +28,20 @@ To import module \code{ham} from package \code{spam} and use function
 \code{hamneggs()} from that module, you can use any of the following
 possibilities:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import spam.ham                # *not* "import spam" !!!
 spam.ham.hamneggs()
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 from spam import ham
 ham.hamneggs()
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 from spam.ham import hamneggs
 hamneggs()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \code{import spam} creates an
 empty package named \code{spam} if one does not already exist, but it does
@@ -52,9 +52,9 @@ The only submodule that is guaranteed to be imported is
 \code{spam.__init__} is a submodule of package spam.  It can refer to
 spam's namespace as \code{__} (two underscores):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 __.spam_inited = 1             # Set a package-level variable
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Additional initialization code (setting up variables, importing other
 submodules) can be performed in \file{spam/__init__.py}.
index c0a31381cb35ff81ec5bd3b4a0b6258df1e1a372..7ca8a7af9b5b402d29fd837a45694df11582951d 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{nntplib}
 \indexii{NNTP}{protocol}
 
-\renewcommand{\indexsubitem}{(in module nntplib)}
+\setindexsubitem{(in module nntplib)}
 
 This module defines the class \code{NNTP} which implements the client
 side of the NNTP protocol.  It can be used to implement a news reader
@@ -14,7 +14,7 @@ Here are two small examples of how it can be used.  To list some
 statistics about a newsgroup and print the subjects of the last 10
 articles:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = NNTP('news.cwi.nl')
 >>> resp, count, first, last, name = s.group('comp.lang.python')
 >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
@@ -35,12 +35,12 @@ Group comp.lang.python has 59 articles, range 3742 to 3803
 >>> s.quit()
 '205 news.cwi.nl closing connection.  Goodbye.'
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 
 To post an article from a file (this assumes that the article has
 valid headers):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = NNTP('news.cwi.nl')
 >>> f = open('/tmp/article')
 >>> s.post(f)
@@ -48,7 +48,7 @@ valid headers):
 >>> s.quit()
 '205 news.cwi.nl closing connection.  Goodbye.'
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module itself defines the following items:
 
@@ -83,7 +83,7 @@ is the server's response: a string beginning with a three-digit code.
 If the server's response indicates an error, the method raises one of
 the above exceptions.
 
-\renewcommand{\indexsubitem}{(NNTP object method)}
+\setindexsubitem{(NNTP object method)}
 
 \begin{funcdesc}{getwelcome}{}
 Return the welcome message sent by the server in reply to the initial
index 190faab6a1c7f1f96a5cb5211c9b5b3d198f1ef3..d371ee3d66f9d9f7b41e5c0e08c8e9a504f979b5 100644 (file)
@@ -11,7 +11,7 @@ leading and trailing \samp{__} are also provided for convenience.
 
 The \code{operator} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module operator)}
+\setindexsubitem{(in module operator)}
 
 \begin{funcdesc}{add}{a, b}
 Return \var{a} \code{+} \var{b}, for \var{a} and \var{b} numbers.
@@ -188,10 +188,10 @@ Delete the slice of \var{a} from index \var{b} to index \var{c}\code{-1}.
 Example: Build a dictionary that maps the ordinals from \code{0} to
 \code{256} to their character equivalents.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import operator
 >>> d = {}
 >>> keys = range(256)
 >>> vals = map(chr, keys)
 >>> map(operator.setitem, [d]*len(keys), keys, vals)
-\end{verbatim}\ecode
+\end{verbatim}
index 763d2f394123dad125e4cf56f817a9737e55ab8a..58f268cc7453345c6ff5b034c8ff3be627e9955c 100644 (file)
@@ -26,7 +26,7 @@ directly from the OS dependent built-in module, so there should be
 In addition to whatever the correct OS dependent module exports, the
 following variables and functions are always exported by \code{os}:
 
-\renewcommand{\indexsubitem}{(in module os)}
+\setindexsubitem{(in module os)}
 
 \begin{datadesc}{name}
 The name of the OS dependent module imported.  The following names
index c54641275a5cc5005518c5fd6094b828db9797ce..efcfd0e5dbb4c712d6cae9f86182065f2e65b7a3 100644 (file)
@@ -15,7 +15,7 @@ to interface with the
 The module is too large to document here in its entirety.
 One interesting function:
 
-\renewcommand{\indexsubitem}{(in module panel)}
+\setindexsubitem{(in module panel)}
 \begin{funcdesc}{defpanellist}{filename}
 Parses a panel description file containing S-expressions written by the
 \emph{Panel Editor}
index 4b838c514d903391e7d16fc09d48500e6fd3c76b..47b5bd454383c307cba7c085f506d2a731873b2e 100644 (file)
@@ -89,7 +89,7 @@ to convert AST objects to other representations such as parse trees
 and compiled code objects, but there are also functions which serve to
 query the type of parse tree represented by an AST object.
 
-\renewcommand{\indexsubitem}{(in module parser)}
+\setindexsubitem{(in module parser)}
 
 
 \subsection{Creating AST Objects}
@@ -289,30 +289,30 @@ bytecode generation, the simplest operation is to do nothing.  For
 this purpose, using the \module{parser} module to produce an
 intermediate data structure is equivelent to the code
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> code = compile('a + 5', 'eval')
 >>> a = 5
 >>> eval(code)
 10
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The equivelent operation using the \module{parser} module is somewhat
 longer, and allows the intermediate internal parse tree to be retained
 as an AST object:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import parser
 >>> ast = parser.expr('a + 5')
 >>> code = parser.compileast(ast)
 >>> a = 5
 >>> eval(code)
 10
-\end{verbatim}\ecode
+\end{verbatim}
 %
 An application which needs both AST and code objects can package this
 code into readily available functions:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import parser
 
 def load_suite(source_string):
@@ -324,7 +324,7 @@ def load_expression(source_string):
     ast = parser.expr(source_string)
     code = parser.compileast(ast)
     return ast, code
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \subsubsection{Information Discovery}
 
@@ -367,16 +367,16 @@ Consider the simplest case of interest when searching for docstrings:
 a module consisting of a docstring and nothing else.  (See file
 \file{docstring.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 """Some documentation.
 """
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using the interpreter to take a look at the parse tree, we find a
 bewildering mass of numbers and parentheses, with the documentation
 buried deep in nested tuples.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import parser
 >>> import pprint
 >>> ast = parser.suite(open('docstring.py').read())
@@ -404,7 +404,7 @@ buried deep in nested tuples.
    (4, ''))),
  (4, ''),
  (0, ''))
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The numbers at the first element of each node in the tree are the node
 types; they map directly to terminal and non-terminal symbols in the
@@ -444,7 +444,7 @@ form, allowing a simple variable representation to be
 the pattern matching, returning a boolean and a dictionary of variable
 name to value mappings.  (See file \file{example.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 from types import ListType, TupleType
 
 def match(pattern, data, vars=None):
@@ -462,13 +462,13 @@ def match(pattern, data, vars=None):
         if not same:
             break
     return same, vars
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using this simple representation for syntactic variables and the symbolic
 node types, the pattern for the candidate docstring subtrees becomes
 fairly readable.  (See file \file{example.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import symbol
 import token
 
@@ -495,18 +495,18 @@ DOCSTRING_STMT_PATTERN = (
                      )))))))))))))))),
      (token.NEWLINE, '')
      ))
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using the \function{match()} function with this pattern, extracting the
 module docstring from the parse tree created previously is easy:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> found, vars = match(DOCSTRING_STMT_PATTERN, tup[1])
 >>> found
 1
 >>> vars
 {'docstring': '"""Some documentation.\012"""'}
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Once specific data can be extracted from a location where it is
 expected, the question of where information can be expected
@@ -569,7 +569,7 @@ grammar, but the method which recursively creates new information
 objects requires further examination.  Here is the relevant part of
 the \class{SuiteInfoBase} definition from \file{example.py}:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class SuiteInfoBase:
     _docstring = ''
     _name = ''
@@ -599,7 +599,7 @@ class SuiteInfoBase:
                 elif cstmt[0] == symbol.classdef:
                     name = cstmt[2][1]
                     self._class_info[name] = ClassInfo(cstmt)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 After initializing some internal state, the constructor calls the
 \method{_extract_info()} method.  This method performs the bulk of the
@@ -620,13 +620,13 @@ def square(x): "Square an argument."; return x ** 2
 while the long form uses an indented block and allows nested
 definitions:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def make_power(exp):
     "Make a function that raises an argument to the exponent `exp'."
     def raiser(x, y=exp):
         return x ** y
     return raiser
-\end{verbatim}\ecode
+\end{verbatim}
 %
 When the short form is used, the code block may contain a docstring as
 the first, and possibly only, \constant{small_stmt} element.  The
@@ -662,7 +662,7 @@ the real extraction algorithm remains common to all forms of code
 blocks.  A high-level function can be used to extract the complete set
 of information from a source file.  (See file \file{example.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def get_docs(fileName):
     source = open(fileName).read()
     import os
@@ -671,7 +671,7 @@ def get_docs(fileName):
     ast = parser.suite(source)
     tup = parser.ast2tuple(ast)
     return ModuleInfo(tup, basename)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This provides an easy-to-use interface to the documentation of a
 module.  If information is required which is not extracted by the code
@@ -703,7 +703,7 @@ to may change between Python versions.
 
 This module also provides one additional data object:
 
-\renewcommand{\indexsubitem}{(in module symbol)}
+\setindexsubitem{(in module symbol)}
 
 
 \begin{datadesc}{sym_name}
@@ -731,7 +731,7 @@ versions.
 This module also provides one data object and some functions.  The
 functions mirror definitions in the Python C header files.
 
-\renewcommand{\indexsubitem}{(in module token)}
+\setindexsubitem{(in module token)}
 
 
 \begin{datadesc}{tok_name}
index b2db2a2f61cb3ddb44816df702d9785b69d05a5f..6f14ab61eebbdfbf12e8b511d335fc4d9a7ea6c6 100644 (file)
@@ -2,7 +2,7 @@
 \stmodindex{pdb}
 \index{debugging}
 
-\renewcommand{\indexsubitem}{(in module pdb)}
+\setindexsubitem{(in module pdb)}
 
 The module \code{pdb} defines an interactive source code debugger for
 Python programs.  It supports setting
@@ -29,7 +29,7 @@ specific modules).
 The debugger's prompt is ``\code{(Pdb) }''.
 Typical usage to run a program under control of the debugger is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import pdb
 >>> import mymodule
 >>> pdb.run('mymodule.test()')
@@ -40,7 +40,7 @@ Typical usage to run a program under control of the debugger is:
 NameError: 'spam'
 > <string>(1)?()
 (Pdb) 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \code{pdb.py} can also be invoked as
 a script to debug other scripts.  For example:
@@ -48,7 +48,7 @@ a script to debug other scripts.  For example:
 
 Typical usage to inspect a crashed program is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import pdb
 >>> import mymodule
 >>> mymodule.test()
@@ -63,7 +63,7 @@ NameError: spam
 > ./mymodule.py(3)test2()
 -> print spam
 (Pdb) 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module defines the following functions; each enters the debugger
 in a slightly different way:
@@ -224,10 +224,10 @@ The exclamation point can be omitted unless the first word
 of the statement resembles a debugger command.
 To set a global variable, you can prefix the assignment
 command with a ``\code{global}'' command on the same line, e.g.:
-\bcode\begin{verbatim}
+\begin{verbatim}
 (Pdb) global list_options; list_options = ['-l']
 (Pdb)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \item[q(uit)]
 
index 5eef11c05334fdc061454817c33be370eb4dbdfa..41191d4d1eb74e4c18dac6e97ad607994e057a58 100644 (file)
@@ -8,7 +8,7 @@
 \indexii{flattening}{objects}
 \indexii{pickling}{objects}
 
-\renewcommand{\indexsubitem}{(in module pickle)}
+\setindexsubitem{(in module pickle)}
 
 The \code{pickle} module implements a basic but powerful algorithm for
 ``pickling'' (a.k.a.\ serializing, marshalling or flattening) nearly
@@ -94,7 +94,7 @@ There are some restrictions on the pickling of class instances.
 First of all, the class must be defined at the top level in a module.
 Furthermore, all its instance variables must be picklable.
 
-\renewcommand{\indexsubitem}{(pickle protocol)}
+\setindexsubitem{(pickle protocol)}
 
 When a pickled class instance is unpickled, its \code{__init__()} method
 is normally \emph{not} invoked.  \strong{Note:} This is a deviation
@@ -144,35 +144,35 @@ definition is not pickled, but re-imported by the unpickling process.
 Therefore, the restriction that the class must be defined at the top
 level in a module applies to pickled classes as well.
 
-\renewcommand{\indexsubitem}{(in module pickle)}
+\setindexsubitem{(in module pickle)}
 
 The interface can be summarized as follows.
 
 To pickle an object \code{x} onto a file \code{f}, open for writing:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p = pickle.Pickler(f)
 p.dump(x)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 A shorthand for this is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pickle.dump(x, f)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 To unpickle an object \code{x} from a file \code{f}, open for reading:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 u = pickle.Unpickler(f)
 x = u.load()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 A shorthand is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 x = pickle.load(f)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The \code{Pickler} class only calls the method \code{f.write()} with a
 string argument.  The \code{Unpickler} calls the methods \code{f.read()}
index ddd467be95222e705f08a3ed5d7cdba814f6daa7..1754fef9b041d35048f2a96a31322a61ffa634bf 100644 (file)
@@ -28,7 +28,7 @@ for type errors, while errors reported by the system calls raise
 
 Module \code{posix} defines the following data items:
 
-\renewcommand{\indexsubitem}{(data in module posix)}
+\setindexsubitem{(data in module posix)}
 \begin{datadesc}{environ}
 A dictionary representing the string environment at the time
 the interpreter was started.
@@ -50,7 +50,7 @@ a mapping object that behaves almost like a dictionary but invokes
 \code{putenv()} automatically called whenever an item is changed.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(exception in module posix)}
+\setindexsubitem{(exception in module posix)}
 \begin{excdesc}{error}
 This exception is raised when a \POSIX{} function returns a
 \POSIX{}-related error (e.g., not for illegal argument types).  Its
@@ -64,7 +64,7 @@ names for the error codes defined by the underlying operating system.
 
 It defines the following functions and constants:
 
-\renewcommand{\indexsubitem}{(in module posix)}
+\setindexsubitem{(in module posix)}
 \begin{funcdesc}{chdir}{path}
 Change the current working directory to \var{path}.
 \end{funcdesc}
index 3d1fad1297db39eb700a657fc6be0988af023757..fc04d8d6c246b188c20594a4f6323504ae951140 100644 (file)
@@ -21,7 +21,7 @@ the same as a standard file object.
 
 The posixfile module defines the following constants:
 
-\renewcommand{\indexsubitem}{(in module posixfile)}
+\setindexsubitem{(in module posixfile)}
 \begin{datadesc}{SEEK_SET}
 offset is calculated from the start of the file
 \end{datadesc}
@@ -36,7 +36,7 @@ offset is calculated from the end of the file
 
 The posixfile module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module posixfile)}
+\setindexsubitem{(in module posixfile)}
 
 \begin{funcdesc}{open}{filename\optional{\, mode\optional{\, bufsize}}}
  Create a new posixfile object with the given filename and mode.  The
@@ -52,7 +52,7 @@ The posixfile module defines the following functions:
 
 The posixfile object defines the following additional methods:
 
-\renewcommand{\indexsubitem}{(posixfile method)}
+\setindexsubitem{(posixfile method)}
 \begin{funcdesc}{lock}{fmt\, \optional{len\optional{\, start\optional{\, whence}}}}
  Lock the specified section of the file that the file object is
  referring to.  The format is explained
@@ -146,7 +146,7 @@ by the same call.
 
 Examples:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 from posixfile import *
 
 file = open('/tmp/test', 'w')
@@ -154,4 +154,4 @@ file.lock('w|')
 ...
 file.lock('u')
 file.close()
-\end{verbatim}\ecode
+\end{verbatim}
index 52980120aea89f4d24ee3fc7cf25c461176db874..d286dcc9fa4f9695eac04decc5f00c16b73d5921 100644 (file)
@@ -8,7 +8,7 @@ This module implements some useful functions on \POSIX{} pathnames.
 module \code{os} and use \code{os.path}.
 \refstmodindex{os}
 
-\renewcommand{\indexsubitem}{(in module posixpath)}
+\setindexsubitem{(in module posixpath)}
 
 \begin{funcdesc}{basename}{p}
 Return the base name of pathname
index 9e14d5f5af28edb7878c8dddb78449612673ad07..caae69a2fa2462db68195f63cca32d2b634d9a3f 100644 (file)
@@ -19,7 +19,7 @@ to adjust the width constraint.
 
 The \code{pprint} module defines one class:
 
-\renewcommand{\indexsubitem}{(in module pprint)}
+\setindexsubitem{(in module pprint)}
 
 % First the implementation class:
 
@@ -140,7 +140,7 @@ l/lib/python1.4/test', '/usr/local/lib/python1.4/sunos5', '/usr/local/lib/python
 PrettyPrinter instances (returned by \code{PrettyPrinter()} above)
 have the following methods.
 
-\renewcommand{\indexsubitem}{(PrettyPrinter method)}
+\setindexsubitem{(PrettyPrinter method)}
 
 \begin{funcdesc}{pformat}{object}
 Return the formatted representation of \var{object}.  This takes into
index a3337446e003723fd9ef39ff8d248c470ad91ba3..20da0b6bd2041797a0400b23fdcb238b1b68e102 100644 (file)
@@ -106,10 +106,10 @@ rapidly perform profiling on an existing application.
 To profile an application with a main entry point of \samp{foo()}, you
 would add the following to your module:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import profile
 profile.run("foo()")
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The above action would cause \samp{foo()} to be run, and a series of
 informative lines (the profile) to be printed.  The above approach is
@@ -118,10 +118,10 @@ save the results of a profile into a file for later examination, you
 can supply a file name as the second argument to the \code{run()}
 function:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import profile
 profile.run("foo()", 'fooprof')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \code{profile.py} can also be invoked as
 a script to profile another script.  For example:
@@ -131,10 +131,10 @@ When you wish to review the profile, you should use the methods in the
 \code{pstats} module.  Typically you would load the statistics data as
 follows:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import pstats
 p = pstats.Stats('fooprof')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The class \code{Stats} (the above code just created an instance of
 this class) has a variety of methods for manipulating and printing the
@@ -142,9 +142,9 @@ data that was just read into \samp{p}.  When you ran
 \code{profile.run()} above, what was printed was the result of three
 method calls:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.strip_dirs().sort_stats(-1).print_stats()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The first method removed the extraneous path from all the module
 names. The second method sorted all the entries according to the
@@ -152,18 +152,18 @@ standard module/line/name string that is printed (this is to comply
 with the semantics of the old profiler).  The third method printed out
 all the statistics.  You might try the following sort calls:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('name')
 p.print_stats()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The first call will actually sort the list by function name, and the
 second call will print out the statistics.  The following are some
 interesting calls to experiment with:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('cumulative').print_stats(10)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This sorts the profile by cumulative time in a function, and then only
 prints the ten most significant lines.  If you want to understand what
@@ -172,26 +172,26 @@ algorithms are taking time, the above line is what you would use.
 If you were looking to see what functions were looping a lot, and
 taking a lot of time, you would do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('time').print_stats(10)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 to sort according to time spent within each function, and then print
 the statistics for the top ten functions.
 
 You might also try:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('file').print_stats('__init__')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This will sort all the statistics by file name, and then print out
 statistics for only the class init methods ('cause they are spelled
 with \code{__init__} in them).  As one final example, you could try:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('time', 'cum').print_stats(.5, 'init')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This line sorts statistics with a primary key of time, and a secondary
 key of cumulative time, and then prints out some of the statistics.
@@ -202,19 +202,19 @@ maintained, and that sub-sub-list is printed.
 If you wondered what functions called the above functions, you could
 now (\samp{p} is still sorted according to the last criteria) do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.print_callers(.5, 'init')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 and you would get a list of callers for each of the listed functions. 
 
 If you want more functionality, you're going to have to read the
 manual, or guess what the following functions do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.print_callees()
 p.add('fooprof')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{What Is Deterministic Profiling?}
 \nodename{Deterministic Profiling}
@@ -251,7 +251,7 @@ of algorithms to be directly compared to iterative implementations.
 
 \section{Reference Manual}
 
-\renewcommand{\indexsubitem}{(profiler function)}
+\setindexsubitem{(profiler function)}
 
 The primary entry point for the profiler is the global function
 \code{profile.run()}.  It is typically used to create any profile
@@ -273,7 +273,7 @@ function automatically prints a simple profiling report, sorted by the
 standard name string (file/line/function-name) that is presented in
 each line.  The following is a typical output from such a call:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
       main()
       2706 function calls (2004 primitive calls) in 4.504 CPU seconds
 
@@ -283,7 +283,7 @@ ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      2    0.006    0.003    0.953    0.477 pobject.py:75(save_objects)
   43/3    0.533    0.012    0.749    0.250 pobject.py:99(evaluate)
  ...
-\end{verbatim}\ecode
+\end{verbatim}
 
 The first line indicates that this profile was generated by the call:\\
 \code{profile.run('main()')}, and hence the exec'ed string is
@@ -348,7 +348,7 @@ need to be combined with data in an existing \code{Stats} object, the
 
 \subsection{The \sectcode{Stats} Class}
 
-\renewcommand{\indexsubitem}{(Stats method)}
+\setindexsubitem{(Stats method)}
 
 \begin{funcdesc}{strip_dirs}{}
 This method for the \code{Stats} class removes all leading path information
@@ -447,17 +447,17 @@ Python 1.5b1, this uses the Perl-style regular expression syntax
 defined by the \code{re} module).  If several restrictions are
 provided, then they are applied sequentially.  For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print_stats(.1, "foo:")
-\end{verbatim}\ecode
+\end{verbatim}
 %
 would first limit the printing to first 10\% of list, and then only
 print functions that were part of filename \samp{.*foo:}.  In
 contrast, the command:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print_stats("foo:", .1)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 would limit the list to all functions having file names \samp{.*foo:},
 and then proceed to only print the first 10\% of them.
@@ -487,10 +487,10 @@ returned by earlier methods.  All standard methods in this class
 return the instance that is being processed, so that the commands can
 be strung together.  For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pstats.Stats('foofile').strip_dirs().sort_stats('cum') \
                        .print_stats().ignore()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 would perform all the indicated functions, but it would not return
 the final reference to the \code{Stats} instance.%
@@ -551,27 +551,27 @@ function, and socking away the results.  The following procedure can
 be used to obtain this constant for a given platform (see discussion
 in section Limitations above).
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import profile
 pr = profile.Profile()
 pr.calibrate(100)
 pr.calibrate(100)
 pr.calibrate(100)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The argument to calibrate() is the number of times to try to do the
 sample calls to get the CPU times.  If your computer is \emph{very}
 fast, you might have to do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pr.calibrate(1000)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 or even:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pr.calibrate(10000)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The object of this exercise is to get a fairly consistent result.
 When you have a consistent answer, you are ready to use that number in
@@ -584,7 +584,7 @@ The following shows how the trace_dispatch() method in the Profile
 class should be modified to install the calibration constant on a Sun
 Sparcstation 1000:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def trace_dispatch(self, frame, event, arg):
     t = self.timer()
     t = t[0] + t[1] - self.t - .00053 # Calibration constant
@@ -596,14 +596,14 @@ def trace_dispatch(self, frame, event, arg):
         r = self.timer()
         self.t = r[0] + r[1] - t # put back unrecorded delta
     return
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Note that if there is no calibration constant, then the line
 containing the callibration constant should simply say:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 t = t[0] + t[1] - self.t  # no calibration constant
-\end{verbatim}\ecode
+\end{verbatim}
 %
 You can also achieve the same results using a derived class (and the
 profiler will actually run equally fast!!), but the above method is
@@ -632,9 +632,9 @@ timer function is used, then the basic class has an option for that in
 the constructor for the class.  Consider passing the name of a
 function to call into the constructor:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pr = profile.Profile(your_time_func)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The resulting profiler will call \code{your_time_func()} instead of
 \code{os.times()}.  The function should return either a single number
@@ -664,7 +664,7 @@ stats, and is quite useful when there is \emph{no} recursion in the
 user's code.  It is also a lot more accurate than the old profiler, as
 it does not charge all its overhead time to the user's code.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class OldProfile(Profile):
 
     def trace_dispatch_exception(self, frame, t):
@@ -714,7 +714,7 @@ class OldProfile(Profile):
                       callers[func_caller]
                 nc = nc + callers[func_caller]
             self.stats[nor_func] = nc, nc, tt, ct, nor_callers
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \subsection{HotProfile Class}
 
@@ -725,7 +725,7 @@ function, so it runs very quickly (re: very low overhead).  In truth,
 the basic profiler is so fast, that is probably not worth the savings
 to give up the data, but this class still provides a nice example.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class HotProfile(Profile):
 
     def trace_dispatch_exception(self, frame, t):
@@ -761,4 +761,4 @@ class HotProfile(Profile):
             nc, tt = self.timings[func]
             nor_func = self.func_normalize(func)
             self.stats[nor_func] = nc, nc, tt, 0, {}
-\end{verbatim}\ecode
+\end{verbatim}
index 82ebd6164d0e56859ed7b05ff1f715ad56ca5afc..8e1fd2bb7e2d8c81dec510431005b90f861a7106 100644 (file)
@@ -19,7 +19,7 @@ A \code{KeyError} exception is raised if the entry asked for cannot be found.
 
 It defines the following items:
 
-\renewcommand{\indexsubitem}{(in module pwd)}
+\setindexsubitem{(in module pwd)}
 \begin{funcdesc}{getpwuid}{uid}
 Return the password database entry for the given numeric user ID.
 \end{funcdesc}
index 43f48acfc49c0bfab11a7ac582003596e3fbb78c..f6aa31e59555539a86968fe5a7b01d3c185d57e5 100644 (file)
@@ -18,7 +18,7 @@ Python.
 
 The \code{Queue} module defines the following exception:
 
-\renewcommand{\indexsubitem}{(in module Queue)}
+\setindexsubitem{(in module Queue)}
 
 \begin{excdesc}{Empty}
 Exception raised when non-blocking get (e.g. \code{get_nowait()}) is
@@ -35,7 +35,7 @@ other queue organizations (e.g. stack) but the inheritable interface
 is not described here.  See the source code for details.  The public
 interface methods are:
 
-\renewcommand{\indexsubitem}{(__init__ method)}
+\setindexsubitem{(__init__ method)}
 
 \begin{funcdesc}{__init__}{maxsize}
 Constructor for the class.  \var{maxsize} is an integer that sets the
@@ -45,41 +45,41 @@ queue items are consumed.  If \var{maxsize} is less than or equal to
 zero, the queue size is infinite.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(qsize method)}
+\setindexsubitem{(qsize method)}
 
 \begin{funcdesc}{qsize}{}
 Returns the approximate size of the queue.  Because of multithreading
 semantics, this number is not reliable.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(empty method)}
+\setindexsubitem{(empty method)}
 
 \begin{funcdesc}{empty}{}
 Returns 1 if the queue is empty, 0 otherwise.  Because of
 multithreading semantics, this is not reliable.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(full method)}
+\setindexsubitem{(full method)}
 
 \begin{funcdesc}{full}{}
 Returns 1 if the queue is full, 0 otherwise.  Because of
 multithreading semantics, this is not reliable.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(put method)}
+\setindexsubitem{(put method)}
 
 \begin{funcdesc}{put}{item}
 Puts \var{item} into the queue.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(get method)}
+\setindexsubitem{(get method)}
 
 \begin{funcdesc}{get}{}
 Gets and returns an item from the queue, blocking if necessary until
 one is available.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(get_nowait method)}
+\setindexsubitem{(get_nowait method)}
 
 \begin{funcdesc}{get_nowait}{}
 Gets and returns an item from the queue if one is immediately
index d1cb29719f77d04ed519c5c4473ec7bd288429fa..4ad0c0f91cc47d288d74d9e0526b6d54f5654404 100644 (file)
@@ -11,7 +11,7 @@ are many such characters, as when sending a graphics file.
 \indexii{quoted printable}{encoding}
 \index{MIME!quoted-printable encoding}
 
-\renewcommand{\indexsubitem}{(in module quopri)}
+\setindexsubitem{(in module quopri)}
 
 \begin{funcdesc}{decode}{input\, output}
 Decode the contents of the \var{input} file and write the resulting
index 4ba5f17224f47d6bc18ac302b2d2dbf8d83384b0..07d309eded951421c8c91a968498add9ff20f836 100644 (file)
@@ -8,7 +8,7 @@ given library's implementation.  While still supported for
 compatibility, the \code{rand} module is now considered obsolete; if
 possible, use the \code{whrandom} module instead.
 
-\renewcommand{\indexsubitem}{(in module rand)}
+\setindexsubitem{(in module rand)}
 
 \begin{funcdesc}{choice}{seq}
 Returns a random element from the sequence \var{seq}.
index 7b2909237dae1dba38166a6da1b227a15352e919..ab4527fe3728ecaa33c23479872d78785a74d09d 100644 (file)
@@ -19,7 +19,7 @@ after the corresponding variables in the distribution's equation, as
 used in common mathematical practice; most of these equations can be
 found in any statistics text.
 
-\renewcommand{\indexsubitem}{(in module random)}
+\setindexsubitem{(in module random)}
 \begin{funcdesc}{betavariate}{alpha\, beta}
 Beta distribution.  Conditions on the parameters are \code{alpha>-1}
 and \code{beta>-1}.
index 3c288d1f5861c89a1c01f35c9673d966aab60f63..55125ecd778e83e6239a5a664909565ff2572744 100644 (file)
@@ -258,7 +258,7 @@ for the current locale.
 
 The module defines the following functions and constants, and an exception:
 
-\renewcommand{\indexsubitem}{(in module re)}
+\setindexsubitem{(in module re)}
 
 \begin{funcdesc}{compile}{pattern\optional{\, flags}}
   Compile a regular expression pattern into a regular expression
@@ -313,10 +313,10 @@ leftmost such \code{\#} through the end of the line are ignored.
 
 The sequence
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 prog = re.compile(pat)
 result = prog.match(str)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is equivalent to
 
@@ -365,14 +365,14 @@ expression will be used several times in a single program.
   1.5 release, \var{maxsplit} was ignored.  This has been fixed in
   later releases.)
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> re.split('[\W]+', 'Words, words, words.')
 ['Words', 'words', 'words', '']
 >>> re.split('([\W]+)', 'Words, words, words.')
 ['Words', ', ', 'words', ', ', 'words', '.', '']
 >>> re.split('[\W]+', 'Words, words, words.', 1)
 ['Words', 'words, words.']
-\end{verbatim}\ecode
+\end{verbatim}
 %
   This function combines and extends the functionality of
   the old \code{regsub.split()} and \code{regsub.splitx()}.
@@ -387,13 +387,13 @@ it is called for every non-overlapping occurance of \var{pattern}.
 The function takes a single match object argument, and returns the
 replacement string.  For example:
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> def dashrepl(matchobj):
 ...    if matchobj.group(0) == '-': return ' '
 ...    else: return '-'
 >>> re.sub('-{1,2}', dashrepl, 'pro----gram-files')
 'pro--gram files'
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The pattern may be a string or a 
 regex object; if you need to specify
@@ -428,7 +428,7 @@ Perform the same operation as \code{sub()}, but return a tuple
 Compiled regular expression objects support the following methods and
 attributes:
 
-\renewcommand{\indexsubitem}{(re method)}
+\setindexsubitem{(re method)}
 \begin{funcdesc}{match}{string\optional{\, pos}\optional{\, endpos}}
   If zero or more characters at the beginning of \var{string} match
   this regular expression, return a corresponding
@@ -469,7 +469,7 @@ Identical to the \code{sub()} function, using the compiled pattern.
 Identical to the \code{subn()} function, using the compiled pattern.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(regex attribute)}
+\setindexsubitem{(regex attribute)}
 
 \begin{datadesc}{flags}
 The flags argument used when the regex object was compiled, or 0 if no
index 00005e2396aa08a8271006e8b9dc93976cd64b43..18b8b186759ea440cdd88cd19da0e787e65b8287 100644 (file)
@@ -186,7 +186,7 @@ the string.
 
 The module defines these functions, and an exception:
 
-\renewcommand{\indexsubitem}{(in module regex)}
+\setindexsubitem{(in module regex)}
 
 \begin{funcdesc}{match}{pattern\, string}
   Return how many characters at the beginning of \var{string} match
@@ -215,16 +215,16 @@ The module defines these functions, and an exception:
 
   The sequence
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 prog = regex.compile(pat)
 result = prog.match(str)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is equivalent to
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 result = regex.match(pat, str)
-\end{verbatim}\ecode
+\end{verbatim}
 
 but the version using \code{compile()} is more efficient when multiple
 regular expressions are used concurrently in a single program.  (The
@@ -274,7 +274,7 @@ equivalents.
 \noindent
 Compiled regular expression objects support these methods:
 
-\renewcommand{\indexsubitem}{(regex method)}
+\setindexsubitem{(regex method)}
 \begin{funcdesc}{match}{string\optional{\, pos}}
   Return how many characters at the beginning of \var{string} match
   the compiled regular expression.  Return \code{-1} if the string
@@ -319,7 +319,7 @@ identifying groups by their group name.
 \noindent
 Compiled regular expressions support these data attributes:
 
-\renewcommand{\indexsubitem}{(regex attribute)}
+\setindexsubitem{(regex attribute)}
 
 \begin{datadesc}{regs}
 When the last call to the \code{match()} or \code{search()} method found a
index 48cff87d2f8fd3d1e13532cf71f4ee088d6f05ef..5158d5372384d83ae7e24e35e666853b93ef3ce8 100644 (file)
@@ -18,7 +18,7 @@ expressions to \module{re} style regular expressions.  (For more
 conversion help, see the URL
 \url{http://starship.skyport.net/crew/amk/regex/regex-to-re.html}.)
 
-\renewcommand{\indexsubitem}{(in module regsub)}
+\setindexsubitem{(in module regsub)}
 
 \begin{funcdesc}{sub}{pat\, repl\, str}
 Replace the first occurrence of pattern \var{pat} in string
index 7af4368120487e733169b9ed97cf0dd3f921ae88..6260a202172a804091148ecd1de7d746f42206ef 100644 (file)
@@ -11,7 +11,7 @@ children.
 
 A single exception is defined for errors:
 
-\renewcommand{\indexsubitem}{(in module resource)}
+\setindexsubitem{(in module resource)}
 
 \begin{excdesc}{error}
   The functions described below may raise this error if the underlying
index 742e32bad5be4edcbe19e2eaa8985e7ca88611bf..4ea3f3cbb4fe1d8a99e05183c490060b9b814ba9 100644 (file)
@@ -1,60 +1,60 @@
 \section{Standard Module \sectcode{rexec}}
 \label{module-rexec}
 \stmodindex{rexec}
-\renewcommand{\indexsubitem}{(in module rexec)}
+\setindexsubitem{(in module rexec)}
 
-This module contains the \code{RExec} class, which supports
+This module contains the \class{RExec} class, which supports
 \code{r_exec()}, \code{r_eval()}, \code{r_execfile()}, and
 \code{r_import()} methods, which are restricted versions of the standard
 Python functions \code{exec()}, \code{eval()}, \code{execfile()}, and
 the \code{import} statement.
 Code executed in this restricted environment will
 only have access to modules and functions that are deemed safe; you
-can subclass \code{RExec} to add or remove capabilities as desired.
+can subclass \class{RExec} to add or remove capabilities as desired.
 
-\emph{Note:} The \code{RExec} class can prevent code from performing
+\emph{Note:} The \class{RExec} class can prevent code from performing
 unsafe operations like reading or writing disk files, or using TCP/IP
 sockets.  However, it does not protect against code using extremely
 large amounts of memory or CPU time.  
 
 \begin{funcdesc}{RExec}{\optional{hooks\optional{\, verbose}}}
-Returns an instance of the \code{RExec} class.  
+Returns an instance of the \class{RExec} class.  
 
 \var{hooks} is an instance of the \code{RHooks} class or a subclass of it.
 If it is omitted or \code{None}, the default \code{RHooks} class is
 instantiated.
-Whenever the RExec module searches for a module (even a built-in one)
-or reads a module's code, it doesn't actually go out to the file
-system itself.  Rather, it calls methods of an RHooks instance that
-was passed to or created by its constructor.  (Actually, the RExec
-object doesn't make these calls---they are made by a module loader
-object that's part of the RExec object.  This allows another level of
-flexibility, e.g. using packages.)
-
-By providing an alternate RHooks object, we can control the
+Whenever the \module{RExec} module searches for a module (even a
+built-in one) or reads a module's code, it doesn't actually go out to
+the file system itself.  Rather, it calls methods of an \class{RHooks}
+instance that was passed to or created by its constructor.  (Actually,
+the \class{RExec} object doesn't make these calls --- they are made by
+a module loader object that's part of the \class{RExec} object.  This
+allows another level of flexibility, e.g. using packages.)
+
+By providing an alternate \class{RHooks} object, we can control the
 file system accesses made to import a module, without changing the
 actual algorithm that controls the order in which those accesses are
-made.  For instance, we could substitute an RHooks object that passes
-all filesystem requests to a file server elsewhere, via some RPC
-mechanism such as ILU.  Grail's applet loader uses this to support
+made.  For instance, we could substitute an \class{RHooks} object that
+passes all filesystem requests to a file server elsewhere, via some
+RPC mechanism such as ILU.  Grail's applet loader uses this to support
 importing applets from a URL for a directory.
 
 If \var{verbose} is true, additional debugging output may be sent to
 standard output.
 \end{funcdesc}
 
-The RExec class has the following class attributes, which are used by the
-\code{__init__} method.  Changing them on an existing instance won't
-have any effect; instead, create a subclass of \code{RExec} and assign
-them new values in the class definition.  Instances of the new class
-will then use those new values.  All these attributes are tuples of
-strings.
+The \class{RExec} class has the following class attributes, which are
+used by the \code{__init__()} method.  Changing them on an existing
+instance won't have any effect; instead, create a subclass of
+\class{RExec} and assign them new values in the class definition.
+Instances of the new class will then use those new values.  All these
+attributes are tuples of strings.
 
-\renewcommand{\indexsubitem}{(RExec object attribute)}
+\setindexsubitem{(RExec object attribute)}
 \begin{datadesc}{nok_builtin_names}
 Contains the names of built-in functions which will \emph{not} be
 available to programs running in the restricted environment.  The
-value for \code{RExec} is \code{('open',} \code{'reload',}
+value for \class{RExec} is \code{('open',} \code{'reload',}
 \code{'__import__')}.  (This gives the exceptions, because by far the
 majority of built-in functions are harmless.  A subclass that wants to
 override this variable should probably start with the value from the
@@ -65,7 +65,7 @@ added to this module.)
 
 \begin{datadesc}{ok_builtin_modules}
 Contains the names of built-in modules which can be safely imported.
-The value for \code{RExec} is \code{('audioop',} \code{'array',}
+The value for \class{RExec} is \code{('audioop',} \code{'array',}
 \code{'binascii',} \code{'cmath',} \code{'errno',} \code{'imageop',}
 \code{'marshal',} \code{'math',} \code{'md5',} \code{'operator',}
 \code{'parser',} \code{'regex',} \code{'rotor',} \code{'select',}
@@ -77,7 +77,7 @@ class as a starting point.
 \begin{datadesc}{ok_path}
 Contains the directories which will be searched when an \code{import}
 is performed in the restricted environment.  
-The value for \code{RExec} is the same as \code{sys.path} (at the time
+The value for \class{RExec} is the same as \code{sys.path} (at the time
 the module is loaded) for unrestricted code.
 \end{datadesc}
 
@@ -85,7 +85,7 @@ the module is loaded) for unrestricted code.
 % Should this be called ok_os_names?
 Contains the names of the functions in the \code{os} module which will be
 available to programs running in the restricted environment.  The
-value for \code{RExec} is \code{('error',} \code{'fstat',}
+value for \class{RExec} is \code{('error',} \code{'fstat',}
 \code{'listdir',} \code{'lstat',} \code{'readlink',} \code{'stat',}
 \code{'times',} \code{'uname',} \code{'getpid',} \code{'getppid',}
 \code{'getcwd',} \code{'getuid',} \code{'getgid',} \code{'geteuid',}
@@ -95,13 +95,13 @@ value for \code{RExec} is \code{('error',} \code{'fstat',}
 \begin{datadesc}{ok_sys_names}
 Contains the names of the functions and variables in the \code{sys}
 module which will be available to programs running in the restricted
-environment.  The value for \code{RExec} is \code{('ps1',}
+environment.  The value for \class{RExec} is \code{('ps1',}
 \code{'ps2',} \code{'copyright',} \code{'version',} \code{'platform',}
 \code{'exit',} \code{'maxint')}.
 \end{datadesc}
 
-RExec instances support the following methods:
-\renewcommand{\indexsubitem}{(RExec object method)}
+\class{RExec} instances support the following methods:
+\setindexsubitem{(RExec object method)}
 
 \begin{funcdesc}{r_eval}{code}
 \var{code} must either be a string containing a Python expression, or
@@ -141,7 +141,7 @@ Execute the Python code contained in the file \var{filename} in the
 restricted environment.
 \end{funcdesc}
 
-\code{RExec} objects must also support various methods which will be
+\class{RExec} objects must also support various methods which will be
 implicitly called by code executing in the restricted environment.
 Overriding these methods in a subclass is used to change the policies
 enforced by a restricted environment.
@@ -155,7 +155,7 @@ exception if the module is considered unsafe.
 Method called when \code{open()} is called in the restricted
 environment.  The arguments are identical to those of \code{open()},
 and a file object (or a class instance compatible with file objects)
-should be returned.  \code{RExec}'s default behaviour is allow opening
+should be returned.  \class{RExec}'s default behaviour is allow opening
 any file for reading, but forbidding any attempt to write a file.  See
 the example below for an implementation of a less restrictive
 \code{r_open()}.
@@ -173,7 +173,7 @@ restricted environment's \code{sys.modules} dictionary).
 And their equivalents with access to restricted standard I/O streams:
 
 \begin{funcdesc}{s_import}{modulename\optional{\, globals, locals, fromlist}}
-Import the module \var{modulename}, raising an \code{ImportError}
+Import the module \var{modulename}, raising an \exception{ImportError}
 exception if the module is considered unsafe.
 \end{funcdesc}
 
@@ -189,10 +189,11 @@ Unload the module object \var{module}.
 \subsection{An example}
 
 Let us say that we want a slightly more relaxed policy than the
-standard RExec class.  For example, if we're willing to allow files in
-\file{/tmp} to be written, we can subclass the \code{RExec} class:
+standard \class{RExec} class.  For example, if we're willing to allow
+files in \file{/tmp} to be written, we can subclass the \class{RExec}
+class:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class TmpWriterRExec(rexec.RExec):
     def r_open(self, file, mode='r', buf=-1):
         if mode in ('r', 'rb'):
@@ -206,7 +207,7 @@ class TmpWriterRExec(rexec.RExec):
                 raise IOError, "'..' in filename forbidden"
         else: raise IOError, "Illegal open() mode"
         return open(file, mode, buf)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Notice that the above code will occasionally forbid a perfectly valid
 filename; for example, code in the restricted environment won't be
index 78bbabd0b04a28ba248afdd9722cde775136d838..137475522755f6d38ab2844c858e7ca6419c8d43 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-rfc822}
 \stmodindex{rfc822}
 
-\renewcommand{\indexsubitem}{(in module rfc822)}
+\setindexsubitem{(in module rfc822)}
 
 This module defines a class, \code{Message}, which represents a
 collection of ``email headers'' as defined by the Internet standard
index d923fc28e8c1cbd5cc60d87f531861f816a6855a..9432d2e696764dffdd32a758912165a92ed17352 100644 (file)
@@ -9,7 +9,7 @@ is enough in some cases.  Currently, colormap files are not supported.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module rgbimg)}
+\setindexsubitem{(in module rgbimg)}
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unsupported file type, etc.
 \end{excdesc}
index 4999c812aa2b16e990ea0a1f598f85493ec4fa40..d2a8460122ad1cf2a5212307fb39730454ead823 100644 (file)
@@ -24,7 +24,7 @@ order.
 
 The available functions in this module are:
 
-\renewcommand{\indexsubitem}{(in module rotor)}
+\setindexsubitem{(in module rotor)}
 \begin{funcdesc}{newrotor}{key\optional{\, numrotors}}
 Return a rotor object. \var{key} is a string containing the encryption key
 for the object; it can contain arbitrary binary data. The key will be used
@@ -35,7 +35,7 @@ if it is omitted, a default value of 6 will be used.
 
 Rotor objects have the following methods:
 
-\renewcommand{\indexsubitem}{(rotor method)}
+\setindexsubitem{(rotor method)}
 \begin{funcdesc}{setkey}{key}
 Sets the rotor's key to \var{key}.
 \end{funcdesc}
@@ -63,7 +63,7 @@ string containing the ciphertext.
 \end{funcdesc}
 
 An example usage:
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import rotor
 >>> rt = rotor.newrotor('key', 12)
 >>> rt.encrypt('bar')
@@ -79,7 +79,7 @@ An example usage:
 >>> rt.decrypt('\357\375$')
 'l(\315'
 >>> del rt
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module's code is not an exact simulation of the original Enigma device;
 it implements the rotor encryption scheme differently from the original. The
index 4291dbfae4f315b3145bbafff5e714e94a1d54eb..956bf7f3c0de9067d25410ffebc7013c79e38717 100644 (file)
@@ -5,7 +5,7 @@
 This module provides access to the function \code{select} available in
 most \UNIX{} versions.  It defines the following:
 
-\renewcommand{\indexsubitem}{(in module select)}
+\setindexsubitem{(in module select)}
 \begin{excdesc}{error}
 The exception raised when an error occurs.  The accompanying value is
 a pair containing the numeric error code from \code{errno} and the
index 5269f2009e61964371a6abd1797b006d8a0a068c..c63e7282260c31734cf27831f577e3de3403ac26 100644 (file)
@@ -36,7 +36,7 @@ spaces, tabs, and newlines are allowed between the trailing
 The \code{SGMLParser} class must be instantiated without arguments.
 It has the following interface methods:
 
-\renewcommand{\indexsubitem}{(SGMLParser method)}
+\setindexsubitem{(SGMLParser method)}
 
 \begin{funcdesc}{reset}{}
 Reset the instance.  Loses all unprocessed data.  This is called
index 25ced0e53db22d1d9842224e534f0d82ae870b49..434953470fc788cc70aa4337f605b691433faaad 100644 (file)
@@ -13,7 +13,7 @@ sub-objects.  The keys are ordinary strings.
 To summarize the interface (\code{key} is a string, \code{data} is an
 arbitrary object):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import shelve
 
 d = shelve.open(filename) # open, with (g)dbm filename -- no suffix
@@ -28,7 +28,7 @@ flag = d.has_key(key)   # true if the key exists
 list = d.keys() # a list of all existing keys (slow!)
 
 d.close()       # close it
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Restrictions:
 
index cbec56fddd4bd946b26c6e85e3bc5d532c0fbe46..39286a7ff920e41f4d9f7e3300f7b7b816a9a87c 100644 (file)
@@ -62,7 +62,7 @@ communication.  Use locks instead.
 
 The variables defined in the \module{signal} module are:
 
-\renewcommand{\indexsubitem}{(in module signal)}
+\setindexsubitem{(in module signal)}
 \begin{datadesc}{SIG_DFL}
   This is one of two standard signal handling options; it will simply
   perform the default function for the signal.  For example, on most
index 7e80b08a6a99e2ee6cc07baa608549cd7ab9ecc3..ba3e23df71610722efe7b56c37711f6d33a83db4 100644 (file)
@@ -6,7 +6,7 @@
 
 In earlier versions of Python (up to and including 1.5a3), scripts or
 modules that needed to use site-specific modules would place
-\code{import site} somewhere near the top of their code.  This is no
+\samp{import site} somewhere near the top of their code.  This is no
 longer necessary.
 
 This will append site-specific paths to to the module search path.
@@ -42,29 +42,29 @@ set to \file{/usr/local}.  The Python 1.5 library is then installed in
 files, \file{foo.pth} and \file{bar.pth}.  Assume \file{foo.pth}
 contains the following:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 # foo package configuration
 
 foo
 bar
 bletch
-\end{verbatim}\ecode
+\end{verbatim}
 
 and \file{bar.pth} contains:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 # bar package configuration
 
 bar
-\end{verbatim}\ecode
+\end{verbatim}
 
 Then the following directories are added to \code{sys.path}, in this
 order:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 /usr/local/python1.5/site-packages/bar
 /usr/local/python1.5/site-packages/foo
-\end{verbatim}\ecode
+\end{verbatim}
 
 Note that \file{bletch} is omitted because it doesn't exist; the
 \file{bar} directory precedes the \file{foo} directory because
index 41b27f957fe6ecb9c6a2bfc7a89e8026c79e54f1..9b71f1f65aac370829b8e17d7d6d5462ee6aa2a8 100644 (file)
@@ -47,7 +47,7 @@ method.
 
 The module \code{socket} exports the following constants and functions:
 
-\renewcommand{\indexsubitem}{(in module socket)}
+\setindexsubitem{(in module socket)}
 \begin{excdesc}{error}
 This exception is raised for socket- or address-related errors.
 The accompanying value is either a string telling what went wrong or a
@@ -190,7 +190,7 @@ Socket objects have the following methods.  Except for
 \code{makefile()} these correspond to \UNIX{} system calls applicable to
 sockets.
 
-\renewcommand{\indexsubitem}{(socket method)}
+\setindexsubitem{(socket method)}
 \begin{funcdesc}{accept}{}
 Accept a connection.
 The socket must be bound to an address and listening for connections.
@@ -343,7 +343,7 @@ Also note that the server does not \code{send}/\code{receive} on the
 socket it is listening on but on the new socket returned by
 \code{accept}.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 # Echo server program
 from socket import *
 HOST = ''                 # Symbolic name meaning the local host
@@ -358,9 +358,9 @@ while 1:
     if not data: break
     conn.send(data)
 conn.close()
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 # Echo client program
 from socket import *
 HOST = 'daring.cwi.nl'    # The remote host
@@ -371,7 +371,7 @@ s.send('Hello, world')
 data = s.recv(1024)
 s.close()
 print 'Received', `data`
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \begin{seealso}
 \seemodule{SocketServer}{classes that simplify writing network servers}
index 98ffec66fbffaa4993d36eb034dae66f4d064395..c4b0e736a91a33cd9ae3f1f94aca4967d3641e8e 100644 (file)
@@ -37,7 +37,7 @@ many requests.
 Server classes have the same external methods and attributes, no
 matter what network protocol they use:
 
-\renewcommand{\indexsubitem}{(SocketServer protocol)}
+\setindexsubitem{(SocketServer protocol)}
 
 %XXX should data and methods be intermingled, or separate?
 % how should the distinction between class and instance variables be
index 27d9bf3d3cb1e76c9b20faa87f7ea710d1fd41c8..dc908e7c7e77c6f992ef6c8e9e521b8c293f02c5 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-soundex}
 \bimodindex{soundex}
 
-\renewcommand{\indexsubitem}{(in module soundex)}
+\setindexsubitem{(in module soundex)}
 The soundex algorithm takes an English word, and returns an
 easily-computed hash of it; this hash is intended to be the same for
 words that sound alike.  This module provides an interface to the
index 385672350fb870d2b589d2de6bd4963b1eaa914a..3030fc6e693331d4aa0b6e3328ce79841c4b404b 100644 (file)
@@ -11,7 +11,7 @@ calls, consult your local man pages.
 
 The \code{stat} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module stat)}
+\setindexsubitem{(in module stat)}
 
 \begin{funcdesc}{S_ISDIR}{mode}
 Return non-zero if the mode was gotten from a directory.
@@ -86,7 +86,7 @@ Time of creation.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import os, sys
 from stat import *
 
@@ -108,4 +108,4 @@ def f(file):
     print 'frobbed', file
 
 if __name__ == '__main__': process(sys.argv[1], f)
-\end{verbatim}\ecode
+\end{verbatim}
index 39d6d6dd229cbf9f39a4d458b5eabea8fe68f077..6a0b58d2d0302ab83b9155ce8fe102bee3598913 100644 (file)
@@ -36,7 +36,7 @@ of STDWIN for C programmers (aforementioned CWI report).
 
 The following functions are defined in the \code{stdwin} module:
 
-\renewcommand{\indexsubitem}{(in module stdwin)}
+\setindexsubitem{(in module stdwin)}
 \begin{funcdesc}{open}{title}
 Open a new window whose initial title is given by the string argument.
 Return a window object; window object methods are described below.%
@@ -118,14 +118,14 @@ Return the pixel value corresponding to the given color name.
 Return the default foreground color for unknown color names.
 Hint: the following code tests whether you are on a machine that
 supports more than two colors:
-\bcode\begin{verbatim}
+\begin{verbatim}
 if stdwin.fetchcolor('black') <> \
           stdwin.fetchcolor('red') <> \
           stdwin.fetchcolor('white'):
     print 'color machine'
 else:
     print 'monochrome machine'
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{setfgcolor}{pixel}
@@ -316,7 +316,7 @@ Window objects are created by \code{stdwin.open()}.  They are closed
 by their \code{close()} method or when they are garbage-collected.
 Window objects have the following methods:
 
-\renewcommand{\indexsubitem}{(window method)}
+\setindexsubitem{(window method)}
 
 \begin{funcdesc}{begindrawing}{}
 Return a drawing object, whose methods (described below) allow drawing
@@ -467,7 +467,7 @@ No drawing object may exist when
 is called.
 Drawing objects have the following methods:
 
-\renewcommand{\indexsubitem}{(drawing method)}
+\setindexsubitem{(drawing method)}
 
 \begin{funcdesc}{box}{rect}
 Draw a box just inside a rectangle.
@@ -605,7 +605,7 @@ A menu object represents a menu.
 The menu is destroyed when the menu object is deleted.
 The following methods are defined:
 
-\renewcommand{\indexsubitem}{(menu method)}
+\setindexsubitem{(menu method)}
 
 \begin{funcdesc}{additem}{text\, shortcut}
 Add a menu item with given text.
@@ -643,7 +643,7 @@ Bitmaps are currently not available on the Macintosh.
 
 The following methods are defined:
 
-\renewcommand{\indexsubitem}{(bitmap method)}
+\setindexsubitem{(bitmap method)}
 
 \begin{funcdesc}{getsize}{}
 Return a tuple representing the width and height of the bitmap.
@@ -669,7 +669,7 @@ A text-edit object represents a text-edit block.
 For semantics, see the STDWIN documentation for C programmers.
 The following methods exist:
 
-\renewcommand{\indexsubitem}{(text-edit method)}
+\setindexsubitem{(text-edit method)}
 
 \begin{funcdesc}{arrow}{code}
 Pass an arrow event to the text-edit block.
@@ -756,7 +756,7 @@ left corner of the window.
 The window will be correctly redrawn when covered and re-exposed.
 The program quits when the close icon or menu item is requested.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import stdwin
 from stdwinevents import *
 
@@ -773,7 +773,7 @@ def main():
             break
 
 main()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{stdwinevents}}
 \stmodindex{stdwinevents}
@@ -784,10 +784,10 @@ and selection types (\code{WS_PRIMARY} etc.).
 Read the file for details.
 Suggested usage is
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> from stdwinevents import *
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{rect}}
 \stmodindex{rect}
@@ -798,9 +798,9 @@ A rectangle is defined as in module
 a pair of points, where a point is a pair of integers.
 For example, the rectangle
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 (10, 20), (90, 80)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is a rectangle whose left, top, right and bottom edges are 10, 20, 90
 and 80, respectively.
@@ -809,7 +809,7 @@ Note that the positive vertical axis points down (as in
 
 The module defines the following objects:
 
-\renewcommand{\indexsubitem}{(in module rect)}
+\setindexsubitem{(in module rect)}
 \begin{excdesc}{error}
 The exception raised by functions in this module when they detect an
 error.
@@ -821,7 +821,7 @@ detail.
 The rectangle returned when some operations return an empty result.
 This makes it possible to quickly check whether a result is empty:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import rect
 >>> r1 = (10, 20), (90, 80)
 >>> r2 = (0, 0), (10, 20)
@@ -829,7 +829,7 @@ This makes it possible to quickly check whether a result is empty:
 >>> if r3 is rect.empty: print 'Empty intersection'
 Empty intersection
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 \end{datadesc}
 
 \begin{funcdesc}{is_empty}{r}
index 19118012afb8a7e9b30caefdc967635d88ce4b7c..7242c5332359082faa49b6864756d6a9c81b20d8 100644 (file)
@@ -10,7 +10,7 @@ classes and some useful string functions.  See the module
 
 The constants defined in this module are are:
 
-\renewcommand{\indexsubitem}{(data in module string)}
+\setindexsubitem{(data in module string)}
 \begin{datadesc}{digits}
   The string \code{'0123456789'}.
 \end{datadesc}
@@ -54,7 +54,7 @@ The constants defined in this module are are:
 
 The functions defined in this module are:
 
-\renewcommand{\indexsubitem}{(in module string)}
+\setindexsubitem{(in module string)}
 
 \begin{funcdesc}{atof}{s}
 Convert a string to a floating point number.  The string must have
index 19f674c99b73986c4f3c9552fde6b367b849549b..2ed4f2c53668fb2cb06e0c063d0b7cb768b23f0d 100644 (file)
@@ -13,7 +13,7 @@ See also built-in module \code{array}.
 
 The module defines the following exception and functions:
 
-\renewcommand{\indexsubitem}{(in module struct)}
+\setindexsubitem{(in module struct)}
 \begin{excdesc}{error}
   Exception raised on various occasions; argument is a string
   describing what is wrong.
@@ -120,7 +120,7 @@ byte-swapping); use the appropriate choice of \code{'<'} or
 Examples (all using native byte order, size and alignment, on a
 big-endian machine):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> from struct import *
 >>> pack('hhl', 1, 2, 3)
 '\000\001\000\002\000\000\000\003'
@@ -129,7 +129,7 @@ big-endian machine):
 >>> calcsize('hhl')
 8
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Hint: to align the end of a structure to the alignment requirement of
 a particular type, end the format with the code for that type with a
index a579872a7bdcec960dcf5fb956b558343189e813..f6d99944eeb24bdc235b15d789a2b8b8152df110 100644 (file)
@@ -14,7 +14,7 @@ description can be gotten with \samp{man audio}.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module sunaudiodev)}
+\setindexsubitem{(in module sunaudiodev)}
 \begin{excdesc}{error}
 This exception is raised on all errors. The argument is a string
 describing what went wrong.
@@ -36,7 +36,7 @@ The audio device objects are returned by \code{open} define the
 following methods (except \code{control} objects which only provide
 getinfo, setinfo and drain):
 
-\renewcommand{\indexsubitem}{(audio device method)}
+\setindexsubitem{(audio device method)}
 
 \begin{funcdesc}{close}{}
 This method explicitly closes the device. It is useful in situations
index e63e616f946e71bae821f0a3c9554a5edc420005..f7bc8e25f3d8e4a4a93fd2d05cf0b9ef2374fc0a 100644 (file)
@@ -6,7 +6,7 @@ This module provides access to some variables used or maintained by the
 interpreter and to functions that interact strongly with the interpreter.
 It is always available.
 
-\renewcommand{\indexsubitem}{(in module sys)}
+\setindexsubitem{(in module sys)}
 
 \begin{datadesc}{argv}
   The list of command line arguments passed to a Python script.
@@ -81,10 +81,10 @@ installed; by default, this is also \code{"/usr/local"}.  This can be
 set at build time with the \code{--exec-prefix} argument to the
 \code{configure} script.  Specifically, all configuration files
 (e.g. the \code{config.h} header file) are installed in the directory
-\code{sys.exec_prefix+"/lib/python\emph{VER}/config"}, and shared library
+\code{sys.exec_prefix+"/lib/python\var{version}/config"}, and shared library
 modules are installed in
-\code{sys.exec_prefix+"/lib/python\emph{VER}/lib-dynload"},
-where \emph{VER} is equal to \code{sys.version[:3]}.
+\code{sys.exec_prefix+"/lib/python\var{version}/lib-dynload"},
+where \var{version} is equal to \code{sys.version[:3]}.
 \end{datadesc}
 
 \begin{funcdesc}{exit}{n}
@@ -162,10 +162,10 @@ independent Python files are installed; by default, this is the string
 \code{"/usr/local"}.  This can be set at build time with the
 \code{--prefix} argument to the \code{configure} script.  The main
 collection of Python library modules is installed in the directory
-\code{sys.prefix+"/lib/python\emph{VER}"} while the platform
+\code{sys.prefix+"/lib/python\var{version}"} while the platform
 independent header files (all except \code{config.h}) are stored in
-\code{sys.prefix+"/include/python\emph{VER}"},
-where \emph{VER} is equal to \code{sys.version[:3]}.
+\code{sys.prefix+"/include/python\var{version}"},
+where \var{version} is equal to \code{sys.version[:3]}.
 
 \end{datadesc}
 
index 8f4a5997d8c870a6d08e3dca4cd013df788a3258..8348e9c311902efc15ac0678f8ed5714d8347cae 100644 (file)
@@ -8,7 +8,7 @@ of the \code{syslog} facility.
 
 The module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module syslog)}
+\setindexsubitem{(in module syslog)}
 
 \begin{funcdesc}{syslog}{\optional{priority\,} message}
 Send the string \var{message} to the system logger.
index f7304aec8167b15f67d73ab14986f56dcb777c75..d1cd205f69d152106835f86412446764621340bd 100644 (file)
@@ -4,7 +4,7 @@
 \indexii{temporary}{file name}
 \indexii{temporary}{file}
 
-\renewcommand{\indexsubitem}{(in module tempfile)}
+\setindexsubitem{(in module tempfile)}
 
 This module generates temporary file names.  It is not \UNIX{} specific,
 but it may require some help on non-\UNIX{} systems.
index 29aeb639fdc55ae0ee9b868b299745c7cbb14f6c..43756494559555d8871f4e57d85612c0a7dcf5ca 100644 (file)
@@ -45,7 +45,7 @@ The \code{spam} module defines the following functions:
 % Redefine the ``indexsubitem'' macro to point to this module
 % (alternatively, you can put this at the top of the file):
 
-\renewcommand{\indexsubitem}{(in module spam)}
+\setindexsubitem{(in module spam)}
 
 % ---- 3.2. ----
 % For each function, use a ``funcdesc'' block.  This has exactly two
@@ -101,12 +101,12 @@ failure.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import spam
 >>> can = spam.open('/etc/passwd')
 >>> can.empty()
 >>> can.close()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 % ==== 5. ====
 % If your module defines new object types (for a built-in module) or
@@ -120,7 +120,7 @@ Example:
 Spam objects (returned by \code{open()} above) have the following
 methods.
 
-\renewcommand{\indexsubitem}{(spam method)}
+\setindexsubitem{(spam method)}
 
 \begin{funcdesc}{empty}{}
 Empty the can into the trash.
index afdd141396230dfdf680e801f010980fd8dcb7e4..e39b905927fb8e3dc2a4b9d753a617c2bd4230bd 100644 (file)
@@ -4,7 +4,7 @@
 \indexii{\POSIX{}}{I/O control}
 \indexii{tty}{I/O control}
 
-\renewcommand{\indexsubitem}{(in module termios)}
+\setindexsubitem{(in module termios)}
 
 This module provides an interface to the \POSIX{} calls for tty I/O
 control.  For a complete description of these calls, see the \POSIX{} or
@@ -77,7 +77,7 @@ Note the technique using a separate \code{termios.tcgetattr()} call
 and a \code{try \ldots{} finally} statement to ensure that the old tty
 attributes are restored exactly no matter what happens:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def getpass(prompt = "Password: "):
     import termios, TERMIOS, sys
     fd = sys.stdin.fileno()
@@ -90,14 +90,14 @@ def getpass(prompt = "Password: "):
     finally:
         termios.tcsetattr(fd, TERMIOS.TCSADRAIN, old)
     return passwd
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{TERMIOS}}
 \stmodindex{TERMIOS}
 \indexii{\POSIX{}}{I/O control}
 \indexii{tty}{I/O control}
 
-\renewcommand{\indexsubitem}{(in module TERMIOS)}
+\setindexsubitem{(in module TERMIOS)}
 
 This module defines the symbolic constants required to use the
 \code{termios} module (see the previous section).  See the \POSIX{} or
index ae11823eff437dcbf4b509c358397e222e04edff..24ebac52bdd3e40a7648493fdcb5430bffb3ca0e 100644 (file)
@@ -20,7 +20,7 @@ IRIX, Solaris 2.x, as well as on systems that have a \POSIX{} thread
 
 It defines the following constant and functions:
 
-\renewcommand{\indexsubitem}{(in module thread)}
+\setindexsubitem{(in module thread)}
 \begin{excdesc}{error}
 Raised on thread-specific errors.
 \end{excdesc}
@@ -64,7 +64,7 @@ another thread is created.
 
 Lock objects have the following methods:
 
-\renewcommand{\indexsubitem}{(lock method)}
+\setindexsubitem{(lock method)}
 \begin{funcdesc}{acquire}{\optional{waitflag}}
 Without the optional argument, this method acquires the lock
 unconditionally, if necessary waiting until it is released by another
index 74e81046e18395fb7ce050c234ed3f896859248c..e05cad25cd9b2d5cf9061b84829819a4c4cd4db1 100644 (file)
@@ -58,7 +58,7 @@ state to be filled in.
 
 The module defines the following functions and data items:
 
-\renewcommand{\indexsubitem}{(in module time)}
+\setindexsubitem{(in module time)}
 
 \begin{datadesc}{altzone}
 The offset of the local DST timezone, in seconds west of the 0th
index 4fcc4d145d50945f19ae7b3f3b9908924e367bda..2bdd22b40bd7b9f49be1666fe567d4ec08b922cc 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-traceback}
 \stmodindex{traceback}
 
-\renewcommand{\indexsubitem}{(in module traceback)}
+\setindexsubitem{(in module traceback)}
 
 This module provides a standard interface to format and print stack
 traces of Python programs.  It exactly mimics the behavior of the
index 33d1b15efb1fd8fb039df8b95880a136cae70f43..fc1b34e3b702acadb464ec09d9931aa8186f5960 100644 (file)
@@ -25,7 +25,7 @@ The following values are considered false:
 \index{false}
 
 \begin{itemize}
-\renewcommand{\indexsubitem}{(Built-in object)}
+\setindexsubitem{(Built-in object)}
 
 \item  \code{None}
        \ttindex{None}
@@ -409,13 +409,13 @@ If the right argument is a dictionary (or any kind of mapping), then
 the formats in the string must have a parenthesized key into that
 dictionary inserted immediately after the \code{\%} character, and
 each format formats the corresponding entry from the mapping.  E.g.
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> count = 2
 >>> language = 'Python'
 >>> print '%(language)s has %(count)03d quote types.' % vars()
 Python has 002 quote types.
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 In this case no * specifiers may occur in a format (since they
 require a sequential parameter list).
 
@@ -466,7 +466,7 @@ The following operations are defined on mutable sequence types (where
 \indexii{subscript}{assignment}
 \indexii{slice}{assignment}
 \stindex{del}
-\renewcommand{\indexsubitem}{(list method)}
+\setindexsubitem{(list method)}
 \ttindex{append}
 \ttindex{count}
 \ttindex{index}
@@ -538,7 +538,7 @@ mapping, \var{k} is a key and \var{x} is an arbitrary object):
 \indexiii{operations on}{dictionary}{type}
 \stindex{del}
 \bifuncindex{len}
-\renewcommand{\indexsubitem}{(dictionary method)}
+\setindexsubitem{(dictionary method)}
 \ttindex{keys}
 \ttindex{has_key}
 
@@ -681,7 +681,7 @@ device or writing a file opened for reading.
 Files have the following methods:
 
 
-\renewcommand{\indexsubitem}{(file method)}
+\setindexsubitem{(file method)}
 
 \begin{funcdesc}{close}{}
   Close the file.  A closed file cannot be read or written anymore.
index afb02e5cfb3ae9ccf858e0a948936260950a4310..8bf58637defe9bef53207d0cb00fd3fede9b19cd 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-types}
 \stmodindex{types}
 
-\renewcommand{\indexsubitem}{(in module types)}
+\setindexsubitem{(in module types)}
 
 This module defines names for all object types that are used by the
 standard Python interpreter (but not for the types defined by various
@@ -14,14 +14,14 @@ all end in \code{Type}.
 Typical use is for functions that do different things depending on
 their argument types, like the following:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 from types import *
 def delete(list, item):
     if type(item) is IntType:
        del list[item]
     else:
        list.remove(item)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module defines the following names:
 
index 5f8297de13ad10f35e64d578f902d3c2b409308f..8e7decfeb01314b39591586360939ec992587cd3 100644 (file)
@@ -5,7 +5,7 @@
 \index{World-Wide Web}
 \index{URL}
 
-\renewcommand{\indexsubitem}{(in module urllib)}
+\setindexsubitem{(in module urllib)}
 
 This module provides a high-level interface for fetching data across
 the World-Wide Web.  In particular, the \code{urlopen()} function is
index 651db6d37eae5f34dccd7b8e1c04b9cf667eab72..32d88eeaef3c6b5c8c2750fcfc592f5fd070b16a 100644 (file)
@@ -7,7 +7,7 @@
 \indexii{URL}{parsing}
 \indexii{relative}{URL}
 
-\renewcommand{\indexsubitem}{(in module urlparse)}
+\setindexsubitem{(in module urlparse)}
 
 This module defines a standard interface to break URL strings up in
 components (addessing scheme, network location, path etc.), to combine
@@ -35,15 +35,15 @@ retained if present.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 yields the tuple
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 ('http', 'www.cwi.nl:80', '/%7Eguido/Python.html', '', '', '')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If the \var{default_scheme} argument is specified, it gives the
 default addressing scheme, to be used only if the URL string does not
@@ -70,15 +70,15 @@ components in the relative URL.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 urljoin('http://www.cwi.nl/%7Eguido/Python.html', 'FAQ.html')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 yields the string
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 'http://www.cwi.nl/%7Eguido/FAQ.html'
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The \var{allow_fragments} argument has the same meaning as for
 \code{urlparse()}.
index f0f633ca8c3384b3ea5c528d94e61317cd22b269..d5d8d5b7d107fb22d86b3906587d595812dae85f 100644 (file)
@@ -40,13 +40,13 @@ define variables in their \file{.pythonrc.py} file that you test in
 your module.  For example, a module \code{spam} that has a verbosity
 level can look for a variable \code{user.spam_verbose}, as follows:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import user
 try:
     verbose = user.spam_verbose  # user's verbosity preference
 except AttributeError:
     verbose = 0                  # default verbosity
-\end{verbatim}\ecode
+\end{verbatim}
 
 Programs with extensive customization needs are better off reading a
 program-specific customization file.
index 2084b5c25ce605029626d44ff5d6102f615fd956..9b7b2fb5fc6396df93c440e2bb64d0f70c2ac858 100644 (file)
@@ -11,7 +11,7 @@ your own dictionary-like or list-like classes, which can inherit from
 them and override existing methods or add new ones.  In this way one
 can add new behaviours to dictionaries or lists.
 
-\renewcommand{\indexsubitem}{(in module UserDict)}
+\setindexsubitem{(in module UserDict)}
 The \code{UserDict} module defines the \code{UserDict} class:
 
 \begin{funcdesc}{UserDict}{}
@@ -20,7 +20,7 @@ contents are kept in a regular dictionary, which is accessible via the
 \code{data} attribute of \code{UserDict} instances.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(in module UserList)}
+\setindexsubitem{(in module UserList)}
 The \code{UserList} module defines the \code{UserList} class:
 
 \begin{funcdesc}{UserList}{\optional{list}}
index 19bca3a1592211b592c6bde3391cf8b4dc6f8230..180504924cade66cfd9c8122d2af454ea9e574df 100644 (file)
@@ -6,7 +6,7 @@ The single function in this module attempts to guess which of the
 several simple database modules available--dbm, gdbm, or
 dbhash--should be used to open a given file.
 
-\renewcommand{\indexsubitem}{(in module whichdb)}
+\setindexsubitem{(in module whichdb)}
 \begin{funcdesc}{whichdb}{filename}
 Returns one of the following values: \code{None} if the file can't be
 opened because it's unreadable or doesn't exist; the empty string
index 09d7816521bafef7d4f6b6ca2daa7ada0f444055..da3fa8cee465e78d1d91793e81887dbc76fa77e9 100644 (file)
@@ -5,7 +5,7 @@
 This module implements a Wichmann-Hill pseudo-random number generator
 class that is also named \code{whrandom}.  Instances of the
 \code{whrandom} class have the following methods:
-\renewcommand{\indexsubitem}{(in module whrandom)}
+\setindexsubitem{(in module whrandom)}
 
 \begin{funcdesc}{choice}{seq}
 Chooses a random element from the non-empty sequence \var{seq} and returns it.
@@ -37,10 +37,10 @@ When imported, the \code{whrandom} module also creates an instance of
 the \code{whrandom} class, and makes the methods of that instance
 available at the module level.  Therefore one can write either 
 \code{N = whrandom.random()} or:
-\bcode\begin{verbatim}
+\begin{verbatim}
 generator = whrandom.whrandom()
 N = generator.random()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \begin{seealso}
 \seemodule{random}{generators for various random distributions}
index 3cfa92c1c970cffb9ec67b392eafc50cb736ca50..681fc5e1df7716b9a3cea8b5c938745da7331a16 100644 (file)
@@ -4,7 +4,7 @@
 \index{XDR}
 \index{External Data Representation}
 
-\renewcommand{\indexsubitem}{(in module xdrlib)}
+\setindexsubitem{(in module xdrlib)}
 
 
 The \code{xdrlib} module supports the External Data Representation
@@ -215,11 +215,11 @@ variables.
 
 Here is an example of how you would catch one of these exceptions:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import xdrlib
 p = xdrlib.Packer()
 try:
     p.pack_double(8.01)
 except xdrlib.ConversionError, instance:
     print 'packing the double failed:', instance.msg
-\end{verbatim}\ecode
+\end{verbatim}
index e8ba2e898452cf24336e2fca834882bff5a740eb..d777f088e3cac2cfff118c7a7d07eaaf2b10ed42 100644 (file)
@@ -10,7 +10,7 @@ for parsing text files formatted in XML (eXtended Markup Language).
 The \code{XMLParser} class must be instantiated without arguments.  It 
 has the following interface methods:
 
-\renewcommand{\indexsubitem}{(XMLParser method)}
+\setindexsubitem{(XMLParser method)}
 
 \begin{funcdesc}{reset}{}
 Reset the instance.  Loses all unprocessed data.  This is called
index cca35014cf35a0ffc61da52541f606a82615da7b..9234c5f47a8566953a489c8fbb06cb8efc6253f2 100644 (file)
@@ -13,7 +13,7 @@ later version if one is available.
 
 The available functions in this module are:
 
-\renewcommand{\indexsubitem}{(in module zlib)}
+\setindexsubitem{(in module zlib)}
 \begin{funcdesc}{adler32}{string\optional{\, value}}
    Computes a Adler-32 checksum of \var{string}.  (An Adler-32
    checksum is almost as reliable as a CRC32 but can be computed much
index 590f0d42eb8109844f0913902f0073efdfa4c2a8..19af8f36ece8de5ed77baec9d4581aacf5f2049f 100644 (file)
@@ -23,7 +23,7 @@ second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
 
 Module \code{aifc} defines the following function:
 
-\renewcommand{\indexsubitem}{(in module aifc)}
+\setindexsubitem{(in module aifc)}
 \begin{funcdesc}{open}{file\, mode}
 Open an AIFF or AIFF-C file and return an object instance with
 methods that are described below.  The argument file is either a
@@ -38,7 +38,7 @@ samples you are going to write in total and use
 Objects returned by \code{aifc.open()} when a file is opened for
 reading have the following methods:
 
-\renewcommand{\indexsubitem}{(aifc object method)}
+\setindexsubitem{(aifc object method)}
 \begin{funcdesc}{getnchannels}{}
 Return the number of audio channels (1 for mono, 2 for stereo).
 \end{funcdesc}
index 5655be66a946b95a60ca484fc563b39710ffbf6e..63bdf1b888ac1b30b18a5b71124210dffeef6c63 100644 (file)
@@ -25,7 +25,7 @@ documented upper limit.)
 
 The module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module al)}
+\setindexsubitem{(in module al)}
 
 \begin{funcdesc}{openport}{name\, direction\optional{\, config}}
 The name and direction arguments are strings.  The optional config
@@ -59,7 +59,7 @@ as returned by \code{al.queryparams}.
 Configuration objects (returned by \code{al.newconfig()} have the
 following methods:
 
-\renewcommand{\indexsubitem}{(audio configuration object method)}
+\setindexsubitem{(audio configuration object method)}
 
 \begin{funcdesc}{getqueuesize}{}
 Return the queue size.
@@ -106,7 +106,7 @@ Set the maximum value for floating sample formats.
 Port objects (returned by \code{al.openport()} have the following
 methods:
 
-\renewcommand{\indexsubitem}{(audio port object method)}
+\setindexsubitem{(audio port object method)}
 
 \begin{funcdesc}{closeport}{}
 Close the port.
@@ -167,7 +167,7 @@ the C header file \file{<audio.h>} except that the name prefix
 \samp{AL_} is omitted.  Read the module source for a complete list of
 the defined names.  Suggested use:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import al
 from AL import *
-\end{verbatim}\ecode
+\end{verbatim}
index 747c5f3e671fde727b37e9ae1d6bcca4c5a1fa92..10059eeacccb11351aa0ed5e805b74f1f42f45a6 100644 (file)
@@ -10,7 +10,7 @@ the exception \code{amoeba.error = 'amoeba.error'}.
 
 The module \code{amoeba} defines the following items:
 
-\renewcommand{\indexsubitem}{(in module amoeba)}
+\setindexsubitem{(in module amoeba)}
 \begin{funcdesc}{name_append}{path\, cap}
 Stores a capability in the Amoeba directory tree.
 Arguments are the pathname (a string) and the capability (a capability
@@ -77,15 +77,15 @@ and
 \emph{a2c}(U).
 For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> amoeba.name_lookup('/profile/cap')
 aa:1c:95:52:6a:fa/14(ff)/8e:ba:5b:8:11:1a
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The following methods are defined for capability objects.
 
-\renewcommand{\indexsubitem}{(capability method)}
+\setindexsubitem{(capability method)}
 \begin{funcdesc}{dir_list}{}
 Returns a list of the names of the entries in an Amoeba directory.
 \end{funcdesc}
index b55b6715a2cf4b769502697e93179a94648f5e34..722d395d1568493f704f403d5b253f6198ff0066 100644 (file)
@@ -9,7 +9,7 @@ will be used.   Both modules provide the same interface:
 
 % not the best solution, but it's what you get for documenting both
 % at the same time.
-\renewcommand{\indexsubitem}{(in modules anydbm, dumbdbm)}
+\setindexsubitem{(in modules anydbm, dumbdbm)}
 
 \begin{funcdesc}{open}{filename\optional{\, flag\, mode}}
 Open the database file \var{filename} and return a corresponding object.  
index 8490fc8e00d20c137a42bb8077ee9879fbaaea53..7ba3954a31f672d68fb21bc8686bd5a9aded55ed 100644 (file)
@@ -36,7 +36,7 @@ See also built-in module \code{struct}.
 
 The module defines the following function:
 
-\renewcommand{\indexsubitem}{(in module array)}
+\setindexsubitem{(in module array)}
 
 \begin{funcdesc}{array}{typecode\optional{\, initializer}}
 Return a new array whose items are restricted by \var{typecode}, and
@@ -124,9 +124,9 @@ numbers.  The string is guaranteed to be able to be converted back to
 an array with the same type and value using reverse quotes
 (\code{``}).  Examples:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 array('l')
 array('c', 'hello world')
 array('l', [1, 2, 3, 4, 5])
 array('d', [1.0, 2.0, 3.14])
-\end{verbatim}\ecode
+\end{verbatim}
index b7001554b76a9aaa3d57bf862d6189a0b8e85224..69a3a83de867796ffedd6f8f554dbb339a981595 100644 (file)
@@ -13,7 +13,7 @@ otherwise the sample size (in bytes) is always a parameter of the operation.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module audioop)}
+\setindexsubitem{(in module audioop)}
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unknown number of bytes
 per sample, etc.
@@ -201,7 +201,7 @@ distinction between mono and stereo fragments, i.e.\ all samples are
 treated equal.  If this is a problem the stereo fragment should be split
 into two mono fragments first and recombined later.  Here is an example
 of how to do that:
-\bcode\begin{verbatim}
+\begin{verbatim}
 def mul_stereo(sample, width, lfactor, rfactor):
     lsample = audioop.tomono(sample, width, 1, 0)
     rsample = audioop.tomono(sample, width, 0, 1)
@@ -210,7 +210,7 @@ def mul_stereo(sample, width, lfactor, rfactor):
     lsample = audioop.tostereo(lsample, width, 1, 0)
     rsample = audioop.tostereo(rsample, width, 0, 1)
     return audioop.add(lsample, rsample, width)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If you use the ADPCM coder to build network packets and you want your
 protocol to be stateless (i.e.\ to be able to tolerate packet loss)
@@ -231,7 +231,7 @@ They are primarily meant to do echo cancellation.  A reasonably
 fast way to do this is to pick the most energetic piece of the output
 sample, locate that in the input sample and subtract the whole output
 sample from the input sample:
-\bcode\begin{verbatim}
+\begin{verbatim}
 def echocancel(outputdata, inputdata):
     pos = audioop.findmax(outputdata, 800)    # one tenth second
     out_test = outputdata[pos*2:]
@@ -244,4 +244,4 @@ def echocancel(outputdata, inputdata):
     postfill = '\0'*(len(inputdata)-len(prefill)-len(outputdata))
     outputdata = prefill + audioop.mul(outputdata,2,-factor) + postfill
     return audioop.add(inputdata, outputdata, 2)
-\end{verbatim}\ecode
+\end{verbatim}
index 831287b1931a796fcfbb7e77988104827ae4a8eb..f196451f9390889954c323f798359235ed984162 100644 (file)
@@ -12,7 +12,7 @@ output produced by the \file{uuencode} program.  For example, the
 string \code{'www.python.org'} is encoded as the string
 \code{'d3d3LnB5dGhvbi5vcmc=\e n'}.  
 
-\renewcommand{\indexsubitem}{(in module base64)}
+\setindexsubitem{(in module base64)}
 
 \begin{funcdesc}{decode}{input, output}
 Decode the contents of the \var{input} file and write the resulting
index 1f7b6da291cc8f4d7b59abae6bc4f024a6547ddb..c28b0b850a50d0b087da9ed6cbcc6ae1221795ad 100644 (file)
@@ -7,7 +7,7 @@
 \index{URL}
 \index{httpd}
 
-\renewcommand{\indexsubitem}{(in module BaseHTTPServer)}
+\setindexsubitem{(in module BaseHTTPServer)}
 
 This module defines two classes for implementing HTTP servers
 (web servers). Usually, this module isn't used directly, but is used
@@ -21,13 +21,13 @@ subclass. It creates and listens at the web socket, dispatching the
 requests to a handler. Code to create and run the server looks like
 this:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def run(server_class=BaseHTTPServer.HTTPServer,
         handler_class=BaseHTTPServer.BaseHTTPRequestHandler):
   server_address = ('', 8000)
   httpd = server_class(server_address, handler_class)
   httpd.serve_forever()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The \code{HTTPServer} class builds on the \code{TCPServer} class by
 storing the server address as instance
@@ -49,7 +49,7 @@ from the request. For example, for the request \code{SPAM}, the
 the relevant information is stored into instance variables of the
 handler.
 
-\renewcommand{\indexsubitem}{(BaseHTTPRequestHandler instance variable)}
+\setindexsubitem{(BaseHTTPRequestHandler instance variable)}
 
 \code{BaseHTTPRequestHandler} has the following instance variables:
 
@@ -88,7 +88,7 @@ Proper adherance to the HTTP protocol must be used when writing
 to this stream.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(BaseHTTPRequestHandler class variable)}
+\setindexsubitem{(BaseHTTPRequestHandler class variable)}
 
 \code{BaseHTTPRequestHandler} has the following class variables:
 
@@ -138,7 +138,7 @@ error response, and \var{longmessage} as the \var{explain} key
 (see the \code{error_message_format} class variable).
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(BaseHTTPRequestHandler method)}
+\setindexsubitem{(BaseHTTPRequestHandler method)}
 
 A \code{BaseHTTPRequestHandler} instance has the following methods:
 
index dd302844d407634889eef645260ce1243fd1346d..e9bcc1f71678ea9e7c6bd9401fa3bc66655b2212 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{Bastion}}
 \label{module-Bastion}
 \stmodindex{Bastion}
-\renewcommand{\indexsubitem}{(in module Bastion)}
+\setindexsubitem{(in module Bastion)}
 
 % I'm concerned that the word 'bastion' won't be understood by people
 % for whom English is a second language, making the module name
index 4ff59aefaaae3e6f17d678fa29a1c389990612fa..02b247c991d6a52a775e46d45e64c4baa6bc21a5 100644 (file)
@@ -9,7 +9,7 @@ decoded), on other platforms only the data fork is handled.
 
 The \code{binhex} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module binhex)}
+\setindexsubitem{(in module binhex)}
 
 \begin{funcdesc}{binhex}{input\, output}
 Convert a binary file with filename \var{input} to binhex file
@@ -54,7 +54,7 @@ Jansen.
 
 The \code{uu} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module uu)}
+\setindexsubitem{(in module uu)}
 
 \begin{funcdesc}{encode}{in_file\, out_file\optional{\, name\, mode}}
 Uuencode file \var{in_file} into file \var{out_file}.  The uuencoded
@@ -82,7 +82,7 @@ bit-manipuation of large amounts of data is slow in python.
 
 The \code{binascii} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module binascii)}
+\setindexsubitem{(in module binascii)}
 
 \begin{funcdesc}{a2b_uu}{string}
 Convert a single line of uuencoded data back to binary and return the
index 6e64b777609baede8cf3905ffd224ed04e2daaca..b3ca8b243988293e39654be4faaebbb7cf36b53f 100644 (file)
@@ -29,7 +29,7 @@ track.
 
 Module \code{cd} defines the following functions and constants:
 
-\renewcommand{\indexsubitem}{(in module cd)}
+\setindexsubitem{(in module cd)}
 
 \begin{funcdesc}{createparser}{}
 Create and return an opaque parser object.  The methods of the parser
@@ -115,7 +115,7 @@ objects (see below).
 Player objects (returned by \code{cd.open()}) have the following
 methods:
 
-\renewcommand{\indexsubitem}{(CD player object method)}
+\setindexsubitem{(CD player object method)}
 
 \begin{funcdesc}{allowremoval}{}
 Unlocks the eject button on the CD-ROM drive permitting the user to
@@ -235,7 +235,7 @@ Pauses the CD if it is playing, and makes it play if it is paused.
 Parser objects (returned by \code{cd.createparser()}) have the
 following methods:
 
-\renewcommand{\indexsubitem}{(CD parser object method)}
+\setindexsubitem{(CD parser object method)}
 
 \begin{funcdesc}{addcallback}{type\, func\, arg}
 Adds a callback for the parser.  The parser has callbacks for eight
index 6b50ec8823216a1afba16331ab5420583fb590cd..f115263de1c120069326bb454702aaa84d23a994 100644 (file)
@@ -7,7 +7,7 @@
 \indexii{MIME}{headers}
 \index{URL}
 
-\renewcommand{\indexsubitem}{(in module cgi)}
+\setindexsubitem{(in module cgi)}
 
 Support module for CGI (Common Gateway Interface) scripts.
 
@@ -40,20 +40,20 @@ by a blank line.  The first section contains a number of headers,
 telling the client what kind of data is following.  Python code to
 generate a minimal header section looks like this:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print "Content-type: text/html"     # HTML is following
 print                               # blank line, end of headers
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The second section is usually HTML, which allows the client software
 to display nicely formatted text with header, in-line images, etc.
 Here's Python code that prints a simple piece of HTML:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print "<TITLE>CGI script output</TITLE>"
 print "<H1>This is my first CGI script</H1>"
 print "Hello, world!"
-\end{verbatim}\ecode
+\end{verbatim}
 %
 (It may not be fully legal HTML according to the letter of the
 standard, but any browser will understand it.)
@@ -77,7 +77,7 @@ dictionary.  For instance, the following code (which assumes that the
 \code{Content-type} header and blank line have already been printed) checks that 
 the fields \code{name} and \code{addr} are both set to a non-empty string:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 form = cgi.FieldStorage()
 form_ok = 0
 if form.has_key("name") and form.has_key("addr"):
@@ -88,7 +88,7 @@ if not form_ok:
     print "Please fill in the name and addr fields."
     return
 ...further form processing here...
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Here the fields, accessed through \code{form[key]}, are themselves instances
 of \code{FieldStorage} (or \code{MiniFieldStorage}, depending on the form encoding).
@@ -101,7 +101,7 @@ name), use the \code{type()} function to determine whether you have a single
 instance or a list of instances.  For example, here's code that
 concatenates any number of username fields, separated by commas:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 username = form["username"]
 if type(username) is type([]):
     # Multiple username fields specified
@@ -116,7 +116,7 @@ if type(username) is type([]):
 else:
     # Single username field specified
     usernames = username.value
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If a field represents an uploaded file, the value attribute reads the 
 entire file in memory as a string.  This may not be what you want.  You can 
@@ -124,7 +124,7 @@ test for an uploaded file by testing either the filename attribute or the
 file attribute.  You can then read the data at leasure from the file 
 attribute:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 fileitem = form["userfile"]
 if fileitem.file:
     # It's an uploaded file; count lines
@@ -133,7 +133,7 @@ if fileitem.file:
         line = fileitem.file.readline()
         if not line: break
         linecount = linecount + 1
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The file upload draft standard entertains the possibility of uploading
 multiple files from one field (using a recursive \code{multipart/*}
@@ -267,9 +267,9 @@ Make sure that your script is readable and executable by ``others''; the
 that the first line of the script contains \code{\#!} starting in column 1
 followed by the pathname of the Python interpreter, for instance:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 #!/usr/local/bin/python
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Make sure the Python interpreter exists and is executable by ``others''.
 
@@ -289,11 +289,11 @@ If you need to load modules from a directory which is not on Python's
 default module search path, you can change the path in your script,
 before importing other modules, e.g.:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import sys
 sys.path.insert(0, "/usr/home/joe/lib/python")
 sys.path.insert(0, "/usr/local/lib/python")
-\end{verbatim}\ecode
+\end{verbatim}
 %
 (This way, the directory inserted last will be searched first!)
 
@@ -327,9 +327,9 @@ Give it the right mode etc, and send it a request.  If it's installed
 in the standard \file{cgi-bin} directory, it should be possible to send it a
 request by entering a URL into your browser of the form:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If this gives an error of type 404, the server cannot find the script
 -- perhaps you need to install it in a different directory.  If it
@@ -345,9 +345,9 @@ The next step could be to call the \code{cgi} module's \code{test()}
 function from your script: replace its main code with the single
 statement
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 cgi.test()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This should produce the same results as those gotten from installing
 the \file{cgi.py} file itself.
@@ -380,7 +380,7 @@ Here are the rules:
 
 For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import sys
 import traceback
 print "Content-type: text/html"
@@ -391,7 +391,7 @@ try:
 except:
     print "\n\n<PRE>"
     traceback.print_exc()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Notes: The assignment to \code{sys.stderr} is needed because the traceback
 prints to \code{sys.stderr}.
@@ -402,13 +402,13 @@ If you suspect that there may be a problem in importing the traceback
 module, you can use an even more robust approach (which only uses
 built-in modules):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import sys
 sys.stderr = sys.stdout
 print "Content-type: text/plain"
 print
 ...your code here...
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This relies on the Python interpreter to print the traceback.  The
 content type of the output is set to plain text, which disables all
index c9886bbd38f20326a1a7a75533a43e7c01e7aa59..147fa6ee5f1ce5cc69d2f7458420658436ae38ef 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-cmath}
 
 \bimodindex{cmath}
-\renewcommand{\indexsubitem}{(in module cmath)}
+\setindexsubitem{(in module cmath)}
 This module is always available.
 It provides access to mathematical functions for complex numbers.
 The functions are:
index a2d77fe4f60511560637aace2d91f3f90a632002..04790a0d5ec3700a4513ed96d97355c46d2c3af7 100644 (file)
@@ -7,7 +7,7 @@ objects.
 
 The \code{code} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module code)}
+\setindexsubitem{(in module code)}
 
 \begin{funcdesc}{compile_command}{source, \optional{filename\optional{, symbol}}}
 This function is useful for programs that want to emulate Python's
index e82907729cb7b19c34fde55c665bdacf1fc2289e..e65e954f636d611da9991d79effe0b0acc66cde3 100644 (file)
@@ -11,7 +11,7 @@ The \code{commands} module is only usable on systems which support
 
 The \code{commands} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module commands)}
+\setindexsubitem{(in module commands)}
 \begin{funcdesc}{getstatusoutput}{cmd}
 Execute the string \var{cmd} in a shell with \code{os.popen()} and return
 a 2-tuple (status, output).  \var{cmd} is actually run as
index 60a5b420e55eb51d1f7d6864e50a28a612488013..1d1fd2218ffd5d2010aa39c235cb743ce5d24362 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{copy}}
 \label{module-copy}
 \stmodindex{copy}
-\renewcommand{\indexsubitem}{(copy function)}
+\setindexsubitem{(copy function)}
 \ttindex{copy}
 \ttindex{deepcopy}
 
@@ -9,12 +9,12 @@ This module provides generic (shallow and deep) copying operations.
 
 Interface summary:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import copy
 
 x = copy.copy(y)        # make a shallow copy of y
 x = copy.deepcopy(y)    # make a deep copy of y
-\end{verbatim}\ecode
+\end{verbatim}
 %
 For module specific errors, \code{copy.error} is raised.
 
@@ -76,7 +76,7 @@ to control pickling: they can define methods called
 \code{__setstate__()}.  See the description of module \code{pickle}
 for information on these methods.
 \refstmodindex{pickle}
-\renewcommand{\indexsubitem}{(copy protocol)}
+\setindexsubitem{(copy protocol)}
 \ttindex{__getinitargs__}
 \ttindex{__getstate__}
 \ttindex{__setstate__}
index dffcf430c643d28ee6251bc639d2d7c6cc27ecf8..cffc3958235784a82ce3c23ee128ecc098ba159c 100644 (file)
@@ -12,7 +12,7 @@ future as well.  It provides configuration information about object
 constructors which are not classes.  Such constructors may be factory
 functions or class instances.
 
-\renewcommand{\indexsubitem}{(in module copy_reg)}
+\setindexsubitem{(in module copy_reg)}
 
 \begin{funcdesc}{constructor}{object}
   Declares \var{object} to be a valid constructor.
index 0ec6e807acceb9387b881d720706688efdf96e13..64a9bfcc56a24f6cbb2e140905fb20487871c2b9 100644 (file)
@@ -9,7 +9,7 @@ allowing Python scripts to accept typed passwords from the user, or
 attempting to crack \UNIX{} passwords with a dictionary.
 \index{crypt(3)}
 
-\renewcommand{\indexsubitem}{(in module crypt)}
+\setindexsubitem{(in module crypt)}
 \begin{funcdesc}{crypt}{word\, salt} 
 \var{word} will usually be a user's password.  \var{salt} is a
 2-character string which will be used to select one of 4096 variations
index c9756d10f5c48757b68f111aa5eac5cd2ff6d1ed..36d1289c5031c814366ce900a78d332db5653062 100644 (file)
@@ -1,7 +1,7 @@
 \section{Built-in Module \sectcode{ctb}}
 \label{module-ctb}
 \bimodindex{ctb}
-\renewcommand{\indexsubitem}{(in module ctb)}
+\setindexsubitem{(in module ctb)}
 
 This module provides a partial interface to the Macintosh
 Communications Toolbox. Currently, only Connection Manager tools are
@@ -45,7 +45,7 @@ Alternatively, passing \code{None} will result in default buffer sizes.
 For all connection methods that take a \var{timeout} argument, a value
 of \code{-1} is indefinite, meaning that the command runs to completion.
 
-\renewcommand{\indexsubitem}{(connection object attribute)}
+\setindexsubitem{(connection object attribute)}
 
 \begin{datadesc}{callback}
 If this member is set to a value other than \code{None} it should point
@@ -60,7 +60,7 @@ calls for the time being.
 \end{datadesc}
 
 
-\renewcommand{\indexsubitem}{(connection object method)}
+\setindexsubitem{(connection object method)}
 
 \begin{funcdesc}{Open}{timeout}
 Open an outgoing connection, waiting at most \var{timeout} seconds for
index 551a153dd7de1f80d17c7c8d3330fdefe2c91598..416a6b0d57f1ea7c1623ca038ec71bba0b0c2ae1 100644 (file)
@@ -14,7 +14,7 @@ using the GNU GDBM library.
 
 The module defines the following constant and functions:
 
-\renewcommand{\indexsubitem}{(in module dbm)}
+\setindexsubitem{(in module dbm)}
 \begin{excdesc}{error}
 Raised on dbm-specific errors, such as I/O errors. \code{KeyError} is
 raised for general mapping errors like specifying an incorrect key.
index 2e4442b5ec6a24cfdd9a171d3d082041a3e0c2a8..b8998ddd87762f70afdb0ac6a8c7e6cf2e4ac6b4 100644 (file)
@@ -11,10 +11,10 @@ this module takes as an input is defined in the file
 
 Example: Given the function myfunc
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def myfunc(alist):
   return len(alist)
-\end{verbatim}\ecode
+\end{verbatim}
 
 the following command can be used to get the disassembly of \code{myfunc()}:
 
@@ -33,7 +33,7 @@ the following command can be used to get the disassembly of \code{myfunc()}:
 
 The \code{dis} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module dis)}
+\setindexsubitem{(in module dis)}
 
 \begin{funcdesc}{dis}{\optional{bytesource}}
 Disassemble the \var{bytesource} object. \var{bytesource} can denote
@@ -107,7 +107,7 @@ Sequence of byte codes of boolean operations.
 The Python compiler currently generates the following byte code
 instructions.
 
-\renewcommand{\indexsubitem}{(byte code insns)}
+\setindexsubitem{(byte code insns)}
 
 \begin{opcodedesc}{STOP_CODE}{}
 Indicates end-of-code to the compiler, not used by the interpreter.
@@ -507,5 +507,5 @@ default parameters, which are found below TOS.
 Pushes a slice object on the stack.  \var{argc} must be 2 or 3.  If it
 is 2, \code{slice(TOS1, TOS)} is pushed; if it is 3,
 \code{slice(TOS2, TOS1, TOS)} is pushed.
-See the \code{slice()} built-in function.
+See the \code{slice()}\bifuncindex{slice} built-in function.
 \end{opcodedesc}
index 2c4526678359312ca2006078e7db87c007938a29..cf5f8540da94177089151a72884b424550effba3 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{errno}}
 \stmodindex{errno}
 
-\renewcommand{\indexsubitem}{(in module errno)}
+\setindexsubitem{(in module errno)}
 
 This module makes available standard errno system symbols.
 The value of each symbol is the corresponding integer value.
index 758c14a751dfcc1ec6782839d4e4c45f6b1cdf54..bb27b1627878f233f32e7fb9a92c3dfc124db2b7 100644 (file)
@@ -52,7 +52,7 @@ situation in which the interpreter raises the same exception; but
 beware that there is nothing to prevent user code from raising an
 inappropriate error.
 
-\renewcommand{\indexsubitem}{(built-in exception base class)}
+\setindexsubitem{(built-in exception base class)}
 
 The following exceptions are only used as base classes for other
 exceptions.  When string-based standard exceptions are used, they
@@ -87,7 +87,7 @@ index used on a mapping or sequence is invalid: \code{IndexError},
 \code{KeyError}.
 \end{excdesc}
 
-\renewcommand{\indexsubitem}{(built-in exception)}
+\setindexsubitem{(built-in exception)}
 
 The following exceptions are the exceptions that are actually raised.
 They are class objects, except when the \code{-X} option is used to
index 5dab2838dc8a9e7b8557ae98d345c4837b4c840a..8af4ee31450df24e27ce9c99099b055e0f4eb70e 100644 (file)
@@ -11,7 +11,7 @@ file or socket object.
 
 The module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module struct)}
+\setindexsubitem{(in module struct)}
 
 \begin{funcdesc}{fcntl}{fd\, op\optional{\, arg}}
   Perform the requested operation on file descriptor \code{\var{fd}}.
@@ -56,7 +56,7 @@ script, found in the \file{Tools/scripts} directory.
 
 Examples (all on a SVR4 compliant system):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import struct, FCNTL
 
 file = open(...)
@@ -64,7 +64,7 @@ rv = fcntl(file.fileno(), FCNTL.O_NDELAY, 1)
 
 lockdata = struct.pack('hhllhh', FCNTL.F_WRLCK, 0, 0, 0, 0, 0)
 rv = fcntl(file.fileno(), FCNTL.F_SETLKW, lockdata)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Note that in the first example the return value variable \code{rv} will
 hold an integer value; in the second example it will hold a string
index 1c58a7eabd44e4df471352528a992a20c96d28db..4fa62a8f8edf0df26b4193816cbd0cb9b7f298ae 100644 (file)
@@ -41,7 +41,7 @@ Module \code{fl} defines the following functions.  For more information
 about what they do, see the description of the equivalent C function
 in the FORMS documentation:
 
-\renewcommand{\indexsubitem}{(in module fl)}
+\setindexsubitem{(in module fl)}
 \begin{funcdesc}{make_form}{type\, width\, height}
 Create a form with given type, width and height.  This returns a
 \dfn{form} object, whose methods are described below.
@@ -146,7 +146,7 @@ kinds of FORMS object also have some methods specific to that kind;
 these methods are listed here.
 
 \begin{flushleft}
-\renewcommand{\indexsubitem}{(form object method)}
+\setindexsubitem{(form object method)}
 \begin{funcdesc}{show_form}{placement\, bordertype\, name}
   Show the form.
 \end{funcdesc}
@@ -389,7 +389,7 @@ documentation:
 Besides methods specific to particular kinds of FORMS objects, all
 FORMS objects also have the following methods:
 
-\renewcommand{\indexsubitem}{(FORMS object method)}
+\setindexsubitem{(FORMS object method)}
 \begin{funcdesc}{set_call_back}{function\, argument}
 Set the object's callback function and argument.  When the object
 needs interaction, the callback function will be called with two
@@ -468,10 +468,10 @@ the C header file \file{<forms.h>} except that the name prefix
 \samp{FL_} is omitted.  Read the module source for a complete list of
 the defined names.  Suggested use:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import fl
 from FL import *
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{flp}}
 \label{module-flp}
index fa469fc9ca320149bc7805c0f41f220d842e557e..9d22123c0f8aed4e1c378ebd5cd9abb7d7a82d34 100644 (file)
@@ -14,7 +14,7 @@ details of font info; individual glyph metrics; and printer matching.
 
 It supports the following operations:
 
-\renewcommand{\indexsubitem}{(in module fm)}
+\setindexsubitem{(in module fm)}
 \begin{funcdesc}{init}{}
 Initialization function.
 Calls \code{fminit()}.
@@ -50,7 +50,7 @@ Returns the current font search path.
 
 Font handle objects support the following operations:
 
-\renewcommand{\indexsubitem}{(font handle method)}
+\setindexsubitem{(font handle method)}
 \begin{funcdesc}{scalefont}{factor}
 Returns a handle for a scaled version of this font.
 Calls \code{fmscalefont(\var{fh}, \var{factor})}.
index ecb77d3146503e1f04d7c84ebb1cf973667635db..7aa12957c2181b6e0816efb6f305586a3666c07d 100644 (file)
@@ -18,7 +18,7 @@ special to this module.  See module \code{glob}\refstmodindex{glob}
 for pathname expansion (\code{glob} uses \code{fnmatch()} to
 match filename segments).
 
-\renewcommand{\indexsubitem}{(in module fnmatch)}
+\setindexsubitem{(in module fnmatch)}
 
 \begin{funcdesc}{fnmatch}{filename, pattern}
 Test whether the \var{filename} string matches the \var{pattern}
index 124ca52f458f2ee3f3d25841881b656f00a06603..1a5150d4afd3756c67a175b98b3bc55707fe45a8 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-formatter}
 \stmodindex{formatter}
 
-\renewcommand{\indexsubitem}{(in module formatter)}
+\setindexsubitem{(in module formatter)}
 
 This module supports two interface definitions, each with mulitple
 implementations.  The \emph{formatter} interface is used by the
@@ -47,14 +47,14 @@ be called without having to track whether the property was changed.
 
 The following attributes are defined for formatter instance objects:
 
-\renewcommand{\indexsubitem}{(formatter object data)}
+\setindexsubitem{(formatter object data)}
 
 \begin{datadesc}{writer}
 The writer instance with which the formatter interacts.
 \end{datadesc}
 
 
-\renewcommand{\indexsubitem}{(formatter object method)}
+\setindexsubitem{(formatter object method)}
 
 \begin{funcdesc}{end_paragraph}{blanklines}
 Close any open paragraphs and insert at least \code{blanklines}
@@ -187,7 +187,7 @@ Two implementations of formatter objects are provided by this module.
 Most applications may use one of these classes without modification or
 subclassing.
 
-\renewcommand{\indexsubitem}{(in module formatter)}
+\setindexsubitem{(in module formatter)}
 
 \begin{funcdesc}{NullFormatter}{\optional{writer\code{ = None}}}
 A formatter which does nothing.  If \code{writer} is omitted, a
@@ -215,7 +215,7 @@ Note that while most applications can use the \code{AbstractFormatter}
 class as a formatter, the writer must typically be provided by the
 application.
 
-\renewcommand{\indexsubitem}{(writer object method)}
+\setindexsubitem{(writer object method)}
 
 \begin{funcdesc}{flush}{}
 Flush any buffered output or device control events.
@@ -307,7 +307,7 @@ Three implementations of the writer object interface are provided as
 examples by this module.  Most applications will need to derive new
 writer classes from the \code{NullWriter} class.
 
-\renewcommand{\indexsubitem}{(in module formatter)}
+\setindexsubitem{(in module formatter)}
 
 \begin{funcdesc}{NullWriter}{}
 A writer which only provides the interface definition; no actions are
index 86c3b3e0a66a54fc4ab3ab1fb53c6ca5d2cad23b..39f565722db6d3afc5e183c0893a52243bbcab36 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{ftplib}
 \indexii{FTP}{protocol}
 
-\renewcommand{\indexsubitem}{(in module ftplib)}
+\setindexsubitem{(in module ftplib)}
 
 This module defines the class \code{FTP} and a few related items.  The
 \code{FTP} class implements the client side of the FTP protocol.  You
@@ -14,7 +14,7 @@ more information on FTP (File Transfer Protocol), see Internet \rfc{959}.
 
 Here's a sample session using the \code{ftplib} module:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> from ftplib import FTP
 >>> ftp = FTP('ftp.cwi.nl')   # connect to host, default port
 >>> ftp.login()               # user anonymous, passwd user@hostname
@@ -27,7 +27,7 @@ dr-xr-srwt 105 ftp-usr  pdmaint     1536 Mar 21 14:32 ..
  .
  .
 >>> ftp.quit()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module defines the following items:
 
@@ -68,7 +68,7 @@ not begin with a digit in the range 1--5.
 
 FTP instances have the following methods:
 
-\renewcommand{\indexsubitem}{(FTP object method)}
+\setindexsubitem{(FTP object method)}
 
 \begin{funcdesc}{set_debuglevel}{level}
 Set the instance's debugging level.  This controls the amount of
index 6d1cbce6980cdb001d5feb324b35d7fed778e284..6a2b0a57be13a0a32dff8ca5247c0c0c919508ad 100644 (file)
@@ -5,7 +5,7 @@ The Python interpreter has a number of functions built into it that
 are always available.  They are listed here in alphabetical order.
 
 
-\renewcommand{\indexsubitem}{(built-in function)}
+\setindexsubitem{(built-in function)}
 
 \begin{funcdesc}{__import__}{name\optional{, globals\optional{, locals\optional{, fromlist}}}}
 This function is invoked by the \code{import} statement.  It
@@ -135,14 +135,14 @@ class instances are callable if they have an attribute \code{__call__}.
   and for class instances, methods are not included.
   The resulting list is sorted alphabetically.  For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import sys
 >>> dir()
 ['sys']
 >>> dir(sys)
 ['argv', 'exit', 'modules', 'path', 'stderr', 'stdin', 'stdout']
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{divmod}{a\, b}
@@ -166,12 +166,12 @@ class instances are callable if they have an attribute \code{__call__}.
   called.  The return value is the result of the evaluated expression.
   Syntax errors are reported as exceptions.  Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> x = 1
 >>> print eval('x+1')
 2
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
   This function can also be used to execute arbitrary code objects
   (e.g.\ created by \code{compile()}).  In this case pass a code
@@ -448,7 +448,7 @@ there's no reliable way to determine whether this is the case.}
   greater than \var{stop}.  \var{step} must not be zero (or else an
   exception is raised).  Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> range(10)
 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
 >>> range(1, 11)
@@ -464,7 +464,7 @@ there's no reliable way to determine whether this is the case.}
 >>> range(1, 0)
 []
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{raw_input}{\optional{prompt}}
@@ -473,13 +473,13 @@ there's no reliable way to determine whether this is the case.}
   converts it to a string (stripping a trailing newline), and returns that.
   When \EOF{} is read, \code{EOFError} is raised. Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = raw_input('--> ')
 --> Monty Python's Flying Circus
 >>> s
 "Monty Python's Flying Circus"
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 
 If the \code{readline} module was loaded, then
 \code{raw_input()} will use it to provide elaborate
@@ -604,10 +604,10 @@ built-in types.
 \obindex{type}
 For instance:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import types
 >>> if isinstance(x, types.StringType): print "It's a string"
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{vars}{\optional{object}}
index ea655a3e21ff3a4d2c21b5e7bed2c99aca6d760b..d42bf851b4fffe630a80cc00dce7250393c94904 100644 (file)
@@ -15,7 +15,7 @@ Printing a \code{gdbm} object doesn't print the keys and values, and the
 
 The module defines the following constant and functions:
 
-\renewcommand{\indexsubitem}{(in module gdbm)}
+\setindexsubitem{(in module gdbm)}
 \begin{excdesc}{error}
 Raised on \code{gdbm}-specific errors, such as I/O errors. \code{KeyError} is
 raised for general mapping errors like specifying an incorrect key.
@@ -57,12 +57,12 @@ method returns the starting key.
 Returns the key that follows \var{key} in the traversal.  The
 following code prints every key in the database \code{db}, without having to
 create a list in memory that contains them all:
-\bcode\begin{verbatim}
+\begin{verbatim}
 k=db.firstkey()
 while k!=None:
     print k
     k=db.nextkey(k)
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{reorganize}{}
index a9210b02aee6c3c9549bc43512e15360c8fcba31..286cf58555766df795c3b7a7061608f30ca306aa 100644 (file)
@@ -45,7 +45,7 @@ be mixed.
 
 An example using only \UNIX{} style options:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import getopt, string
 >>> args = string.split('-a -b -cfoo -d bar a1 a2')
 >>> args
@@ -56,11 +56,11 @@ An example using only \UNIX{} style options:
 >>> args
 ['a1', 'a2']
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using long option names is equally easy:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
 >>> args = string.split(s)
 >>> args
@@ -72,7 +72,7 @@ Using long option names is equally easy:
 >>> args
 ['a1', 'a2']
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The exception
 \code{getopt.error}
index b1686819369e326002662228aa33f0478852b174..b694d86cd0c593fab5be4e75bb8868468dde341a 100644 (file)
@@ -41,15 +41,15 @@ All (short, long, unsigned) integer arguments or return values that are
 only used to specify the length of an array argument are omitted.
 For example, the C call
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 lmdef(deftype, index, np, props)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is translated to Python as
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 lmdef(deftype, index, props)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \item
 Output arguments are omitted from the argument list; they are
@@ -60,22 +60,22 @@ because of the previous rule) and an output argument, the return value
 comes first in the tuple.
 Examples: the C call
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 getmcolor(i, &red, &green, &blue)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is translated to Python as
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 red, green, blue = getmcolor(i)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \end{itemize}
 
 The following functions are non-standard or have special argument
 conventions:
 
-\renewcommand{\indexsubitem}{(in module gl)}
+\setindexsubitem{(in module gl)}
 \begin{funcdesc}{varray}{argument}
 %JHXXX the argument-argument added
 Equivalent to but faster than a number of
@@ -160,7 +160,7 @@ No method is provided to detect buffer overrun.
 
 Here is a tiny but complete example GL program in Python:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import gl, GL, time
 
 def main():
@@ -182,7 +182,7 @@ def main():
     time.sleep(5)
 
 main()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Modules \sectcode{GL} and \sectcode{DEVICE}}
 \nodename{GL and DEVICE}
index 3f21b39e32a2b55c3b40741360ed761a8dc007a8..58193c98e8f6826aedf3519b10d3393bc8a279b0 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{glob}}
 \label{module-glob}
 \stmodindex{glob}
-\renewcommand{\indexsubitem}{(in module glob)}
+\setindexsubitem{(in module glob)}
 
 The \code{glob} module finds all the pathnames matching a specified
 pattern according to the rules used by the \UNIX{} shell.  No tilde
@@ -25,7 +25,7 @@ For example, consider a directory containing only the following files:
 will produce the following results.  Notice how any leading components
 of the path are preserved.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import glob
 >>> glob.glob('./[0-9].*')
 ['./1.gif', './2.txt']
@@ -33,4 +33,4 @@ of the path are preserved.
 ['1.gif', 'card.gif']
 >>> glob.glob('?.gif')
 ['1.gif']
-\end{verbatim}\ecode
+\end{verbatim}
index b0ebcf726e110932d891e246d77e658030d98c0d..eb6d2a68676bcc328963acc3f046db4ab4a23945 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{gopherlib}
 \indexii{Gopher}{protocol}
 
-\renewcommand{\indexsubitem}{(in module gopherlib)}
+\setindexsubitem{(in module gopherlib)}
 
 This module provides a minimal implementation of client side of the
 the Gopher protocol.  It is used by the module \code{urllib} to handle
index ab904853310f8a73330a4f6cc8095e7e82401059..478097d06fed0240ade9732e5fec92c987fd60ba 100644 (file)
@@ -19,7 +19,7 @@ A \code{KeyError} exception is raised if the entry asked for cannot be found.
 
 It defines the following items:
 
-\renewcommand{\indexsubitem}{(in module grp)}
+\setindexsubitem{(in module grp)}
 \begin{funcdesc}{getgrgid}{gid}
 Return the group database entry for the given numeric group ID.
 \end{funcdesc}
index f832da79c75996518fd80c6ac989805b381dfe48..df99e5deb82dd9cff12b5c1626dad4469bacbee5 100644 (file)
@@ -12,7 +12,7 @@ or decompressing the data so it looks like an ordinary file object.
 object, though it's not possible to use the \code{seek()} and
 \code{tell()} methods to access the file randomly.
 
-\renewcommand{\indexsubitem}{(in module gzip)}
+\setindexsubitem{(in module gzip)}
 \begin{funcdesc}{open}{fileobj\optional{\, filename\optional{\, mode\, compresslevel}}}
   Returns a new \code{GzipFile} object on top of \var{fileobj}, which
   can be a regular file, a \code{StringIO} object, or any object which
index b9b29d49fbfc11bfeb7c9077f8132ced539c85b3..b05c4702b4e8a901d24d60904813b43c5113b02d 100644 (file)
@@ -4,7 +4,7 @@
 \index{HTML}
 \index{hypertext}
 
-\renewcommand{\indexsubitem}{(in module htmllib)}
+\setindexsubitem{(in module htmllib)}
 
 This module defines a class which can serve as a base for parsing text
 files formatted in the HyperText Mark-up Language (HTML).  The class
@@ -40,10 +40,10 @@ incomplete elements are saved in a buffer.  To force processing of all
 unprocessed data, call the \method{close()} method.
 
 For example, to parse the entire contents of a file, use:
-\bcode\begin{verbatim}
+\begin{verbatim}
 parser.feed(open('myfile.html').read())
 parser.close()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \item
 The interface to define semantics for HTML tags is very simple: derive
@@ -71,7 +71,7 @@ handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements.
 In addition to tag methods, the \class{HTMLParser} class provides some
 additional methods and instance variables for use within tag methods.
 
-\renewcommand{\indexsubitem}{(HTMLParser attribute)}
+\setindexsubitem{(HTMLParser attribute)}
 
 \begin{datadesc}{formatter}
 This is the formatter instance associated with the parser.
@@ -85,7 +85,7 @@ as within a \code{<PRE>} element.  The default value is false.  This
 affects the operation of \method{handle_data()} and \method{save_end()}.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(HTMLParser method)}
+\setindexsubitem{(HTMLParser method)}
 
 \begin{funcdesc}{anchor_bgn}{href\, name\, type}
 This method is called at the start of an anchor region.  The arguments
index 0bca8adc96001475f628fbfab0be6234fb240ba5..ed59c9cfd3121f3a9e802b0d05f0659914e9facb 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{httplib}
 \index{HTTP}
 
-\renewcommand{\indexsubitem}{(in module httplib)}
+\setindexsubitem{(in module httplib)}
 
 This module defines a class which implements the client side of the
 HTTP protocol.  It is normally not used directly --- the module
@@ -20,11 +20,11 @@ method should be used to connect to a server.  For example, the
 following calls all create instances that connect to the server at the
 same host and port:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> h1 = httplib.HTTP('www.cwi.nl')
 >>> h2 = httplib.HTTP('www.cwi.nl:80')
 >>> h3 = httplib.HTTP('www.cwi.nl', 80)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Once an \code{HTTP} instance has been connected to an HTTP server, it
 should be used as follows:
@@ -51,7 +51,7 @@ file object that it returns.
 
 \code{HTTP} instances have the following methods:
 
-\renewcommand{\indexsubitem}{(HTTP method)}
+\setindexsubitem{(HTTP method)}
 
 \begin{funcdesc}{set_debuglevel}{level}
 Set the debugging level (the amount of debugging output printed).
@@ -112,7 +112,7 @@ methods.
 
 Here is an example session:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import httplib
 >>> h = httplib.HTTP('www.cwi.nl')
 >>> h.putrequest('GET', '/index.html')
@@ -125,4 +125,4 @@ Here is an example session:
 >>> data = f.read() # Get the raw HTML
 >>> f.close()
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
index 48f9188009b3934e0fb38127a5598b40d4fc90df..e5d494dbf4cc07681ab9c96e10618c236919b9c2 100644 (file)
@@ -9,7 +9,7 @@ by \code{gl.lrectwrite} and the \code{imgfile} module.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module imageop)}
+\setindexsubitem{(in module imageop)}
 
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unknown number of bits
index 96afc9bb0797ed71c8885ba0c04bc18943fd1542..098d59b4d1e8a8fb1b9280763b33ae6686f2f5d9 100644 (file)
@@ -9,7 +9,7 @@ is enough in some cases.  Currently, colormap files are not supported.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module imgfile)}
+\setindexsubitem{(in module imgfile)}
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unsupported file type, etc.
 \end{excdesc}
index e8ec4e9448c288992fae0e02bb119ac8a570609a..71ef9491e5d994514b1d1e13bf7733787bb15fe1 100644 (file)
@@ -7,7 +7,7 @@ file or byte stream.
 
 The \code{imghdr} module defines the following function:
 
-\renewcommand{\indexsubitem}{(in module imghdr)}
+\setindexsubitem{(in module imghdr)}
 
 \begin{funcdesc}{what}{filename\optional{\, h}}
 Tests the image data contained in the file named by \var{filename},
@@ -54,8 +54,8 @@ the test succeeded, or \code{None} if it failed.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import imghdr
 >>> imghdr.what('/tmp/bass.gif')
 'gif'
-\end{verbatim}\ecode
+\end{verbatim}
index 0ba07703ffead94d28b90dd1aad120ff38461149..5ad2fff29e1fbc2e64bfbec99271697c77ef976b 100644 (file)
@@ -7,7 +7,7 @@ This module provides an interface to the mechanisms used to implement
 the \code{import} statement.  It defines the following constants and
 functions:
 
-\renewcommand{\indexsubitem}{(in module imp)}
+\setindexsubitem{(in module imp)}
 
 \begin{funcdesc}{get_magic}{}
 Return the magic string value used to recognize byte-compiled code
@@ -206,7 +206,7 @@ up to Python 1.4 (i.e., no hierarchical module names).  (This
 \code{imp.find_module()} has been extended and
 \code{imp.load_module()} has been added in 1.4.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import imp import sys
 
 def __import__(name, globals=None, locals=None, fromlist=None):
@@ -227,7 +227,7 @@ def __import__(name, globals=None, locals=None, fromlist=None):
         # Since we may exit via an exception, close fp explicitly.
         if fp:
             fp.close()
-\end{verbatim}\ecode
+\end{verbatim}
 
 A more complete example that implements hierarchical module names and
 includes a \code{reload()} function can be found in the standard
index 0d1dc1ce4c20d3f8d97c6ea27ea706e104199581..75691cf9a5d1c4aae4cf17151dc1f999f12bf24f 100644 (file)
@@ -10,7 +10,7 @@ documentation provided with the software.
 
 The \code{jpeg} module defines these functions:
 
-\renewcommand{\indexsubitem}{(in module jpeg)}
+\setindexsubitem{(in module jpeg)}
 \begin{funcdesc}{compress}{data\, w\, h\, b}
 Treat data as a pixmap of width \var{w} and height \var{h}, with \var{b} bytes per
 pixel.  The data is in SGI GL order, so the first pixel is in the
index a0ecf39226b659412944aca2e34adcdb7e97e2f2..84eaf7516f31d8c9ef7f3c4402237552a9bf3098 100644 (file)
@@ -16,7 +16,7 @@ available.
 
 The \code{locale} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module locale)}
+\setindexsubitem{(in module locale)}
 
 \begin{funcdesc}{setlocale}{category\optional{\, value}}
 If \var{value} is specified, modifies the locale setting for the
@@ -31,10 +31,10 @@ If no \var{value} is specified, the current setting for the
 
 \code{setlocale()} is not thread safe on most systems. Applications
 typically start with a call of
-\bcode\begin{verbatim}
+\begin{verbatim}
 import locale
 locale.setlocale(locale.LC_ALL,"")
-\end{verbatim}\ecode
+\end{verbatim}
 This sets the locale for all categories to the user's default setting
 (typically specified in the \code{LANG} environment variable). If the
 locale is not changed thereafter, using multithreading should not
@@ -182,9 +182,9 @@ Exception raised when \code{setlocale()} fails.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import locale
 >>> locale.open(locale.LC_ALL,"de") #setting locale to German
 >>> locale.strcoll("f\344n","foo")  #comparing a string containing an umlaut 
 >>> can.close()
-\end{verbatim}\ecode
+\end{verbatim}
index 4f67ab140091f0bf178f9b319a11fde14f27157d..20b34bc7e65e7a0f45f5402fea64bc80d9e7070f 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-macconsole}
 \bimodindex{macconsole}
 
-\renewcommand{\indexsubitem}{(in module macconsole)}
+\setindexsubitem{(in module macconsole)}
 
 This module is available on the Macintosh, provided Python has been
 built using the Think C compiler. It provides an interface to the
@@ -36,7 +36,7 @@ object. \var{fp} should be one of \code{sys.stdin}, \code{sys.stdout} or
 \subsection{macconsole options object}
 These options are examined when a window is created:
 
-\renewcommand{\indexsubitem}{(macconsole option)}
+\setindexsubitem{(macconsole option)}
 \begin{datadesc}{top}
 \dataline{left}
 The origin of the window.
@@ -63,7 +63,7 @@ If set non-zero, the window will wait for user action before closing.
 
 \subsection{console window object}
 
-\renewcommand{\indexsubitem}{(console window attribute)}
+\setindexsubitem{(console window attribute)}
 
 \begin{datadesc}{file}
 The file object corresponding to this console window. If the file is
@@ -71,7 +71,7 @@ buffered, you should call \code{file.flush()} between \code{write()}
 and \code{read()} calls.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(console window method)}
+\setindexsubitem{(console window method)}
 
 \begin{funcdesc}{setmode}{mode}
 Set the input mode of the console to \var{C_ECHO}, etc.
index 5ae59a6c2354140034afb7f7a1113b24961b0187..fabe3e160236378744614ed8ca304452b4cdf52b 100644 (file)
@@ -9,7 +9,7 @@ all Mac Python versions.
 
 The \code{macdnr} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module macdnr)}
+\setindexsubitem{(in module macdnr)}
 
 \begin{funcdesc}{Open}{\optional{filename}}
 Open the domain name resolver extension.  If \var{filename} is given it
@@ -64,7 +64,7 @@ this will result in an implicit wait for the query to complete.
 The \var{rtnCode} and \var{cname} attributes are always available, the
 others depend on the type of query (address, hinfo or mx).
 
-\renewcommand{\indexsubitem}{(dnr result object method)}
+\setindexsubitem{(dnr result object method)}
 
 % Add args, as in {arg1\, arg2 \optional{\, arg3}}
 \begin{funcdesc}{wait}{}
@@ -76,7 +76,7 @@ Wait for the query to complete.
 Return 1 if the query is complete.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(dnr result object attribute)}
+\setindexsubitem{(dnr result object attribute)}
 
 \begin{datadesc}{rtnCode}
 The error code returned by the query.
@@ -111,9 +111,9 @@ will only return a single mx record.  Mx queries only.
 
 The simplest way to use the module to convert names to dotted-decimal
 strings, without worrying about idle time, etc:
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> def gethostname(name):
 ...     import macdnr
 ...     dnrr = macdnr.StrToAddr(name)
 ...     return macdnr.AddrToStr(dnrr.ip0)
-\end{verbatim}\ecode
+\end{verbatim}
index 4b2f8fea2a467d2e873e868ba7cdb2494be4b8e8..647e004df39e5785cfe9c888f025a5212397118e 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-macfs}
 \bimodindex{macfs}
 
-\renewcommand{\indexsubitem}{(in module macfs)}
+\setindexsubitem{(in module macfs)}
 
 This module provides access to macintosh FSSpec handling, the Alias
 Manager, finder aliases and the Standard File package.
@@ -103,13 +103,13 @@ function returns an FSSpec object pointing to the application.
 
 \subsection{FSSpec objects}
 
-\renewcommand{\indexsubitem}{(FSSpec object attribute)}
+\setindexsubitem{(FSSpec object attribute)}
 \begin{datadesc}{data}
 The raw data from the FSSpec object, suitable for passing
 to other applications, for instance.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(FSSpec object method)}
+\setindexsubitem{(FSSpec object method)}
 \begin{funcdesc}{as_pathname}{}
 Return the full pathname of the file described by the FSSpec object.
 \end{funcdesc}
@@ -159,13 +159,13 @@ Python.
 
 \subsection{alias objects}
 
-\renewcommand{\indexsubitem}{(alias object attribute)}
+\setindexsubitem{(alias object attribute)}
 \begin{datadesc}{data}
 The raw data for the Alias record, suitable for storing in a resource
 or transmitting to other programs.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(alias object method)}
+\setindexsubitem{(alias object method)}
 \begin{funcdesc}{Resolve}{\optional{file}}
 Resolve the alias. If the alias was created as a relative alias you
 should pass the file relative to which it is. Return the FSSpec for
@@ -196,7 +196,7 @@ modifying the resource.
 See Inside Mac for a complete description of what the various fields
 mean.
 
-\renewcommand{\indexsubitem}{(FInfo object attribute)}
+\setindexsubitem{(FInfo object attribute)}
 \begin{datadesc}{Creator}
 The 4-char creator code of the file.
 \end{datadesc}
index d797cfa0a3c0326e9e6bf8fee8fda2abac9d3a4c..aa3ba13a06a8470a9eaffd325639d2473063f214 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{ic}}
 \bimodindex{ic}
 
-\renewcommand{\indexsubitem}{(in module ic)}
+\setindexsubitem{(in module ic)}
 
 This module provides access to macintosh Internet Config package,
 which stores preferences for Internet programs such as mail address,
@@ -63,7 +63,7 @@ for assignment.
 
 Besides the dictionary interface IC objects have the following methods:
 
-\renewcommand{\indexsubitem}{(IC object attribute)}
+\setindexsubitem{(IC object attribute)}
 
 \begin{funcdesc}{launchurl}{url \optional{, hint}}
 Parse the given URL, lauch the correct application and pass it the
index 3d1f2347141bf09fdaa051c0be3b8e9cba20df9d..e52c9cceaa35607bc0dc77aac3dc9c187448d03b 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-MacOS}
 \bimodindex{MacOS}
 
-\renewcommand{\indexsubitem}{(in module MacOS)}
+\setindexsubitem{(in module MacOS)}
 
 This module provides access to MacOS specific functionality in the
 python interpreter, such as how the interpreter eventloop functions
index adbf461e79cf3b235a6ea46648fd42a77335bed9..5c8487a56f346552c59af852872c1f11c44bdc3b 100644 (file)
@@ -7,7 +7,7 @@ on the Macintosh.
 
 The \code{macostools} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module macostools)}
+\setindexsubitem{(in module macostools)}
 
 \begin{funcdesc}{copy}{src\, dst\optional{\, createpath, copytimes}}
 Copy file \var{src} to \var{dst}. The files can be specified as
@@ -60,7 +60,7 @@ pathnames or as \code{FSSpec} objects.
 
 The \code{findertools} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module macostools)}
+\setindexsubitem{(in module macostools)}
 
 \begin{funcdesc}{launch}{file}
 Tell the finder to launch \var{file}. What launching means depends on the file:
index 92c0541827c1ff14c5b820b5a6e761c39e12bbd5..8c742684a95072edee94049915a833899abbe801 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-macspeech}
 \bimodindex{macspeech}
 
-\renewcommand{\indexsubitem}{(in module macspeech)}
+\setindexsubitem{(in module macspeech)}
 
 This module provides an interface to the Macintosh Speech Manager,
 allowing you to let the Macintosh utter phrases. You need a version of
@@ -42,7 +42,7 @@ Return a voice object for voice number \var{num}.
 Voice objects contain the description of a voice. It is currently not
 yet possible to access the parameters of a voice.
 
-\renewcommand{\indexsubitem}{(voice object method)}
+\setindexsubitem{(voice object method)}
 
 \begin{funcdesc}{GetGender}{}
 Return the gender of the voice: 0 for male, 1 for female and -1 for neuter.
@@ -59,7 +59,7 @@ speakers at the same time. Please note that channel pitch and rate are
 interrelated in some way, so that to make your Macintosh sing you will
 have to adjust both.
 
-\renewcommand{\indexsubitem}{(speech channel object method)}
+\setindexsubitem{(speech channel object method)}
 \begin{funcdesc}{SpeakText}{str}
 Start uttering the given string.
 \end{funcdesc}
index a16afc8cb5e576724a85ceea6332108c2a5e0236..f041280e6c517c8988c4ae1566aa5ef2d1943903 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-mactcp}
 \bimodindex{mactcp}
 
-\renewcommand{\indexsubitem}{(in module mactcp)}
+\setindexsubitem{(in module mactcp)}
 
 This module provides an interface to the Macintosh TCP/IP driver
 MacTCP\@. There is an accompanying module \code{macdnr} which provides an
@@ -42,7 +42,7 @@ datagrams on, a value of zero will make MacTCP select a free port.
 
 \subsection{TCP Stream Objects}
 
-\renewcommand{\indexsubitem}{(TCP stream attribute)}
+\setindexsubitem{(TCP stream attribute)}
 
 \begin{datadesc}{asr}
 When set to a value different than \code{None} this should point to a
@@ -54,7 +54,7 @@ is a Python addition to the MacTCP semantics.
 It is safe to do further calls from the \code{asr}.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(TCP stream method)}
+\setindexsubitem{(TCP stream method)}
 
 \begin{funcdesc}{PassiveOpen}{port}
 Wait for an incoming connection on TCP port \var{port} (zero makes the
@@ -119,7 +119,7 @@ This object has no methods, only some members holding information on
 the connection. A complete description of all fields in this objects
 can be found in the Apple documentation. The most interesting ones are:
 
-\renewcommand{\indexsubitem}{(TCP status attribute)}
+\setindexsubitem{(TCP status attribute)}
 
 \begin{datadesc}{localHost}
 \dataline{localPort}
@@ -149,7 +149,7 @@ without blocking).
 Note that, unlike the name suggests, there is nothing stream-like
 about UDP.
 
-\renewcommand{\indexsubitem}{(UDP stream attribute)}
+\setindexsubitem{(UDP stream attribute)}
 
 \begin{datadesc}{asr}
 The asynchronous service routine to be called on events such as
@@ -161,7 +161,7 @@ single argument, the event code.
 A read-only member giving the port number of this UDP stream.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(UDP stream method)}
+\setindexsubitem{(UDP stream method)}
 
 \begin{funcdesc}{Read}{timeout}
 Read a datagram, waiting at most \var{timeout} seconds (-1 is
index c0478ac44b8f5d7e9131d4eebccd9e57851f45a4..eb11e1449f6cde5ff122903fdfa96eabd695e598 100644 (file)
@@ -10,7 +10,7 @@ item numbers correspond. See the source for details.
 
 The \code{EasyDialogs} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module EasyDialogs)}
+\setindexsubitem{(in module EasyDialogs)}
 
 \begin{funcdesc}{Message}{str}
 A modal dialog with the message text \var{str}, which should be at
@@ -75,7 +75,7 @@ for more details.
 
 The \code{FrameWork} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module FrameWork)}
+\setindexsubitem{(in module FrameWork)}
 
 \begin{funcdesc}{Application}{}
 An object representing the complete application. See below for a
@@ -148,7 +148,7 @@ Set the mouse cursor to an arrow.
 \subsection{Application objects}
 Application objects have the following methods, among others:
 
-\renewcommand{\indexsubitem}{(Application method)}
+\setindexsubitem{(Application method)}
 
 \begin{funcdesc}{makeusermenus}{}
 Override this method if you need menus in your application. Append the
@@ -225,7 +225,7 @@ null-event is passed (so you can look at mouse position, etc).
 
 Window objects have the following methods, among others:
 
-\renewcommand{\indexsubitem}{(Window method)}
+\setindexsubitem{(Window method)}
 
 \begin{funcdesc}{open}{}
 Override this method to open a window. Store the MacOS window-id in
@@ -263,7 +263,7 @@ The window was activated (\code{activate==1}) or deactivated
 ControlsWindow objects have the following methods besides those of
 \code{Window} objects:
 
-\renewcommand{\indexsubitem}{(ControlsWindow method)}
+\setindexsubitem{(ControlsWindow method)}
 
 \begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
 Part \code{pcode} of control \code{control} was hit by the
@@ -275,7 +275,7 @@ user. Tracking and such has already been taken care of.
 ScrolledWindow objects are ControlsWindow objects with the following
 extra methods:
 
-\renewcommand{\indexsubitem}{(ScrolledWindow method)}
+\setindexsubitem{(ScrolledWindow method)}
 
 \begin{funcdesc}{scrollbars}{\optional{wantx\, wanty}}
 Create (or destroy) horizontal and vertical scrollbars. The arguments
@@ -331,7 +331,7 @@ and has been handled.
 DialogWindow objects have the following methods besides those of
 \code{Window} objects:
 
-\renewcommand{\indexsubitem}{(DialogWindow method)}
+\setindexsubitem{(DialogWindow method)}
 
 \begin{funcdesc}{open}{resid}
 Create the dialog window, from the DLOG resource with id
@@ -358,7 +358,7 @@ application scriptable.
 
 The \var{MiniAEFrame} module defines the following classes:
 
-\renewcommand{\indexsubitem}{(in module MiniAEFrame)}
+\setindexsubitem{(in module MiniAEFrame)}
 
 \begin{funcdesc}{AEServer}{}
 A class that handles AppleEvent dispatch. Your application should
@@ -379,7 +379,7 @@ provide its own windows, etc.
 
 \subsection{AEServer Objects}
 
-\renewcommand{\indexsubitem}{(AEServer method)}
+\setindexsubitem{(AEServer method)}
 
 \begin{funcdesc}{installaehandler}{classe\, type\, callback}
 Installs an AppleEvent handler. \code{Classe} and \code{type} are the
index 42bdfda54129f7a6b7d8522f8e3e85548c59636e..d616f36014596135e10043ea0591972d5e413add 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-mailbox}
 \stmodindex{mailbox}
 
-\renewcommand{\indexsubitem}{(in module mailbox)}
+\setindexsubitem{(in module mailbox)}
 
 This module defines a number of classes that allow easy and uniform
 access to mail messages in a (unix) mailbox.
index b475b1192c3ec1a2eddb738d7d338017beb6358c..ecc8369925eba5c691c58a412163ab8751886f04 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{mailcap}}
 \label{module-mailcap}
 \stmodindex{mailcap}
-\renewcommand{\indexsubitem}{(in module mailcap)}
+\setindexsubitem{(in module mailcap)}
 
 Mailcap files are used to configure how MIME-aware applications such
 as mail readers and Web browsers react to files with different MIME
@@ -69,9 +69,9 @@ will override settings in the system mailcap files
 \end{funcdesc}
 
 An example usage:
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import mailcap
 >>> d=mailcap.getcaps()
 >>> mailcap.findmatch(d, 'video/mpeg', filename='/tmp/tmp1223')
 ('xmpeg /tmp/tmp1223', {'view': 'xmpeg %s'})
-\end{verbatim}\ecode
+\end{verbatim}
index dc4ed98f02ab50fead35648fbaf613bb4f764a23..fddbba45b34fd736647fe996720956a387e7fda9 100644 (file)
@@ -54,7 +54,7 @@ operating on strings.
 
 The module defines these functions:
 
-\renewcommand{\indexsubitem}{(in module marshal)}
+\setindexsubitem{(in module marshal)}
 
 \begin{funcdesc}{dump}{value\, file}
   Write the value on the open file.  The value must be a supported
index c40030b30f72e01a446cb35ac13079c7976947b1..7f5679c8567ede486981b919f2fa950b536491e8 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-math}
 
 \bimodindex{math}
-\renewcommand{\indexsubitem}{(in module math)}
+\setindexsubitem{(in module math)}
 This module is always available.
 It provides access to the mathematical functions defined by the \C{}
 standard.
index bbf71726393e3509069ec172122e3f62d09ba620..946d00d138775f5300349bf1f1b23ee9a754b8a0 100644 (file)
@@ -14,23 +14,23 @@ so far using the \code{digest()} method.
 For example, to obtain the digest of the string {\tt"Nobody inspects
 the spammish repetition"}:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import md5
 >>> m = md5.new()
 >>> m.update("Nobody inspects")
 >>> m.update(" the spammish repetition")
 >>> m.digest()
 '\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
-\end{verbatim}\ecode
+\end{verbatim}
 %
 More condensed:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> md5.new("Nobody inspects the spammish repetition").digest()
 '\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\renewcommand{\indexsubitem}{(in module md5)}
+\setindexsubitem{(in module md5)}
 
 \begin{funcdesc}{new}{\optional{arg}}
 Return a new md5 object.  If \var{arg} is present, the method call
@@ -44,7 +44,7 @@ For backward compatibility reasons, this is an alternative name for the
 
 An md5 object has the following methods:
 
-\renewcommand{\indexsubitem}{(md5 method)}
+\setindexsubitem{(md5 method)}
 \begin{funcdesc}{update}{arg}
 Update the md5 object with the string \var{arg}.  Repeated calls are
 equivalent to a single call with the concatenation of all the
index 41a62bab664903a7ffe7c2fcd582429ec01aa325..94601b3a0b95ca2d885e355ccbc2da98b9cf1969 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-mimetools}
 \stmodindex{mimetools}
 
-\renewcommand{\indexsubitem}{(in module mimetools)}
+\setindexsubitem{(in module mimetools)}
 
 This module defines a subclass of the class \code{rfc822.Message} and
 a number of utility functions that are useful for the manipulation for
@@ -52,7 +52,7 @@ file \var{output}.  The block size is currently fixed at 8192.
 The \code{mimetools.Message} class defines the following methods in
 addition to the \code{rfc822.Message} class:
 
-\renewcommand{\indexsubitem}{(mimetool.Message method)}
+\setindexsubitem{(mimetool.Message method)}
 
 \begin{funcdesc}{getplist}{}
 Return the parameter list of the \code{Content-type} header.  This is
index 171e7d26f053f5b79ff46b757834cb252ee1c0fc..298275583b55c865b243a75bcb10cadee67476ab 100644 (file)
@@ -1,6 +1,6 @@
 \section{Standard Module \sectcode{mimify}}
 \stmodindex{mimify}
-\renewcommand{\indexsubitem}{(in module mimify)}
+\setindexsubitem{(in module mimify)}
 
 The mimify module defines two functions to convert mail messages to
 and from MIME format.  The mail message can be either a simple message
index 7ab5fe793843074f1fc3c2419f11901e24769e06..07b217026f735d3f7284ba9e42da1bba10c92a33 100644 (file)
@@ -24,7 +24,7 @@ You create an mpz-number by calling the function called \code{mpz} (see
 below for an exact description). An mpz-number is printed like this:
 \code{mpz(\var{value})}.
 
-\renewcommand{\indexsubitem}{(in module mpz)}
+\setindexsubitem{(in module mpz)}
 \begin{funcdesc}{mpz}{value}
   Create a new mpz-number. \var{value} can be an integer, a long,
   another mpz-number, or even a string. If it is a string, it is
@@ -69,7 +69,7 @@ return mpz-numbers.
 
 An mpz-number has one method:
 
-\renewcommand{\indexsubitem}{(mpz method)}
+\setindexsubitem{(mpz method)}
 \begin{funcdesc}{binary}{}
   Convert this mpz-number to a binary string, where the number has been
   stored as an array of radix-256 digits, least significant digit first.
index 219f081512aea7514f9fd41600bd71a311e3a019..8a251da7f458ff5530abe2349ca3c5c6f2ad7467 100644 (file)
@@ -28,20 +28,20 @@ To import module \code{ham} from package \code{spam} and use function
 \code{hamneggs()} from that module, you can use any of the following
 possibilities:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import spam.ham                # *not* "import spam" !!!
 spam.ham.hamneggs()
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 from spam import ham
 ham.hamneggs()
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 from spam.ham import hamneggs
 hamneggs()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \code{import spam} creates an
 empty package named \code{spam} if one does not already exist, but it does
@@ -52,9 +52,9 @@ The only submodule that is guaranteed to be imported is
 \code{spam.__init__} is a submodule of package spam.  It can refer to
 spam's namespace as \code{__} (two underscores):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 __.spam_inited = 1             # Set a package-level variable
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Additional initialization code (setting up variables, importing other
 submodules) can be performed in \file{spam/__init__.py}.
index c0a31381cb35ff81ec5bd3b4a0b6258df1e1a372..7ca8a7af9b5b402d29fd837a45694df11582951d 100644 (file)
@@ -3,7 +3,7 @@
 \stmodindex{nntplib}
 \indexii{NNTP}{protocol}
 
-\renewcommand{\indexsubitem}{(in module nntplib)}
+\setindexsubitem{(in module nntplib)}
 
 This module defines the class \code{NNTP} which implements the client
 side of the NNTP protocol.  It can be used to implement a news reader
@@ -14,7 +14,7 @@ Here are two small examples of how it can be used.  To list some
 statistics about a newsgroup and print the subjects of the last 10
 articles:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = NNTP('news.cwi.nl')
 >>> resp, count, first, last, name = s.group('comp.lang.python')
 >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
@@ -35,12 +35,12 @@ Group comp.lang.python has 59 articles, range 3742 to 3803
 >>> s.quit()
 '205 news.cwi.nl closing connection.  Goodbye.'
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 
 To post an article from a file (this assumes that the article has
 valid headers):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> s = NNTP('news.cwi.nl')
 >>> f = open('/tmp/article')
 >>> s.post(f)
@@ -48,7 +48,7 @@ valid headers):
 >>> s.quit()
 '205 news.cwi.nl closing connection.  Goodbye.'
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module itself defines the following items:
 
@@ -83,7 +83,7 @@ is the server's response: a string beginning with a three-digit code.
 If the server's response indicates an error, the method raises one of
 the above exceptions.
 
-\renewcommand{\indexsubitem}{(NNTP object method)}
+\setindexsubitem{(NNTP object method)}
 
 \begin{funcdesc}{getwelcome}{}
 Return the welcome message sent by the server in reply to the initial
index 190faab6a1c7f1f96a5cb5211c9b5b3d198f1ef3..d371ee3d66f9d9f7b41e5c0e08c8e9a504f979b5 100644 (file)
@@ -11,7 +11,7 @@ leading and trailing \samp{__} are also provided for convenience.
 
 The \code{operator} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module operator)}
+\setindexsubitem{(in module operator)}
 
 \begin{funcdesc}{add}{a, b}
 Return \var{a} \code{+} \var{b}, for \var{a} and \var{b} numbers.
@@ -188,10 +188,10 @@ Delete the slice of \var{a} from index \var{b} to index \var{c}\code{-1}.
 Example: Build a dictionary that maps the ordinals from \code{0} to
 \code{256} to their character equivalents.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import operator
 >>> d = {}
 >>> keys = range(256)
 >>> vals = map(chr, keys)
 >>> map(operator.setitem, [d]*len(keys), keys, vals)
-\end{verbatim}\ecode
+\end{verbatim}
index 763d2f394123dad125e4cf56f817a9737e55ab8a..58f268cc7453345c6ff5b034c8ff3be627e9955c 100644 (file)
@@ -26,7 +26,7 @@ directly from the OS dependent built-in module, so there should be
 In addition to whatever the correct OS dependent module exports, the
 following variables and functions are always exported by \code{os}:
 
-\renewcommand{\indexsubitem}{(in module os)}
+\setindexsubitem{(in module os)}
 
 \begin{datadesc}{name}
 The name of the OS dependent module imported.  The following names
index c54641275a5cc5005518c5fd6094b828db9797ce..efcfd0e5dbb4c712d6cae9f86182065f2e65b7a3 100644 (file)
@@ -15,7 +15,7 @@ to interface with the
 The module is too large to document here in its entirety.
 One interesting function:
 
-\renewcommand{\indexsubitem}{(in module panel)}
+\setindexsubitem{(in module panel)}
 \begin{funcdesc}{defpanellist}{filename}
 Parses a panel description file containing S-expressions written by the
 \emph{Panel Editor}
index 4b838c514d903391e7d16fc09d48500e6fd3c76b..47b5bd454383c307cba7c085f506d2a731873b2e 100644 (file)
@@ -89,7 +89,7 @@ to convert AST objects to other representations such as parse trees
 and compiled code objects, but there are also functions which serve to
 query the type of parse tree represented by an AST object.
 
-\renewcommand{\indexsubitem}{(in module parser)}
+\setindexsubitem{(in module parser)}
 
 
 \subsection{Creating AST Objects}
@@ -289,30 +289,30 @@ bytecode generation, the simplest operation is to do nothing.  For
 this purpose, using the \module{parser} module to produce an
 intermediate data structure is equivelent to the code
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> code = compile('a + 5', 'eval')
 >>> a = 5
 >>> eval(code)
 10
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The equivelent operation using the \module{parser} module is somewhat
 longer, and allows the intermediate internal parse tree to be retained
 as an AST object:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import parser
 >>> ast = parser.expr('a + 5')
 >>> code = parser.compileast(ast)
 >>> a = 5
 >>> eval(code)
 10
-\end{verbatim}\ecode
+\end{verbatim}
 %
 An application which needs both AST and code objects can package this
 code into readily available functions:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import parser
 
 def load_suite(source_string):
@@ -324,7 +324,7 @@ def load_expression(source_string):
     ast = parser.expr(source_string)
     code = parser.compileast(ast)
     return ast, code
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \subsubsection{Information Discovery}
 
@@ -367,16 +367,16 @@ Consider the simplest case of interest when searching for docstrings:
 a module consisting of a docstring and nothing else.  (See file
 \file{docstring.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 """Some documentation.
 """
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using the interpreter to take a look at the parse tree, we find a
 bewildering mass of numbers and parentheses, with the documentation
 buried deep in nested tuples.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import parser
 >>> import pprint
 >>> ast = parser.suite(open('docstring.py').read())
@@ -404,7 +404,7 @@ buried deep in nested tuples.
    (4, ''))),
  (4, ''),
  (0, ''))
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The numbers at the first element of each node in the tree are the node
 types; they map directly to terminal and non-terminal symbols in the
@@ -444,7 +444,7 @@ form, allowing a simple variable representation to be
 the pattern matching, returning a boolean and a dictionary of variable
 name to value mappings.  (See file \file{example.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 from types import ListType, TupleType
 
 def match(pattern, data, vars=None):
@@ -462,13 +462,13 @@ def match(pattern, data, vars=None):
         if not same:
             break
     return same, vars
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using this simple representation for syntactic variables and the symbolic
 node types, the pattern for the candidate docstring subtrees becomes
 fairly readable.  (See file \file{example.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import symbol
 import token
 
@@ -495,18 +495,18 @@ DOCSTRING_STMT_PATTERN = (
                      )))))))))))))))),
      (token.NEWLINE, '')
      ))
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Using the \function{match()} function with this pattern, extracting the
 module docstring from the parse tree created previously is easy:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> found, vars = match(DOCSTRING_STMT_PATTERN, tup[1])
 >>> found
 1
 >>> vars
 {'docstring': '"""Some documentation.\012"""'}
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Once specific data can be extracted from a location where it is
 expected, the question of where information can be expected
@@ -569,7 +569,7 @@ grammar, but the method which recursively creates new information
 objects requires further examination.  Here is the relevant part of
 the \class{SuiteInfoBase} definition from \file{example.py}:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class SuiteInfoBase:
     _docstring = ''
     _name = ''
@@ -599,7 +599,7 @@ class SuiteInfoBase:
                 elif cstmt[0] == symbol.classdef:
                     name = cstmt[2][1]
                     self._class_info[name] = ClassInfo(cstmt)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 After initializing some internal state, the constructor calls the
 \method{_extract_info()} method.  This method performs the bulk of the
@@ -620,13 +620,13 @@ def square(x): "Square an argument."; return x ** 2
 while the long form uses an indented block and allows nested
 definitions:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def make_power(exp):
     "Make a function that raises an argument to the exponent `exp'."
     def raiser(x, y=exp):
         return x ** y
     return raiser
-\end{verbatim}\ecode
+\end{verbatim}
 %
 When the short form is used, the code block may contain a docstring as
 the first, and possibly only, \constant{small_stmt} element.  The
@@ -662,7 +662,7 @@ the real extraction algorithm remains common to all forms of code
 blocks.  A high-level function can be used to extract the complete set
 of information from a source file.  (See file \file{example.py}.)
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def get_docs(fileName):
     source = open(fileName).read()
     import os
@@ -671,7 +671,7 @@ def get_docs(fileName):
     ast = parser.suite(source)
     tup = parser.ast2tuple(ast)
     return ModuleInfo(tup, basename)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This provides an easy-to-use interface to the documentation of a
 module.  If information is required which is not extracted by the code
@@ -703,7 +703,7 @@ to may change between Python versions.
 
 This module also provides one additional data object:
 
-\renewcommand{\indexsubitem}{(in module symbol)}
+\setindexsubitem{(in module symbol)}
 
 
 \begin{datadesc}{sym_name}
@@ -731,7 +731,7 @@ versions.
 This module also provides one data object and some functions.  The
 functions mirror definitions in the Python C header files.
 
-\renewcommand{\indexsubitem}{(in module token)}
+\setindexsubitem{(in module token)}
 
 
 \begin{datadesc}{tok_name}
index b2db2a2f61cb3ddb44816df702d9785b69d05a5f..6f14ab61eebbdfbf12e8b511d335fc4d9a7ea6c6 100644 (file)
@@ -2,7 +2,7 @@
 \stmodindex{pdb}
 \index{debugging}
 
-\renewcommand{\indexsubitem}{(in module pdb)}
+\setindexsubitem{(in module pdb)}
 
 The module \code{pdb} defines an interactive source code debugger for
 Python programs.  It supports setting
@@ -29,7 +29,7 @@ specific modules).
 The debugger's prompt is ``\code{(Pdb) }''.
 Typical usage to run a program under control of the debugger is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import pdb
 >>> import mymodule
 >>> pdb.run('mymodule.test()')
@@ -40,7 +40,7 @@ Typical usage to run a program under control of the debugger is:
 NameError: 'spam'
 > <string>(1)?()
 (Pdb) 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \code{pdb.py} can also be invoked as
 a script to debug other scripts.  For example:
@@ -48,7 +48,7 @@ a script to debug other scripts.  For example:
 
 Typical usage to inspect a crashed program is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import pdb
 >>> import mymodule
 >>> mymodule.test()
@@ -63,7 +63,7 @@ NameError: spam
 > ./mymodule.py(3)test2()
 -> print spam
 (Pdb) 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module defines the following functions; each enters the debugger
 in a slightly different way:
@@ -224,10 +224,10 @@ The exclamation point can be omitted unless the first word
 of the statement resembles a debugger command.
 To set a global variable, you can prefix the assignment
 command with a ``\code{global}'' command on the same line, e.g.:
-\bcode\begin{verbatim}
+\begin{verbatim}
 (Pdb) global list_options; list_options = ['-l']
 (Pdb)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \item[q(uit)]
 
index 5eef11c05334fdc061454817c33be370eb4dbdfa..41191d4d1eb74e4c18dac6e97ad607994e057a58 100644 (file)
@@ -8,7 +8,7 @@
 \indexii{flattening}{objects}
 \indexii{pickling}{objects}
 
-\renewcommand{\indexsubitem}{(in module pickle)}
+\setindexsubitem{(in module pickle)}
 
 The \code{pickle} module implements a basic but powerful algorithm for
 ``pickling'' (a.k.a.\ serializing, marshalling or flattening) nearly
@@ -94,7 +94,7 @@ There are some restrictions on the pickling of class instances.
 First of all, the class must be defined at the top level in a module.
 Furthermore, all its instance variables must be picklable.
 
-\renewcommand{\indexsubitem}{(pickle protocol)}
+\setindexsubitem{(pickle protocol)}
 
 When a pickled class instance is unpickled, its \code{__init__()} method
 is normally \emph{not} invoked.  \strong{Note:} This is a deviation
@@ -144,35 +144,35 @@ definition is not pickled, but re-imported by the unpickling process.
 Therefore, the restriction that the class must be defined at the top
 level in a module applies to pickled classes as well.
 
-\renewcommand{\indexsubitem}{(in module pickle)}
+\setindexsubitem{(in module pickle)}
 
 The interface can be summarized as follows.
 
 To pickle an object \code{x} onto a file \code{f}, open for writing:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p = pickle.Pickler(f)
 p.dump(x)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 A shorthand for this is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pickle.dump(x, f)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 To unpickle an object \code{x} from a file \code{f}, open for reading:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 u = pickle.Unpickler(f)
 x = u.load()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 A shorthand is:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 x = pickle.load(f)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The \code{Pickler} class only calls the method \code{f.write()} with a
 string argument.  The \code{Unpickler} calls the methods \code{f.read()}
index ddd467be95222e705f08a3ed5d7cdba814f6daa7..1754fef9b041d35048f2a96a31322a61ffa634bf 100644 (file)
@@ -28,7 +28,7 @@ for type errors, while errors reported by the system calls raise
 
 Module \code{posix} defines the following data items:
 
-\renewcommand{\indexsubitem}{(data in module posix)}
+\setindexsubitem{(data in module posix)}
 \begin{datadesc}{environ}
 A dictionary representing the string environment at the time
 the interpreter was started.
@@ -50,7 +50,7 @@ a mapping object that behaves almost like a dictionary but invokes
 \code{putenv()} automatically called whenever an item is changed.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(exception in module posix)}
+\setindexsubitem{(exception in module posix)}
 \begin{excdesc}{error}
 This exception is raised when a \POSIX{} function returns a
 \POSIX{}-related error (e.g., not for illegal argument types).  Its
@@ -64,7 +64,7 @@ names for the error codes defined by the underlying operating system.
 
 It defines the following functions and constants:
 
-\renewcommand{\indexsubitem}{(in module posix)}
+\setindexsubitem{(in module posix)}
 \begin{funcdesc}{chdir}{path}
 Change the current working directory to \var{path}.
 \end{funcdesc}
index 3d1fad1297db39eb700a657fc6be0988af023757..fc04d8d6c246b188c20594a4f6323504ae951140 100644 (file)
@@ -21,7 +21,7 @@ the same as a standard file object.
 
 The posixfile module defines the following constants:
 
-\renewcommand{\indexsubitem}{(in module posixfile)}
+\setindexsubitem{(in module posixfile)}
 \begin{datadesc}{SEEK_SET}
 offset is calculated from the start of the file
 \end{datadesc}
@@ -36,7 +36,7 @@ offset is calculated from the end of the file
 
 The posixfile module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module posixfile)}
+\setindexsubitem{(in module posixfile)}
 
 \begin{funcdesc}{open}{filename\optional{\, mode\optional{\, bufsize}}}
  Create a new posixfile object with the given filename and mode.  The
@@ -52,7 +52,7 @@ The posixfile module defines the following functions:
 
 The posixfile object defines the following additional methods:
 
-\renewcommand{\indexsubitem}{(posixfile method)}
+\setindexsubitem{(posixfile method)}
 \begin{funcdesc}{lock}{fmt\, \optional{len\optional{\, start\optional{\, whence}}}}
  Lock the specified section of the file that the file object is
  referring to.  The format is explained
@@ -146,7 +146,7 @@ by the same call.
 
 Examples:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 from posixfile import *
 
 file = open('/tmp/test', 'w')
@@ -154,4 +154,4 @@ file.lock('w|')
 ...
 file.lock('u')
 file.close()
-\end{verbatim}\ecode
+\end{verbatim}
index 52980120aea89f4d24ee3fc7cf25c461176db874..d286dcc9fa4f9695eac04decc5f00c16b73d5921 100644 (file)
@@ -8,7 +8,7 @@ This module implements some useful functions on \POSIX{} pathnames.
 module \code{os} and use \code{os.path}.
 \refstmodindex{os}
 
-\renewcommand{\indexsubitem}{(in module posixpath)}
+\setindexsubitem{(in module posixpath)}
 
 \begin{funcdesc}{basename}{p}
 Return the base name of pathname
index 9e14d5f5af28edb7878c8dddb78449612673ad07..caae69a2fa2462db68195f63cca32d2b634d9a3f 100644 (file)
@@ -19,7 +19,7 @@ to adjust the width constraint.
 
 The \code{pprint} module defines one class:
 
-\renewcommand{\indexsubitem}{(in module pprint)}
+\setindexsubitem{(in module pprint)}
 
 % First the implementation class:
 
@@ -140,7 +140,7 @@ l/lib/python1.4/test', '/usr/local/lib/python1.4/sunos5', '/usr/local/lib/python
 PrettyPrinter instances (returned by \code{PrettyPrinter()} above)
 have the following methods.
 
-\renewcommand{\indexsubitem}{(PrettyPrinter method)}
+\setindexsubitem{(PrettyPrinter method)}
 
 \begin{funcdesc}{pformat}{object}
 Return the formatted representation of \var{object}.  This takes into
index a3337446e003723fd9ef39ff8d248c470ad91ba3..20da0b6bd2041797a0400b23fdcb238b1b68e102 100644 (file)
@@ -106,10 +106,10 @@ rapidly perform profiling on an existing application.
 To profile an application with a main entry point of \samp{foo()}, you
 would add the following to your module:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import profile
 profile.run("foo()")
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The above action would cause \samp{foo()} to be run, and a series of
 informative lines (the profile) to be printed.  The above approach is
@@ -118,10 +118,10 @@ save the results of a profile into a file for later examination, you
 can supply a file name as the second argument to the \code{run()}
 function:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import profile
 profile.run("foo()", 'fooprof')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \code{profile.py} can also be invoked as
 a script to profile another script.  For example:
@@ -131,10 +131,10 @@ When you wish to review the profile, you should use the methods in the
 \code{pstats} module.  Typically you would load the statistics data as
 follows:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import pstats
 p = pstats.Stats('fooprof')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The class \code{Stats} (the above code just created an instance of
 this class) has a variety of methods for manipulating and printing the
@@ -142,9 +142,9 @@ data that was just read into \samp{p}.  When you ran
 \code{profile.run()} above, what was printed was the result of three
 method calls:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.strip_dirs().sort_stats(-1).print_stats()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The first method removed the extraneous path from all the module
 names. The second method sorted all the entries according to the
@@ -152,18 +152,18 @@ standard module/line/name string that is printed (this is to comply
 with the semantics of the old profiler).  The third method printed out
 all the statistics.  You might try the following sort calls:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('name')
 p.print_stats()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The first call will actually sort the list by function name, and the
 second call will print out the statistics.  The following are some
 interesting calls to experiment with:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('cumulative').print_stats(10)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This sorts the profile by cumulative time in a function, and then only
 prints the ten most significant lines.  If you want to understand what
@@ -172,26 +172,26 @@ algorithms are taking time, the above line is what you would use.
 If you were looking to see what functions were looping a lot, and
 taking a lot of time, you would do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('time').print_stats(10)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 to sort according to time spent within each function, and then print
 the statistics for the top ten functions.
 
 You might also try:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('file').print_stats('__init__')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This will sort all the statistics by file name, and then print out
 statistics for only the class init methods ('cause they are spelled
 with \code{__init__} in them).  As one final example, you could try:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.sort_stats('time', 'cum').print_stats(.5, 'init')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 This line sorts statistics with a primary key of time, and a secondary
 key of cumulative time, and then prints out some of the statistics.
@@ -202,19 +202,19 @@ maintained, and that sub-sub-list is printed.
 If you wondered what functions called the above functions, you could
 now (\samp{p} is still sorted according to the last criteria) do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.print_callers(.5, 'init')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 and you would get a list of callers for each of the listed functions. 
 
 If you want more functionality, you're going to have to read the
 manual, or guess what the following functions do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 p.print_callees()
 p.add('fooprof')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{What Is Deterministic Profiling?}
 \nodename{Deterministic Profiling}
@@ -251,7 +251,7 @@ of algorithms to be directly compared to iterative implementations.
 
 \section{Reference Manual}
 
-\renewcommand{\indexsubitem}{(profiler function)}
+\setindexsubitem{(profiler function)}
 
 The primary entry point for the profiler is the global function
 \code{profile.run()}.  It is typically used to create any profile
@@ -273,7 +273,7 @@ function automatically prints a simple profiling report, sorted by the
 standard name string (file/line/function-name) that is presented in
 each line.  The following is a typical output from such a call:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
       main()
       2706 function calls (2004 primitive calls) in 4.504 CPU seconds
 
@@ -283,7 +283,7 @@ ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      2    0.006    0.003    0.953    0.477 pobject.py:75(save_objects)
   43/3    0.533    0.012    0.749    0.250 pobject.py:99(evaluate)
  ...
-\end{verbatim}\ecode
+\end{verbatim}
 
 The first line indicates that this profile was generated by the call:\\
 \code{profile.run('main()')}, and hence the exec'ed string is
@@ -348,7 +348,7 @@ need to be combined with data in an existing \code{Stats} object, the
 
 \subsection{The \sectcode{Stats} Class}
 
-\renewcommand{\indexsubitem}{(Stats method)}
+\setindexsubitem{(Stats method)}
 
 \begin{funcdesc}{strip_dirs}{}
 This method for the \code{Stats} class removes all leading path information
@@ -447,17 +447,17 @@ Python 1.5b1, this uses the Perl-style regular expression syntax
 defined by the \code{re} module).  If several restrictions are
 provided, then they are applied sequentially.  For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print_stats(.1, "foo:")
-\end{verbatim}\ecode
+\end{verbatim}
 %
 would first limit the printing to first 10\% of list, and then only
 print functions that were part of filename \samp{.*foo:}.  In
 contrast, the command:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 print_stats("foo:", .1)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 would limit the list to all functions having file names \samp{.*foo:},
 and then proceed to only print the first 10\% of them.
@@ -487,10 +487,10 @@ returned by earlier methods.  All standard methods in this class
 return the instance that is being processed, so that the commands can
 be strung together.  For example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pstats.Stats('foofile').strip_dirs().sort_stats('cum') \
                        .print_stats().ignore()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 would perform all the indicated functions, but it would not return
 the final reference to the \code{Stats} instance.%
@@ -551,27 +551,27 @@ function, and socking away the results.  The following procedure can
 be used to obtain this constant for a given platform (see discussion
 in section Limitations above).
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import profile
 pr = profile.Profile()
 pr.calibrate(100)
 pr.calibrate(100)
 pr.calibrate(100)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The argument to calibrate() is the number of times to try to do the
 sample calls to get the CPU times.  If your computer is \emph{very}
 fast, you might have to do:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pr.calibrate(1000)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 or even:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pr.calibrate(10000)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The object of this exercise is to get a fairly consistent result.
 When you have a consistent answer, you are ready to use that number in
@@ -584,7 +584,7 @@ The following shows how the trace_dispatch() method in the Profile
 class should be modified to install the calibration constant on a Sun
 Sparcstation 1000:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def trace_dispatch(self, frame, event, arg):
     t = self.timer()
     t = t[0] + t[1] - self.t - .00053 # Calibration constant
@@ -596,14 +596,14 @@ def trace_dispatch(self, frame, event, arg):
         r = self.timer()
         self.t = r[0] + r[1] - t # put back unrecorded delta
     return
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Note that if there is no calibration constant, then the line
 containing the callibration constant should simply say:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 t = t[0] + t[1] - self.t  # no calibration constant
-\end{verbatim}\ecode
+\end{verbatim}
 %
 You can also achieve the same results using a derived class (and the
 profiler will actually run equally fast!!), but the above method is
@@ -632,9 +632,9 @@ timer function is used, then the basic class has an option for that in
 the constructor for the class.  Consider passing the name of a
 function to call into the constructor:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 pr = profile.Profile(your_time_func)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The resulting profiler will call \code{your_time_func()} instead of
 \code{os.times()}.  The function should return either a single number
@@ -664,7 +664,7 @@ stats, and is quite useful when there is \emph{no} recursion in the
 user's code.  It is also a lot more accurate than the old profiler, as
 it does not charge all its overhead time to the user's code.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class OldProfile(Profile):
 
     def trace_dispatch_exception(self, frame, t):
@@ -714,7 +714,7 @@ class OldProfile(Profile):
                       callers[func_caller]
                 nc = nc + callers[func_caller]
             self.stats[nor_func] = nc, nc, tt, ct, nor_callers
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \subsection{HotProfile Class}
 
@@ -725,7 +725,7 @@ function, so it runs very quickly (re: very low overhead).  In truth,
 the basic profiler is so fast, that is probably not worth the savings
 to give up the data, but this class still provides a nice example.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class HotProfile(Profile):
 
     def trace_dispatch_exception(self, frame, t):
@@ -761,4 +761,4 @@ class HotProfile(Profile):
             nc, tt = self.timings[func]
             nor_func = self.func_normalize(func)
             self.stats[nor_func] = nc, nc, tt, 0, {}
-\end{verbatim}\ecode
+\end{verbatim}
index 82ebd6164d0e56859ed7b05ff1f715ad56ca5afc..8e1fd2bb7e2d8c81dec510431005b90f861a7106 100644 (file)
@@ -19,7 +19,7 @@ A \code{KeyError} exception is raised if the entry asked for cannot be found.
 
 It defines the following items:
 
-\renewcommand{\indexsubitem}{(in module pwd)}
+\setindexsubitem{(in module pwd)}
 \begin{funcdesc}{getpwuid}{uid}
 Return the password database entry for the given numeric user ID.
 \end{funcdesc}
index 43f48acfc49c0bfab11a7ac582003596e3fbb78c..f6aa31e59555539a86968fe5a7b01d3c185d57e5 100644 (file)
@@ -18,7 +18,7 @@ Python.
 
 The \code{Queue} module defines the following exception:
 
-\renewcommand{\indexsubitem}{(in module Queue)}
+\setindexsubitem{(in module Queue)}
 
 \begin{excdesc}{Empty}
 Exception raised when non-blocking get (e.g. \code{get_nowait()}) is
@@ -35,7 +35,7 @@ other queue organizations (e.g. stack) but the inheritable interface
 is not described here.  See the source code for details.  The public
 interface methods are:
 
-\renewcommand{\indexsubitem}{(__init__ method)}
+\setindexsubitem{(__init__ method)}
 
 \begin{funcdesc}{__init__}{maxsize}
 Constructor for the class.  \var{maxsize} is an integer that sets the
@@ -45,41 +45,41 @@ queue items are consumed.  If \var{maxsize} is less than or equal to
 zero, the queue size is infinite.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(qsize method)}
+\setindexsubitem{(qsize method)}
 
 \begin{funcdesc}{qsize}{}
 Returns the approximate size of the queue.  Because of multithreading
 semantics, this number is not reliable.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(empty method)}
+\setindexsubitem{(empty method)}
 
 \begin{funcdesc}{empty}{}
 Returns 1 if the queue is empty, 0 otherwise.  Because of
 multithreading semantics, this is not reliable.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(full method)}
+\setindexsubitem{(full method)}
 
 \begin{funcdesc}{full}{}
 Returns 1 if the queue is full, 0 otherwise.  Because of
 multithreading semantics, this is not reliable.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(put method)}
+\setindexsubitem{(put method)}
 
 \begin{funcdesc}{put}{item}
 Puts \var{item} into the queue.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(get method)}
+\setindexsubitem{(get method)}
 
 \begin{funcdesc}{get}{}
 Gets and returns an item from the queue, blocking if necessary until
 one is available.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(get_nowait method)}
+\setindexsubitem{(get_nowait method)}
 
 \begin{funcdesc}{get_nowait}{}
 Gets and returns an item from the queue if one is immediately
index d1cb29719f77d04ed519c5c4473ec7bd288429fa..4ad0c0f91cc47d288d74d9e0526b6d54f5654404 100644 (file)
@@ -11,7 +11,7 @@ are many such characters, as when sending a graphics file.
 \indexii{quoted printable}{encoding}
 \index{MIME!quoted-printable encoding}
 
-\renewcommand{\indexsubitem}{(in module quopri)}
+\setindexsubitem{(in module quopri)}
 
 \begin{funcdesc}{decode}{input\, output}
 Decode the contents of the \var{input} file and write the resulting
index 4ba5f17224f47d6bc18ac302b2d2dbf8d83384b0..07d309eded951421c8c91a968498add9ff20f836 100644 (file)
@@ -8,7 +8,7 @@ given library's implementation.  While still supported for
 compatibility, the \code{rand} module is now considered obsolete; if
 possible, use the \code{whrandom} module instead.
 
-\renewcommand{\indexsubitem}{(in module rand)}
+\setindexsubitem{(in module rand)}
 
 \begin{funcdesc}{choice}{seq}
 Returns a random element from the sequence \var{seq}.
index 7b2909237dae1dba38166a6da1b227a15352e919..ab4527fe3728ecaa33c23479872d78785a74d09d 100644 (file)
@@ -19,7 +19,7 @@ after the corresponding variables in the distribution's equation, as
 used in common mathematical practice; most of these equations can be
 found in any statistics text.
 
-\renewcommand{\indexsubitem}{(in module random)}
+\setindexsubitem{(in module random)}
 \begin{funcdesc}{betavariate}{alpha\, beta}
 Beta distribution.  Conditions on the parameters are \code{alpha>-1}
 and \code{beta>-1}.
index 3c288d1f5861c89a1c01f35c9673d966aab60f63..55125ecd778e83e6239a5a664909565ff2572744 100644 (file)
@@ -258,7 +258,7 @@ for the current locale.
 
 The module defines the following functions and constants, and an exception:
 
-\renewcommand{\indexsubitem}{(in module re)}
+\setindexsubitem{(in module re)}
 
 \begin{funcdesc}{compile}{pattern\optional{\, flags}}
   Compile a regular expression pattern into a regular expression
@@ -313,10 +313,10 @@ leftmost such \code{\#} through the end of the line are ignored.
 
 The sequence
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 prog = re.compile(pat)
 result = prog.match(str)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is equivalent to
 
@@ -365,14 +365,14 @@ expression will be used several times in a single program.
   1.5 release, \var{maxsplit} was ignored.  This has been fixed in
   later releases.)
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> re.split('[\W]+', 'Words, words, words.')
 ['Words', 'words', 'words', '']
 >>> re.split('([\W]+)', 'Words, words, words.')
 ['Words', ', ', 'words', ', ', 'words', '.', '']
 >>> re.split('[\W]+', 'Words, words, words.', 1)
 ['Words', 'words, words.']
-\end{verbatim}\ecode
+\end{verbatim}
 %
   This function combines and extends the functionality of
   the old \code{regsub.split()} and \code{regsub.splitx()}.
@@ -387,13 +387,13 @@ it is called for every non-overlapping occurance of \var{pattern}.
 The function takes a single match object argument, and returns the
 replacement string.  For example:
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> def dashrepl(matchobj):
 ...    if matchobj.group(0) == '-': return ' '
 ...    else: return '-'
 >>> re.sub('-{1,2}', dashrepl, 'pro----gram-files')
 'pro--gram files'
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The pattern may be a string or a 
 regex object; if you need to specify
@@ -428,7 +428,7 @@ Perform the same operation as \code{sub()}, but return a tuple
 Compiled regular expression objects support the following methods and
 attributes:
 
-\renewcommand{\indexsubitem}{(re method)}
+\setindexsubitem{(re method)}
 \begin{funcdesc}{match}{string\optional{\, pos}\optional{\, endpos}}
   If zero or more characters at the beginning of \var{string} match
   this regular expression, return a corresponding
@@ -469,7 +469,7 @@ Identical to the \code{sub()} function, using the compiled pattern.
 Identical to the \code{subn()} function, using the compiled pattern.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(regex attribute)}
+\setindexsubitem{(regex attribute)}
 
 \begin{datadesc}{flags}
 The flags argument used when the regex object was compiled, or 0 if no
index 00005e2396aa08a8271006e8b9dc93976cd64b43..18b8b186759ea440cdd88cd19da0e787e65b8287 100644 (file)
@@ -186,7 +186,7 @@ the string.
 
 The module defines these functions, and an exception:
 
-\renewcommand{\indexsubitem}{(in module regex)}
+\setindexsubitem{(in module regex)}
 
 \begin{funcdesc}{match}{pattern\, string}
   Return how many characters at the beginning of \var{string} match
@@ -215,16 +215,16 @@ The module defines these functions, and an exception:
 
   The sequence
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 prog = regex.compile(pat)
 result = prog.match(str)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is equivalent to
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 result = regex.match(pat, str)
-\end{verbatim}\ecode
+\end{verbatim}
 
 but the version using \code{compile()} is more efficient when multiple
 regular expressions are used concurrently in a single program.  (The
@@ -274,7 +274,7 @@ equivalents.
 \noindent
 Compiled regular expression objects support these methods:
 
-\renewcommand{\indexsubitem}{(regex method)}
+\setindexsubitem{(regex method)}
 \begin{funcdesc}{match}{string\optional{\, pos}}
   Return how many characters at the beginning of \var{string} match
   the compiled regular expression.  Return \code{-1} if the string
@@ -319,7 +319,7 @@ identifying groups by their group name.
 \noindent
 Compiled regular expressions support these data attributes:
 
-\renewcommand{\indexsubitem}{(regex attribute)}
+\setindexsubitem{(regex attribute)}
 
 \begin{datadesc}{regs}
 When the last call to the \code{match()} or \code{search()} method found a
index 48cff87d2f8fd3d1e13532cf71f4ee088d6f05ef..5158d5372384d83ae7e24e35e666853b93ef3ce8 100644 (file)
@@ -18,7 +18,7 @@ expressions to \module{re} style regular expressions.  (For more
 conversion help, see the URL
 \url{http://starship.skyport.net/crew/amk/regex/regex-to-re.html}.)
 
-\renewcommand{\indexsubitem}{(in module regsub)}
+\setindexsubitem{(in module regsub)}
 
 \begin{funcdesc}{sub}{pat\, repl\, str}
 Replace the first occurrence of pattern \var{pat} in string
index 7af4368120487e733169b9ed97cf0dd3f921ae88..6260a202172a804091148ecd1de7d746f42206ef 100644 (file)
@@ -11,7 +11,7 @@ children.
 
 A single exception is defined for errors:
 
-\renewcommand{\indexsubitem}{(in module resource)}
+\setindexsubitem{(in module resource)}
 
 \begin{excdesc}{error}
   The functions described below may raise this error if the underlying
index 742e32bad5be4edcbe19e2eaa8985e7ca88611bf..4ea3f3cbb4fe1d8a99e05183c490060b9b814ba9 100644 (file)
@@ -1,60 +1,60 @@
 \section{Standard Module \sectcode{rexec}}
 \label{module-rexec}
 \stmodindex{rexec}
-\renewcommand{\indexsubitem}{(in module rexec)}
+\setindexsubitem{(in module rexec)}
 
-This module contains the \code{RExec} class, which supports
+This module contains the \class{RExec} class, which supports
 \code{r_exec()}, \code{r_eval()}, \code{r_execfile()}, and
 \code{r_import()} methods, which are restricted versions of the standard
 Python functions \code{exec()}, \code{eval()}, \code{execfile()}, and
 the \code{import} statement.
 Code executed in this restricted environment will
 only have access to modules and functions that are deemed safe; you
-can subclass \code{RExec} to add or remove capabilities as desired.
+can subclass \class{RExec} to add or remove capabilities as desired.
 
-\emph{Note:} The \code{RExec} class can prevent code from performing
+\emph{Note:} The \class{RExec} class can prevent code from performing
 unsafe operations like reading or writing disk files, or using TCP/IP
 sockets.  However, it does not protect against code using extremely
 large amounts of memory or CPU time.  
 
 \begin{funcdesc}{RExec}{\optional{hooks\optional{\, verbose}}}
-Returns an instance of the \code{RExec} class.  
+Returns an instance of the \class{RExec} class.  
 
 \var{hooks} is an instance of the \code{RHooks} class or a subclass of it.
 If it is omitted or \code{None}, the default \code{RHooks} class is
 instantiated.
-Whenever the RExec module searches for a module (even a built-in one)
-or reads a module's code, it doesn't actually go out to the file
-system itself.  Rather, it calls methods of an RHooks instance that
-was passed to or created by its constructor.  (Actually, the RExec
-object doesn't make these calls---they are made by a module loader
-object that's part of the RExec object.  This allows another level of
-flexibility, e.g. using packages.)
-
-By providing an alternate RHooks object, we can control the
+Whenever the \module{RExec} module searches for a module (even a
+built-in one) or reads a module's code, it doesn't actually go out to
+the file system itself.  Rather, it calls methods of an \class{RHooks}
+instance that was passed to or created by its constructor.  (Actually,
+the \class{RExec} object doesn't make these calls --- they are made by
+a module loader object that's part of the \class{RExec} object.  This
+allows another level of flexibility, e.g. using packages.)
+
+By providing an alternate \class{RHooks} object, we can control the
 file system accesses made to import a module, without changing the
 actual algorithm that controls the order in which those accesses are
-made.  For instance, we could substitute an RHooks object that passes
-all filesystem requests to a file server elsewhere, via some RPC
-mechanism such as ILU.  Grail's applet loader uses this to support
+made.  For instance, we could substitute an \class{RHooks} object that
+passes all filesystem requests to a file server elsewhere, via some
+RPC mechanism such as ILU.  Grail's applet loader uses this to support
 importing applets from a URL for a directory.
 
 If \var{verbose} is true, additional debugging output may be sent to
 standard output.
 \end{funcdesc}
 
-The RExec class has the following class attributes, which are used by the
-\code{__init__} method.  Changing them on an existing instance won't
-have any effect; instead, create a subclass of \code{RExec} and assign
-them new values in the class definition.  Instances of the new class
-will then use those new values.  All these attributes are tuples of
-strings.
+The \class{RExec} class has the following class attributes, which are
+used by the \code{__init__()} method.  Changing them on an existing
+instance won't have any effect; instead, create a subclass of
+\class{RExec} and assign them new values in the class definition.
+Instances of the new class will then use those new values.  All these
+attributes are tuples of strings.
 
-\renewcommand{\indexsubitem}{(RExec object attribute)}
+\setindexsubitem{(RExec object attribute)}
 \begin{datadesc}{nok_builtin_names}
 Contains the names of built-in functions which will \emph{not} be
 available to programs running in the restricted environment.  The
-value for \code{RExec} is \code{('open',} \code{'reload',}
+value for \class{RExec} is \code{('open',} \code{'reload',}
 \code{'__import__')}.  (This gives the exceptions, because by far the
 majority of built-in functions are harmless.  A subclass that wants to
 override this variable should probably start with the value from the
@@ -65,7 +65,7 @@ added to this module.)
 
 \begin{datadesc}{ok_builtin_modules}
 Contains the names of built-in modules which can be safely imported.
-The value for \code{RExec} is \code{('audioop',} \code{'array',}
+The value for \class{RExec} is \code{('audioop',} \code{'array',}
 \code{'binascii',} \code{'cmath',} \code{'errno',} \code{'imageop',}
 \code{'marshal',} \code{'math',} \code{'md5',} \code{'operator',}
 \code{'parser',} \code{'regex',} \code{'rotor',} \code{'select',}
@@ -77,7 +77,7 @@ class as a starting point.
 \begin{datadesc}{ok_path}
 Contains the directories which will be searched when an \code{import}
 is performed in the restricted environment.  
-The value for \code{RExec} is the same as \code{sys.path} (at the time
+The value for \class{RExec} is the same as \code{sys.path} (at the time
 the module is loaded) for unrestricted code.
 \end{datadesc}
 
@@ -85,7 +85,7 @@ the module is loaded) for unrestricted code.
 % Should this be called ok_os_names?
 Contains the names of the functions in the \code{os} module which will be
 available to programs running in the restricted environment.  The
-value for \code{RExec} is \code{('error',} \code{'fstat',}
+value for \class{RExec} is \code{('error',} \code{'fstat',}
 \code{'listdir',} \code{'lstat',} \code{'readlink',} \code{'stat',}
 \code{'times',} \code{'uname',} \code{'getpid',} \code{'getppid',}
 \code{'getcwd',} \code{'getuid',} \code{'getgid',} \code{'geteuid',}
@@ -95,13 +95,13 @@ value for \code{RExec} is \code{('error',} \code{'fstat',}
 \begin{datadesc}{ok_sys_names}
 Contains the names of the functions and variables in the \code{sys}
 module which will be available to programs running in the restricted
-environment.  The value for \code{RExec} is \code{('ps1',}
+environment.  The value for \class{RExec} is \code{('ps1',}
 \code{'ps2',} \code{'copyright',} \code{'version',} \code{'platform',}
 \code{'exit',} \code{'maxint')}.
 \end{datadesc}
 
-RExec instances support the following methods:
-\renewcommand{\indexsubitem}{(RExec object method)}
+\class{RExec} instances support the following methods:
+\setindexsubitem{(RExec object method)}
 
 \begin{funcdesc}{r_eval}{code}
 \var{code} must either be a string containing a Python expression, or
@@ -141,7 +141,7 @@ Execute the Python code contained in the file \var{filename} in the
 restricted environment.
 \end{funcdesc}
 
-\code{RExec} objects must also support various methods which will be
+\class{RExec} objects must also support various methods which will be
 implicitly called by code executing in the restricted environment.
 Overriding these methods in a subclass is used to change the policies
 enforced by a restricted environment.
@@ -155,7 +155,7 @@ exception if the module is considered unsafe.
 Method called when \code{open()} is called in the restricted
 environment.  The arguments are identical to those of \code{open()},
 and a file object (or a class instance compatible with file objects)
-should be returned.  \code{RExec}'s default behaviour is allow opening
+should be returned.  \class{RExec}'s default behaviour is allow opening
 any file for reading, but forbidding any attempt to write a file.  See
 the example below for an implementation of a less restrictive
 \code{r_open()}.
@@ -173,7 +173,7 @@ restricted environment's \code{sys.modules} dictionary).
 And their equivalents with access to restricted standard I/O streams:
 
 \begin{funcdesc}{s_import}{modulename\optional{\, globals, locals, fromlist}}
-Import the module \var{modulename}, raising an \code{ImportError}
+Import the module \var{modulename}, raising an \exception{ImportError}
 exception if the module is considered unsafe.
 \end{funcdesc}
 
@@ -189,10 +189,11 @@ Unload the module object \var{module}.
 \subsection{An example}
 
 Let us say that we want a slightly more relaxed policy than the
-standard RExec class.  For example, if we're willing to allow files in
-\file{/tmp} to be written, we can subclass the \code{RExec} class:
+standard \class{RExec} class.  For example, if we're willing to allow
+files in \file{/tmp} to be written, we can subclass the \class{RExec}
+class:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 class TmpWriterRExec(rexec.RExec):
     def r_open(self, file, mode='r', buf=-1):
         if mode in ('r', 'rb'):
@@ -206,7 +207,7 @@ class TmpWriterRExec(rexec.RExec):
                 raise IOError, "'..' in filename forbidden"
         else: raise IOError, "Illegal open() mode"
         return open(file, mode, buf)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Notice that the above code will occasionally forbid a perfectly valid
 filename; for example, code in the restricted environment won't be
index 78bbabd0b04a28ba248afdd9722cde775136d838..137475522755f6d38ab2844c858e7ca6419c8d43 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-rfc822}
 \stmodindex{rfc822}
 
-\renewcommand{\indexsubitem}{(in module rfc822)}
+\setindexsubitem{(in module rfc822)}
 
 This module defines a class, \code{Message}, which represents a
 collection of ``email headers'' as defined by the Internet standard
index d923fc28e8c1cbd5cc60d87f531861f816a6855a..9432d2e696764dffdd32a758912165a92ed17352 100644 (file)
@@ -9,7 +9,7 @@ is enough in some cases.  Currently, colormap files are not supported.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module rgbimg)}
+\setindexsubitem{(in module rgbimg)}
 \begin{excdesc}{error}
 This exception is raised on all errors, such as unsupported file type, etc.
 \end{excdesc}
index 4999c812aa2b16e990ea0a1f598f85493ec4fa40..d2a8460122ad1cf2a5212307fb39730454ead823 100644 (file)
@@ -24,7 +24,7 @@ order.
 
 The available functions in this module are:
 
-\renewcommand{\indexsubitem}{(in module rotor)}
+\setindexsubitem{(in module rotor)}
 \begin{funcdesc}{newrotor}{key\optional{\, numrotors}}
 Return a rotor object. \var{key} is a string containing the encryption key
 for the object; it can contain arbitrary binary data. The key will be used
@@ -35,7 +35,7 @@ if it is omitted, a default value of 6 will be used.
 
 Rotor objects have the following methods:
 
-\renewcommand{\indexsubitem}{(rotor method)}
+\setindexsubitem{(rotor method)}
 \begin{funcdesc}{setkey}{key}
 Sets the rotor's key to \var{key}.
 \end{funcdesc}
@@ -63,7 +63,7 @@ string containing the ciphertext.
 \end{funcdesc}
 
 An example usage:
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import rotor
 >>> rt = rotor.newrotor('key', 12)
 >>> rt.encrypt('bar')
@@ -79,7 +79,7 @@ An example usage:
 >>> rt.decrypt('\357\375$')
 'l(\315'
 >>> del rt
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module's code is not an exact simulation of the original Enigma device;
 it implements the rotor encryption scheme differently from the original. The
index 4291dbfae4f315b3145bbafff5e714e94a1d54eb..956bf7f3c0de9067d25410ffebc7013c79e38717 100644 (file)
@@ -5,7 +5,7 @@
 This module provides access to the function \code{select} available in
 most \UNIX{} versions.  It defines the following:
 
-\renewcommand{\indexsubitem}{(in module select)}
+\setindexsubitem{(in module select)}
 \begin{excdesc}{error}
 The exception raised when an error occurs.  The accompanying value is
 a pair containing the numeric error code from \code{errno} and the
index 5269f2009e61964371a6abd1797b006d8a0a068c..c63e7282260c31734cf27831f577e3de3403ac26 100644 (file)
@@ -36,7 +36,7 @@ spaces, tabs, and newlines are allowed between the trailing
 The \code{SGMLParser} class must be instantiated without arguments.
 It has the following interface methods:
 
-\renewcommand{\indexsubitem}{(SGMLParser method)}
+\setindexsubitem{(SGMLParser method)}
 
 \begin{funcdesc}{reset}{}
 Reset the instance.  Loses all unprocessed data.  This is called
index 25ced0e53db22d1d9842224e534f0d82ae870b49..434953470fc788cc70aa4337f605b691433faaad 100644 (file)
@@ -13,7 +13,7 @@ sub-objects.  The keys are ordinary strings.
 To summarize the interface (\code{key} is a string, \code{data} is an
 arbitrary object):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import shelve
 
 d = shelve.open(filename) # open, with (g)dbm filename -- no suffix
@@ -28,7 +28,7 @@ flag = d.has_key(key)   # true if the key exists
 list = d.keys() # a list of all existing keys (slow!)
 
 d.close()       # close it
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Restrictions:
 
index cbec56fddd4bd946b26c6e85e3bc5d532c0fbe46..39286a7ff920e41f4d9f7e3300f7b7b816a9a87c 100644 (file)
@@ -62,7 +62,7 @@ communication.  Use locks instead.
 
 The variables defined in the \module{signal} module are:
 
-\renewcommand{\indexsubitem}{(in module signal)}
+\setindexsubitem{(in module signal)}
 \begin{datadesc}{SIG_DFL}
   This is one of two standard signal handling options; it will simply
   perform the default function for the signal.  For example, on most
index 7e80b08a6a99e2ee6cc07baa608549cd7ab9ecc3..ba3e23df71610722efe7b56c37711f6d33a83db4 100644 (file)
@@ -6,7 +6,7 @@
 
 In earlier versions of Python (up to and including 1.5a3), scripts or
 modules that needed to use site-specific modules would place
-\code{import site} somewhere near the top of their code.  This is no
+\samp{import site} somewhere near the top of their code.  This is no
 longer necessary.
 
 This will append site-specific paths to to the module search path.
@@ -42,29 +42,29 @@ set to \file{/usr/local}.  The Python 1.5 library is then installed in
 files, \file{foo.pth} and \file{bar.pth}.  Assume \file{foo.pth}
 contains the following:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 # foo package configuration
 
 foo
 bar
 bletch
-\end{verbatim}\ecode
+\end{verbatim}
 
 and \file{bar.pth} contains:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 # bar package configuration
 
 bar
-\end{verbatim}\ecode
+\end{verbatim}
 
 Then the following directories are added to \code{sys.path}, in this
 order:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 /usr/local/python1.5/site-packages/bar
 /usr/local/python1.5/site-packages/foo
-\end{verbatim}\ecode
+\end{verbatim}
 
 Note that \file{bletch} is omitted because it doesn't exist; the
 \file{bar} directory precedes the \file{foo} directory because
index 41b27f957fe6ecb9c6a2bfc7a89e8026c79e54f1..9b71f1f65aac370829b8e17d7d6d5462ee6aa2a8 100644 (file)
@@ -47,7 +47,7 @@ method.
 
 The module \code{socket} exports the following constants and functions:
 
-\renewcommand{\indexsubitem}{(in module socket)}
+\setindexsubitem{(in module socket)}
 \begin{excdesc}{error}
 This exception is raised for socket- or address-related errors.
 The accompanying value is either a string telling what went wrong or a
@@ -190,7 +190,7 @@ Socket objects have the following methods.  Except for
 \code{makefile()} these correspond to \UNIX{} system calls applicable to
 sockets.
 
-\renewcommand{\indexsubitem}{(socket method)}
+\setindexsubitem{(socket method)}
 \begin{funcdesc}{accept}{}
 Accept a connection.
 The socket must be bound to an address and listening for connections.
@@ -343,7 +343,7 @@ Also note that the server does not \code{send}/\code{receive} on the
 socket it is listening on but on the new socket returned by
 \code{accept}.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 # Echo server program
 from socket import *
 HOST = ''                 # Symbolic name meaning the local host
@@ -358,9 +358,9 @@ while 1:
     if not data: break
     conn.send(data)
 conn.close()
-\end{verbatim}\ecode
+\end{verbatim}
 %
-\bcode\begin{verbatim}
+\begin{verbatim}
 # Echo client program
 from socket import *
 HOST = 'daring.cwi.nl'    # The remote host
@@ -371,7 +371,7 @@ s.send('Hello, world')
 data = s.recv(1024)
 s.close()
 print 'Received', `data`
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \begin{seealso}
 \seemodule{SocketServer}{classes that simplify writing network servers}
index 98ffec66fbffaa4993d36eb034dae66f4d064395..c4b0e736a91a33cd9ae3f1f94aca4967d3641e8e 100644 (file)
@@ -37,7 +37,7 @@ many requests.
 Server classes have the same external methods and attributes, no
 matter what network protocol they use:
 
-\renewcommand{\indexsubitem}{(SocketServer protocol)}
+\setindexsubitem{(SocketServer protocol)}
 
 %XXX should data and methods be intermingled, or separate?
 % how should the distinction between class and instance variables be
index 27d9bf3d3cb1e76c9b20faa87f7ea710d1fd41c8..dc908e7c7e77c6f992ef6c8e9e521b8c293f02c5 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-soundex}
 \bimodindex{soundex}
 
-\renewcommand{\indexsubitem}{(in module soundex)}
+\setindexsubitem{(in module soundex)}
 The soundex algorithm takes an English word, and returns an
 easily-computed hash of it; this hash is intended to be the same for
 words that sound alike.  This module provides an interface to the
index 385672350fb870d2b589d2de6bd4963b1eaa914a..3030fc6e693331d4aa0b6e3328ce79841c4b404b 100644 (file)
@@ -11,7 +11,7 @@ calls, consult your local man pages.
 
 The \code{stat} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module stat)}
+\setindexsubitem{(in module stat)}
 
 \begin{funcdesc}{S_ISDIR}{mode}
 Return non-zero if the mode was gotten from a directory.
@@ -86,7 +86,7 @@ Time of creation.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import os, sys
 from stat import *
 
@@ -108,4 +108,4 @@ def f(file):
     print 'frobbed', file
 
 if __name__ == '__main__': process(sys.argv[1], f)
-\end{verbatim}\ecode
+\end{verbatim}
index 39d6d6dd229cbf9f39a4d458b5eabea8fe68f077..6a0b58d2d0302ab83b9155ce8fe102bee3598913 100644 (file)
@@ -36,7 +36,7 @@ of STDWIN for C programmers (aforementioned CWI report).
 
 The following functions are defined in the \code{stdwin} module:
 
-\renewcommand{\indexsubitem}{(in module stdwin)}
+\setindexsubitem{(in module stdwin)}
 \begin{funcdesc}{open}{title}
 Open a new window whose initial title is given by the string argument.
 Return a window object; window object methods are described below.%
@@ -118,14 +118,14 @@ Return the pixel value corresponding to the given color name.
 Return the default foreground color for unknown color names.
 Hint: the following code tests whether you are on a machine that
 supports more than two colors:
-\bcode\begin{verbatim}
+\begin{verbatim}
 if stdwin.fetchcolor('black') <> \
           stdwin.fetchcolor('red') <> \
           stdwin.fetchcolor('white'):
     print 'color machine'
 else:
     print 'monochrome machine'
-\end{verbatim}\ecode
+\end{verbatim}
 \end{funcdesc}
 
 \begin{funcdesc}{setfgcolor}{pixel}
@@ -316,7 +316,7 @@ Window objects are created by \code{stdwin.open()}.  They are closed
 by their \code{close()} method or when they are garbage-collected.
 Window objects have the following methods:
 
-\renewcommand{\indexsubitem}{(window method)}
+\setindexsubitem{(window method)}
 
 \begin{funcdesc}{begindrawing}{}
 Return a drawing object, whose methods (described below) allow drawing
@@ -467,7 +467,7 @@ No drawing object may exist when
 is called.
 Drawing objects have the following methods:
 
-\renewcommand{\indexsubitem}{(drawing method)}
+\setindexsubitem{(drawing method)}
 
 \begin{funcdesc}{box}{rect}
 Draw a box just inside a rectangle.
@@ -605,7 +605,7 @@ A menu object represents a menu.
 The menu is destroyed when the menu object is deleted.
 The following methods are defined:
 
-\renewcommand{\indexsubitem}{(menu method)}
+\setindexsubitem{(menu method)}
 
 \begin{funcdesc}{additem}{text\, shortcut}
 Add a menu item with given text.
@@ -643,7 +643,7 @@ Bitmaps are currently not available on the Macintosh.
 
 The following methods are defined:
 
-\renewcommand{\indexsubitem}{(bitmap method)}
+\setindexsubitem{(bitmap method)}
 
 \begin{funcdesc}{getsize}{}
 Return a tuple representing the width and height of the bitmap.
@@ -669,7 +669,7 @@ A text-edit object represents a text-edit block.
 For semantics, see the STDWIN documentation for C programmers.
 The following methods exist:
 
-\renewcommand{\indexsubitem}{(text-edit method)}
+\setindexsubitem{(text-edit method)}
 
 \begin{funcdesc}{arrow}{code}
 Pass an arrow event to the text-edit block.
@@ -756,7 +756,7 @@ left corner of the window.
 The window will be correctly redrawn when covered and re-exposed.
 The program quits when the close icon or menu item is requested.
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import stdwin
 from stdwinevents import *
 
@@ -773,7 +773,7 @@ def main():
             break
 
 main()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{stdwinevents}}
 \stmodindex{stdwinevents}
@@ -784,10 +784,10 @@ and selection types (\code{WS_PRIMARY} etc.).
 Read the file for details.
 Suggested usage is
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> from stdwinevents import *
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{rect}}
 \stmodindex{rect}
@@ -798,9 +798,9 @@ A rectangle is defined as in module
 a pair of points, where a point is a pair of integers.
 For example, the rectangle
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 (10, 20), (90, 80)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 is a rectangle whose left, top, right and bottom edges are 10, 20, 90
 and 80, respectively.
@@ -809,7 +809,7 @@ Note that the positive vertical axis points down (as in
 
 The module defines the following objects:
 
-\renewcommand{\indexsubitem}{(in module rect)}
+\setindexsubitem{(in module rect)}
 \begin{excdesc}{error}
 The exception raised by functions in this module when they detect an
 error.
@@ -821,7 +821,7 @@ detail.
 The rectangle returned when some operations return an empty result.
 This makes it possible to quickly check whether a result is empty:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import rect
 >>> r1 = (10, 20), (90, 80)
 >>> r2 = (0, 0), (10, 20)
@@ -829,7 +829,7 @@ This makes it possible to quickly check whether a result is empty:
 >>> if r3 is rect.empty: print 'Empty intersection'
 Empty intersection
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 \end{datadesc}
 
 \begin{funcdesc}{is_empty}{r}
index 19118012afb8a7e9b30caefdc967635d88ce4b7c..7242c5332359082faa49b6864756d6a9c81b20d8 100644 (file)
@@ -10,7 +10,7 @@ classes and some useful string functions.  See the module
 
 The constants defined in this module are are:
 
-\renewcommand{\indexsubitem}{(data in module string)}
+\setindexsubitem{(data in module string)}
 \begin{datadesc}{digits}
   The string \code{'0123456789'}.
 \end{datadesc}
@@ -54,7 +54,7 @@ The constants defined in this module are are:
 
 The functions defined in this module are:
 
-\renewcommand{\indexsubitem}{(in module string)}
+\setindexsubitem{(in module string)}
 
 \begin{funcdesc}{atof}{s}
 Convert a string to a floating point number.  The string must have
index 19f674c99b73986c4f3c9552fde6b367b849549b..2ed4f2c53668fb2cb06e0c063d0b7cb768b23f0d 100644 (file)
@@ -13,7 +13,7 @@ See also built-in module \code{array}.
 
 The module defines the following exception and functions:
 
-\renewcommand{\indexsubitem}{(in module struct)}
+\setindexsubitem{(in module struct)}
 \begin{excdesc}{error}
   Exception raised on various occasions; argument is a string
   describing what is wrong.
@@ -120,7 +120,7 @@ byte-swapping); use the appropriate choice of \code{'<'} or
 Examples (all using native byte order, size and alignment, on a
 big-endian machine):
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> from struct import *
 >>> pack('hhl', 1, 2, 3)
 '\000\001\000\002\000\000\000\003'
@@ -129,7 +129,7 @@ big-endian machine):
 >>> calcsize('hhl')
 8
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 %
 Hint: to align the end of a structure to the alignment requirement of
 a particular type, end the format with the code for that type with a
index a579872a7bdcec960dcf5fb956b558343189e813..f6d99944eeb24bdc235b15d789a2b8b8152df110 100644 (file)
@@ -14,7 +14,7 @@ description can be gotten with \samp{man audio}.
 
 The module defines the following variables and functions:
 
-\renewcommand{\indexsubitem}{(in module sunaudiodev)}
+\setindexsubitem{(in module sunaudiodev)}
 \begin{excdesc}{error}
 This exception is raised on all errors. The argument is a string
 describing what went wrong.
@@ -36,7 +36,7 @@ The audio device objects are returned by \code{open} define the
 following methods (except \code{control} objects which only provide
 getinfo, setinfo and drain):
 
-\renewcommand{\indexsubitem}{(audio device method)}
+\setindexsubitem{(audio device method)}
 
 \begin{funcdesc}{close}{}
 This method explicitly closes the device. It is useful in situations
index e63e616f946e71bae821f0a3c9554a5edc420005..f7bc8e25f3d8e4a4a93fd2d05cf0b9ef2374fc0a 100644 (file)
@@ -6,7 +6,7 @@ This module provides access to some variables used or maintained by the
 interpreter and to functions that interact strongly with the interpreter.
 It is always available.
 
-\renewcommand{\indexsubitem}{(in module sys)}
+\setindexsubitem{(in module sys)}
 
 \begin{datadesc}{argv}
   The list of command line arguments passed to a Python script.
@@ -81,10 +81,10 @@ installed; by default, this is also \code{"/usr/local"}.  This can be
 set at build time with the \code{--exec-prefix} argument to the
 \code{configure} script.  Specifically, all configuration files
 (e.g. the \code{config.h} header file) are installed in the directory
-\code{sys.exec_prefix+"/lib/python\emph{VER}/config"}, and shared library
+\code{sys.exec_prefix+"/lib/python\var{version}/config"}, and shared library
 modules are installed in
-\code{sys.exec_prefix+"/lib/python\emph{VER}/lib-dynload"},
-where \emph{VER} is equal to \code{sys.version[:3]}.
+\code{sys.exec_prefix+"/lib/python\var{version}/lib-dynload"},
+where \var{version} is equal to \code{sys.version[:3]}.
 \end{datadesc}
 
 \begin{funcdesc}{exit}{n}
@@ -162,10 +162,10 @@ independent Python files are installed; by default, this is the string
 \code{"/usr/local"}.  This can be set at build time with the
 \code{--prefix} argument to the \code{configure} script.  The main
 collection of Python library modules is installed in the directory
-\code{sys.prefix+"/lib/python\emph{VER}"} while the platform
+\code{sys.prefix+"/lib/python\var{version}"} while the platform
 independent header files (all except \code{config.h}) are stored in
-\code{sys.prefix+"/include/python\emph{VER}"},
-where \emph{VER} is equal to \code{sys.version[:3]}.
+\code{sys.prefix+"/include/python\var{version}"},
+where \var{version} is equal to \code{sys.version[:3]}.
 
 \end{datadesc}
 
index 8f4a5997d8c870a6d08e3dca4cd013df788a3258..8348e9c311902efc15ac0678f8ed5714d8347cae 100644 (file)
@@ -8,7 +8,7 @@ of the \code{syslog} facility.
 
 The module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module syslog)}
+\setindexsubitem{(in module syslog)}
 
 \begin{funcdesc}{syslog}{\optional{priority\,} message}
 Send the string \var{message} to the system logger.
index f7304aec8167b15f67d73ab14986f56dcb777c75..d1cd205f69d152106835f86412446764621340bd 100644 (file)
@@ -4,7 +4,7 @@
 \indexii{temporary}{file name}
 \indexii{temporary}{file}
 
-\renewcommand{\indexsubitem}{(in module tempfile)}
+\setindexsubitem{(in module tempfile)}
 
 This module generates temporary file names.  It is not \UNIX{} specific,
 but it may require some help on non-\UNIX{} systems.
index 29aeb639fdc55ae0ee9b868b299745c7cbb14f6c..43756494559555d8871f4e57d85612c0a7dcf5ca 100644 (file)
@@ -45,7 +45,7 @@ The \code{spam} module defines the following functions:
 % Redefine the ``indexsubitem'' macro to point to this module
 % (alternatively, you can put this at the top of the file):
 
-\renewcommand{\indexsubitem}{(in module spam)}
+\setindexsubitem{(in module spam)}
 
 % ---- 3.2. ----
 % For each function, use a ``funcdesc'' block.  This has exactly two
@@ -101,12 +101,12 @@ failure.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import spam
 >>> can = spam.open('/etc/passwd')
 >>> can.empty()
 >>> can.close()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 % ==== 5. ====
 % If your module defines new object types (for a built-in module) or
@@ -120,7 +120,7 @@ Example:
 Spam objects (returned by \code{open()} above) have the following
 methods.
 
-\renewcommand{\indexsubitem}{(spam method)}
+\setindexsubitem{(spam method)}
 
 \begin{funcdesc}{empty}{}
 Empty the can into the trash.
index afdd141396230dfdf680e801f010980fd8dcb7e4..e39b905927fb8e3dc2a4b9d753a617c2bd4230bd 100644 (file)
@@ -4,7 +4,7 @@
 \indexii{\POSIX{}}{I/O control}
 \indexii{tty}{I/O control}
 
-\renewcommand{\indexsubitem}{(in module termios)}
+\setindexsubitem{(in module termios)}
 
 This module provides an interface to the \POSIX{} calls for tty I/O
 control.  For a complete description of these calls, see the \POSIX{} or
@@ -77,7 +77,7 @@ Note the technique using a separate \code{termios.tcgetattr()} call
 and a \code{try \ldots{} finally} statement to ensure that the old tty
 attributes are restored exactly no matter what happens:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 def getpass(prompt = "Password: "):
     import termios, TERMIOS, sys
     fd = sys.stdin.fileno()
@@ -90,14 +90,14 @@ def getpass(prompt = "Password: "):
     finally:
         termios.tcsetattr(fd, TERMIOS.TCSADRAIN, old)
     return passwd
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \section{Standard Module \sectcode{TERMIOS}}
 \stmodindex{TERMIOS}
 \indexii{\POSIX{}}{I/O control}
 \indexii{tty}{I/O control}
 
-\renewcommand{\indexsubitem}{(in module TERMIOS)}
+\setindexsubitem{(in module TERMIOS)}
 
 This module defines the symbolic constants required to use the
 \code{termios} module (see the previous section).  See the \POSIX{} or
index ae11823eff437dcbf4b509c358397e222e04edff..24ebac52bdd3e40a7648493fdcb5430bffb3ca0e 100644 (file)
@@ -20,7 +20,7 @@ IRIX, Solaris 2.x, as well as on systems that have a \POSIX{} thread
 
 It defines the following constant and functions:
 
-\renewcommand{\indexsubitem}{(in module thread)}
+\setindexsubitem{(in module thread)}
 \begin{excdesc}{error}
 Raised on thread-specific errors.
 \end{excdesc}
@@ -64,7 +64,7 @@ another thread is created.
 
 Lock objects have the following methods:
 
-\renewcommand{\indexsubitem}{(lock method)}
+\setindexsubitem{(lock method)}
 \begin{funcdesc}{acquire}{\optional{waitflag}}
 Without the optional argument, this method acquires the lock
 unconditionally, if necessary waiting until it is released by another
index 74e81046e18395fb7ce050c234ed3f896859248c..e05cad25cd9b2d5cf9061b84829819a4c4cd4db1 100644 (file)
@@ -58,7 +58,7 @@ state to be filled in.
 
 The module defines the following functions and data items:
 
-\renewcommand{\indexsubitem}{(in module time)}
+\setindexsubitem{(in module time)}
 
 \begin{datadesc}{altzone}
 The offset of the local DST timezone, in seconds west of the 0th
index 4fcc4d145d50945f19ae7b3f3b9908924e367bda..2bdd22b40bd7b9f49be1666fe567d4ec08b922cc 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-traceback}
 \stmodindex{traceback}
 
-\renewcommand{\indexsubitem}{(in module traceback)}
+\setindexsubitem{(in module traceback)}
 
 This module provides a standard interface to format and print stack
 traces of Python programs.  It exactly mimics the behavior of the
index 33d1b15efb1fd8fb039df8b95880a136cae70f43..fc1b34e3b702acadb464ec09d9931aa8186f5960 100644 (file)
@@ -25,7 +25,7 @@ The following values are considered false:
 \index{false}
 
 \begin{itemize}
-\renewcommand{\indexsubitem}{(Built-in object)}
+\setindexsubitem{(Built-in object)}
 
 \item  \code{None}
        \ttindex{None}
@@ -409,13 +409,13 @@ If the right argument is a dictionary (or any kind of mapping), then
 the formats in the string must have a parenthesized key into that
 dictionary inserted immediately after the \code{\%} character, and
 each format formats the corresponding entry from the mapping.  E.g.
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> count = 2
 >>> language = 'Python'
 >>> print '%(language)s has %(count)03d quote types.' % vars()
 Python has 002 quote types.
 >>> 
-\end{verbatim}\ecode
+\end{verbatim}
 In this case no * specifiers may occur in a format (since they
 require a sequential parameter list).
 
@@ -466,7 +466,7 @@ The following operations are defined on mutable sequence types (where
 \indexii{subscript}{assignment}
 \indexii{slice}{assignment}
 \stindex{del}
-\renewcommand{\indexsubitem}{(list method)}
+\setindexsubitem{(list method)}
 \ttindex{append}
 \ttindex{count}
 \ttindex{index}
@@ -538,7 +538,7 @@ mapping, \var{k} is a key and \var{x} is an arbitrary object):
 \indexiii{operations on}{dictionary}{type}
 \stindex{del}
 \bifuncindex{len}
-\renewcommand{\indexsubitem}{(dictionary method)}
+\setindexsubitem{(dictionary method)}
 \ttindex{keys}
 \ttindex{has_key}
 
@@ -681,7 +681,7 @@ device or writing a file opened for reading.
 Files have the following methods:
 
 
-\renewcommand{\indexsubitem}{(file method)}
+\setindexsubitem{(file method)}
 
 \begin{funcdesc}{close}{}
   Close the file.  A closed file cannot be read or written anymore.
index afb02e5cfb3ae9ccf858e0a948936260950a4310..8bf58637defe9bef53207d0cb00fd3fede9b19cd 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-types}
 \stmodindex{types}
 
-\renewcommand{\indexsubitem}{(in module types)}
+\setindexsubitem{(in module types)}
 
 This module defines names for all object types that are used by the
 standard Python interpreter (but not for the types defined by various
@@ -14,14 +14,14 @@ all end in \code{Type}.
 Typical use is for functions that do different things depending on
 their argument types, like the following:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 from types import *
 def delete(list, item):
     if type(item) is IntType:
        del list[item]
     else:
        list.remove(item)
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The module defines the following names:
 
index 5f8297de13ad10f35e64d578f902d3c2b409308f..8e7decfeb01314b39591586360939ec992587cd3 100644 (file)
@@ -5,7 +5,7 @@
 \index{World-Wide Web}
 \index{URL}
 
-\renewcommand{\indexsubitem}{(in module urllib)}
+\setindexsubitem{(in module urllib)}
 
 This module provides a high-level interface for fetching data across
 the World-Wide Web.  In particular, the \code{urlopen()} function is
index 651db6d37eae5f34dccd7b8e1c04b9cf667eab72..32d88eeaef3c6b5c8c2750fcfc592f5fd070b16a 100644 (file)
@@ -7,7 +7,7 @@
 \indexii{URL}{parsing}
 \indexii{relative}{URL}
 
-\renewcommand{\indexsubitem}{(in module urlparse)}
+\setindexsubitem{(in module urlparse)}
 
 This module defines a standard interface to break URL strings up in
 components (addessing scheme, network location, path etc.), to combine
@@ -35,15 +35,15 @@ retained if present.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 urlparse('http://www.cwi.nl:80/%7Eguido/Python.html')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 yields the tuple
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 ('http', 'www.cwi.nl:80', '/%7Eguido/Python.html', '', '', '')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 If the \var{default_scheme} argument is specified, it gives the
 default addressing scheme, to be used only if the URL string does not
@@ -70,15 +70,15 @@ components in the relative URL.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 urljoin('http://www.cwi.nl/%7Eguido/Python.html', 'FAQ.html')
-\end{verbatim}\ecode
+\end{verbatim}
 %
 yields the string
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 'http://www.cwi.nl/%7Eguido/FAQ.html'
-\end{verbatim}\ecode
+\end{verbatim}
 %
 The \var{allow_fragments} argument has the same meaning as for
 \code{urlparse()}.
index f0f633ca8c3384b3ea5c528d94e61317cd22b269..d5d8d5b7d107fb22d86b3906587d595812dae85f 100644 (file)
@@ -40,13 +40,13 @@ define variables in their \file{.pythonrc.py} file that you test in
 your module.  For example, a module \code{spam} that has a verbosity
 level can look for a variable \code{user.spam_verbose}, as follows:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import user
 try:
     verbose = user.spam_verbose  # user's verbosity preference
 except AttributeError:
     verbose = 0                  # default verbosity
-\end{verbatim}\ecode
+\end{verbatim}
 
 Programs with extensive customization needs are better off reading a
 program-specific customization file.
index 2084b5c25ce605029626d44ff5d6102f615fd956..9b7b2fb5fc6396df93c440e2bb64d0f70c2ac858 100644 (file)
@@ -11,7 +11,7 @@ your own dictionary-like or list-like classes, which can inherit from
 them and override existing methods or add new ones.  In this way one
 can add new behaviours to dictionaries or lists.
 
-\renewcommand{\indexsubitem}{(in module UserDict)}
+\setindexsubitem{(in module UserDict)}
 The \code{UserDict} module defines the \code{UserDict} class:
 
 \begin{funcdesc}{UserDict}{}
@@ -20,7 +20,7 @@ contents are kept in a regular dictionary, which is accessible via the
 \code{data} attribute of \code{UserDict} instances.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(in module UserList)}
+\setindexsubitem{(in module UserList)}
 The \code{UserList} module defines the \code{UserList} class:
 
 \begin{funcdesc}{UserList}{\optional{list}}
index 19bca3a1592211b592c6bde3391cf8b4dc6f8230..180504924cade66cfd9c8122d2af454ea9e574df 100644 (file)
@@ -6,7 +6,7 @@ The single function in this module attempts to guess which of the
 several simple database modules available--dbm, gdbm, or
 dbhash--should be used to open a given file.
 
-\renewcommand{\indexsubitem}{(in module whichdb)}
+\setindexsubitem{(in module whichdb)}
 \begin{funcdesc}{whichdb}{filename}
 Returns one of the following values: \code{None} if the file can't be
 opened because it's unreadable or doesn't exist; the empty string
index 09d7816521bafef7d4f6b6ca2daa7ada0f444055..da3fa8cee465e78d1d91793e81887dbc76fa77e9 100644 (file)
@@ -5,7 +5,7 @@
 This module implements a Wichmann-Hill pseudo-random number generator
 class that is also named \code{whrandom}.  Instances of the
 \code{whrandom} class have the following methods:
-\renewcommand{\indexsubitem}{(in module whrandom)}
+\setindexsubitem{(in module whrandom)}
 
 \begin{funcdesc}{choice}{seq}
 Chooses a random element from the non-empty sequence \var{seq} and returns it.
@@ -37,10 +37,10 @@ When imported, the \code{whrandom} module also creates an instance of
 the \code{whrandom} class, and makes the methods of that instance
 available at the module level.  Therefore one can write either 
 \code{N = whrandom.random()} or:
-\bcode\begin{verbatim}
+\begin{verbatim}
 generator = whrandom.whrandom()
 N = generator.random()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 \begin{seealso}
 \seemodule{random}{generators for various random distributions}
index 3cfa92c1c970cffb9ec67b392eafc50cb736ca50..681fc5e1df7716b9a3cea8b5c938745da7331a16 100644 (file)
@@ -4,7 +4,7 @@
 \index{XDR}
 \index{External Data Representation}
 
-\renewcommand{\indexsubitem}{(in module xdrlib)}
+\setindexsubitem{(in module xdrlib)}
 
 
 The \code{xdrlib} module supports the External Data Representation
@@ -215,11 +215,11 @@ variables.
 
 Here is an example of how you would catch one of these exceptions:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 import xdrlib
 p = xdrlib.Packer()
 try:
     p.pack_double(8.01)
 except xdrlib.ConversionError, instance:
     print 'packing the double failed:', instance.msg
-\end{verbatim}\ecode
+\end{verbatim}
index e8ba2e898452cf24336e2fca834882bff5a740eb..d777f088e3cac2cfff118c7a7d07eaaf2b10ed42 100644 (file)
@@ -10,7 +10,7 @@ for parsing text files formatted in XML (eXtended Markup Language).
 The \code{XMLParser} class must be instantiated without arguments.  It 
 has the following interface methods:
 
-\renewcommand{\indexsubitem}{(XMLParser method)}
+\setindexsubitem{(XMLParser method)}
 
 \begin{funcdesc}{reset}{}
 Reset the instance.  Loses all unprocessed data.  This is called
index cca35014cf35a0ffc61da52541f606a82615da7b..9234c5f47a8566953a489c8fbb06cb8efc6253f2 100644 (file)
@@ -13,7 +13,7 @@ later version if one is available.
 
 The available functions in this module are:
 
-\renewcommand{\indexsubitem}{(in module zlib)}
+\setindexsubitem{(in module zlib)}
 \begin{funcdesc}{adler32}{string\optional{\, value}}
    Computes a Adler-32 checksum of \var{string}.  (An Adler-32
    checksum is almost as reliable as a CRC32 but can be computed much
index c9756d10f5c48757b68f111aa5eac5cd2ff6d1ed..36d1289c5031c814366ce900a78d332db5653062 100644 (file)
@@ -1,7 +1,7 @@
 \section{Built-in Module \sectcode{ctb}}
 \label{module-ctb}
 \bimodindex{ctb}
-\renewcommand{\indexsubitem}{(in module ctb)}
+\setindexsubitem{(in module ctb)}
 
 This module provides a partial interface to the Macintosh
 Communications Toolbox. Currently, only Connection Manager tools are
@@ -45,7 +45,7 @@ Alternatively, passing \code{None} will result in default buffer sizes.
 For all connection methods that take a \var{timeout} argument, a value
 of \code{-1} is indefinite, meaning that the command runs to completion.
 
-\renewcommand{\indexsubitem}{(connection object attribute)}
+\setindexsubitem{(connection object attribute)}
 
 \begin{datadesc}{callback}
 If this member is set to a value other than \code{None} it should point
@@ -60,7 +60,7 @@ calls for the time being.
 \end{datadesc}
 
 
-\renewcommand{\indexsubitem}{(connection object method)}
+\setindexsubitem{(connection object method)}
 
 \begin{funcdesc}{Open}{timeout}
 Open an outgoing connection, waiting at most \var{timeout} seconds for
index 4f67ab140091f0bf178f9b319a11fde14f27157d..20b34bc7e65e7a0f45f5402fea64bc80d9e7070f 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-macconsole}
 \bimodindex{macconsole}
 
-\renewcommand{\indexsubitem}{(in module macconsole)}
+\setindexsubitem{(in module macconsole)}
 
 This module is available on the Macintosh, provided Python has been
 built using the Think C compiler. It provides an interface to the
@@ -36,7 +36,7 @@ object. \var{fp} should be one of \code{sys.stdin}, \code{sys.stdout} or
 \subsection{macconsole options object}
 These options are examined when a window is created:
 
-\renewcommand{\indexsubitem}{(macconsole option)}
+\setindexsubitem{(macconsole option)}
 \begin{datadesc}{top}
 \dataline{left}
 The origin of the window.
@@ -63,7 +63,7 @@ If set non-zero, the window will wait for user action before closing.
 
 \subsection{console window object}
 
-\renewcommand{\indexsubitem}{(console window attribute)}
+\setindexsubitem{(console window attribute)}
 
 \begin{datadesc}{file}
 The file object corresponding to this console window. If the file is
@@ -71,7 +71,7 @@ buffered, you should call \code{file.flush()} between \code{write()}
 and \code{read()} calls.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(console window method)}
+\setindexsubitem{(console window method)}
 
 \begin{funcdesc}{setmode}{mode}
 Set the input mode of the console to \var{C_ECHO}, etc.
index 5ae59a6c2354140034afb7f7a1113b24961b0187..fabe3e160236378744614ed8ca304452b4cdf52b 100644 (file)
@@ -9,7 +9,7 @@ all Mac Python versions.
 
 The \code{macdnr} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module macdnr)}
+\setindexsubitem{(in module macdnr)}
 
 \begin{funcdesc}{Open}{\optional{filename}}
 Open the domain name resolver extension.  If \var{filename} is given it
@@ -64,7 +64,7 @@ this will result in an implicit wait for the query to complete.
 The \var{rtnCode} and \var{cname} attributes are always available, the
 others depend on the type of query (address, hinfo or mx).
 
-\renewcommand{\indexsubitem}{(dnr result object method)}
+\setindexsubitem{(dnr result object method)}
 
 % Add args, as in {arg1\, arg2 \optional{\, arg3}}
 \begin{funcdesc}{wait}{}
@@ -76,7 +76,7 @@ Wait for the query to complete.
 Return 1 if the query is complete.
 \end{funcdesc}
 
-\renewcommand{\indexsubitem}{(dnr result object attribute)}
+\setindexsubitem{(dnr result object attribute)}
 
 \begin{datadesc}{rtnCode}
 The error code returned by the query.
@@ -111,9 +111,9 @@ will only return a single mx record.  Mx queries only.
 
 The simplest way to use the module to convert names to dotted-decimal
 strings, without worrying about idle time, etc:
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> def gethostname(name):
 ...     import macdnr
 ...     dnrr = macdnr.StrToAddr(name)
 ...     return macdnr.AddrToStr(dnrr.ip0)
-\end{verbatim}\ecode
+\end{verbatim}
index 4b2f8fea2a467d2e873e868ba7cdb2494be4b8e8..647e004df39e5785cfe9c888f025a5212397118e 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-macfs}
 \bimodindex{macfs}
 
-\renewcommand{\indexsubitem}{(in module macfs)}
+\setindexsubitem{(in module macfs)}
 
 This module provides access to macintosh FSSpec handling, the Alias
 Manager, finder aliases and the Standard File package.
@@ -103,13 +103,13 @@ function returns an FSSpec object pointing to the application.
 
 \subsection{FSSpec objects}
 
-\renewcommand{\indexsubitem}{(FSSpec object attribute)}
+\setindexsubitem{(FSSpec object attribute)}
 \begin{datadesc}{data}
 The raw data from the FSSpec object, suitable for passing
 to other applications, for instance.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(FSSpec object method)}
+\setindexsubitem{(FSSpec object method)}
 \begin{funcdesc}{as_pathname}{}
 Return the full pathname of the file described by the FSSpec object.
 \end{funcdesc}
@@ -159,13 +159,13 @@ Python.
 
 \subsection{alias objects}
 
-\renewcommand{\indexsubitem}{(alias object attribute)}
+\setindexsubitem{(alias object attribute)}
 \begin{datadesc}{data}
 The raw data for the Alias record, suitable for storing in a resource
 or transmitting to other programs.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(alias object method)}
+\setindexsubitem{(alias object method)}
 \begin{funcdesc}{Resolve}{\optional{file}}
 Resolve the alias. If the alias was created as a relative alias you
 should pass the file relative to which it is. Return the FSSpec for
@@ -196,7 +196,7 @@ modifying the resource.
 See Inside Mac for a complete description of what the various fields
 mean.
 
-\renewcommand{\indexsubitem}{(FInfo object attribute)}
+\setindexsubitem{(FInfo object attribute)}
 \begin{datadesc}{Creator}
 The 4-char creator code of the file.
 \end{datadesc}
index d797cfa0a3c0326e9e6bf8fee8fda2abac9d3a4c..aa3ba13a06a8470a9eaffd325639d2473063f214 100644 (file)
@@ -1,7 +1,7 @@
 \section{Standard Module \sectcode{ic}}
 \bimodindex{ic}
 
-\renewcommand{\indexsubitem}{(in module ic)}
+\setindexsubitem{(in module ic)}
 
 This module provides access to macintosh Internet Config package,
 which stores preferences for Internet programs such as mail address,
@@ -63,7 +63,7 @@ for assignment.
 
 Besides the dictionary interface IC objects have the following methods:
 
-\renewcommand{\indexsubitem}{(IC object attribute)}
+\setindexsubitem{(IC object attribute)}
 
 \begin{funcdesc}{launchurl}{url \optional{, hint}}
 Parse the given URL, lauch the correct application and pass it the
index 3d1f2347141bf09fdaa051c0be3b8e9cba20df9d..e52c9cceaa35607bc0dc77aac3dc9c187448d03b 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-MacOS}
 \bimodindex{MacOS}
 
-\renewcommand{\indexsubitem}{(in module MacOS)}
+\setindexsubitem{(in module MacOS)}
 
 This module provides access to MacOS specific functionality in the
 python interpreter, such as how the interpreter eventloop functions
index adbf461e79cf3b235a6ea46648fd42a77335bed9..5c8487a56f346552c59af852872c1f11c44bdc3b 100644 (file)
@@ -7,7 +7,7 @@ on the Macintosh.
 
 The \code{macostools} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module macostools)}
+\setindexsubitem{(in module macostools)}
 
 \begin{funcdesc}{copy}{src\, dst\optional{\, createpath, copytimes}}
 Copy file \var{src} to \var{dst}. The files can be specified as
@@ -60,7 +60,7 @@ pathnames or as \code{FSSpec} objects.
 
 The \code{findertools} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module macostools)}
+\setindexsubitem{(in module macostools)}
 
 \begin{funcdesc}{launch}{file}
 Tell the finder to launch \var{file}. What launching means depends on the file:
index 92c0541827c1ff14c5b820b5a6e761c39e12bbd5..8c742684a95072edee94049915a833899abbe801 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-macspeech}
 \bimodindex{macspeech}
 
-\renewcommand{\indexsubitem}{(in module macspeech)}
+\setindexsubitem{(in module macspeech)}
 
 This module provides an interface to the Macintosh Speech Manager,
 allowing you to let the Macintosh utter phrases. You need a version of
@@ -42,7 +42,7 @@ Return a voice object for voice number \var{num}.
 Voice objects contain the description of a voice. It is currently not
 yet possible to access the parameters of a voice.
 
-\renewcommand{\indexsubitem}{(voice object method)}
+\setindexsubitem{(voice object method)}
 
 \begin{funcdesc}{GetGender}{}
 Return the gender of the voice: 0 for male, 1 for female and -1 for neuter.
@@ -59,7 +59,7 @@ speakers at the same time. Please note that channel pitch and rate are
 interrelated in some way, so that to make your Macintosh sing you will
 have to adjust both.
 
-\renewcommand{\indexsubitem}{(speech channel object method)}
+\setindexsubitem{(speech channel object method)}
 \begin{funcdesc}{SpeakText}{str}
 Start uttering the given string.
 \end{funcdesc}
index a16afc8cb5e576724a85ceea6332108c2a5e0236..f041280e6c517c8988c4ae1566aa5ef2d1943903 100644 (file)
@@ -2,7 +2,7 @@
 \label{module-mactcp}
 \bimodindex{mactcp}
 
-\renewcommand{\indexsubitem}{(in module mactcp)}
+\setindexsubitem{(in module mactcp)}
 
 This module provides an interface to the Macintosh TCP/IP driver
 MacTCP\@. There is an accompanying module \code{macdnr} which provides an
@@ -42,7 +42,7 @@ datagrams on, a value of zero will make MacTCP select a free port.
 
 \subsection{TCP Stream Objects}
 
-\renewcommand{\indexsubitem}{(TCP stream attribute)}
+\setindexsubitem{(TCP stream attribute)}
 
 \begin{datadesc}{asr}
 When set to a value different than \code{None} this should point to a
@@ -54,7 +54,7 @@ is a Python addition to the MacTCP semantics.
 It is safe to do further calls from the \code{asr}.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(TCP stream method)}
+\setindexsubitem{(TCP stream method)}
 
 \begin{funcdesc}{PassiveOpen}{port}
 Wait for an incoming connection on TCP port \var{port} (zero makes the
@@ -119,7 +119,7 @@ This object has no methods, only some members holding information on
 the connection. A complete description of all fields in this objects
 can be found in the Apple documentation. The most interesting ones are:
 
-\renewcommand{\indexsubitem}{(TCP status attribute)}
+\setindexsubitem{(TCP status attribute)}
 
 \begin{datadesc}{localHost}
 \dataline{localPort}
@@ -149,7 +149,7 @@ without blocking).
 Note that, unlike the name suggests, there is nothing stream-like
 about UDP.
 
-\renewcommand{\indexsubitem}{(UDP stream attribute)}
+\setindexsubitem{(UDP stream attribute)}
 
 \begin{datadesc}{asr}
 The asynchronous service routine to be called on events such as
@@ -161,7 +161,7 @@ single argument, the event code.
 A read-only member giving the port number of this UDP stream.
 \end{datadesc}
 
-\renewcommand{\indexsubitem}{(UDP stream method)}
+\setindexsubitem{(UDP stream method)}
 
 \begin{funcdesc}{Read}{timeout}
 Read a datagram, waiting at most \var{timeout} seconds (-1 is
index c0478ac44b8f5d7e9131d4eebccd9e57851f45a4..eb11e1449f6cde5ff122903fdfa96eabd695e598 100644 (file)
@@ -10,7 +10,7 @@ item numbers correspond. See the source for details.
 
 The \code{EasyDialogs} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module EasyDialogs)}
+\setindexsubitem{(in module EasyDialogs)}
 
 \begin{funcdesc}{Message}{str}
 A modal dialog with the message text \var{str}, which should be at
@@ -75,7 +75,7 @@ for more details.
 
 The \code{FrameWork} module defines the following functions:
 
-\renewcommand{\indexsubitem}{(in module FrameWork)}
+\setindexsubitem{(in module FrameWork)}
 
 \begin{funcdesc}{Application}{}
 An object representing the complete application. See below for a
@@ -148,7 +148,7 @@ Set the mouse cursor to an arrow.
 \subsection{Application objects}
 Application objects have the following methods, among others:
 
-\renewcommand{\indexsubitem}{(Application method)}
+\setindexsubitem{(Application method)}
 
 \begin{funcdesc}{makeusermenus}{}
 Override this method if you need menus in your application. Append the
@@ -225,7 +225,7 @@ null-event is passed (so you can look at mouse position, etc).
 
 Window objects have the following methods, among others:
 
-\renewcommand{\indexsubitem}{(Window method)}
+\setindexsubitem{(Window method)}
 
 \begin{funcdesc}{open}{}
 Override this method to open a window. Store the MacOS window-id in
@@ -263,7 +263,7 @@ The window was activated (\code{activate==1}) or deactivated
 ControlsWindow objects have the following methods besides those of
 \code{Window} objects:
 
-\renewcommand{\indexsubitem}{(ControlsWindow method)}
+\setindexsubitem{(ControlsWindow method)}
 
 \begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
 Part \code{pcode} of control \code{control} was hit by the
@@ -275,7 +275,7 @@ user. Tracking and such has already been taken care of.
 ScrolledWindow objects are ControlsWindow objects with the following
 extra methods:
 
-\renewcommand{\indexsubitem}{(ScrolledWindow method)}
+\setindexsubitem{(ScrolledWindow method)}
 
 \begin{funcdesc}{scrollbars}{\optional{wantx\, wanty}}
 Create (or destroy) horizontal and vertical scrollbars. The arguments
@@ -331,7 +331,7 @@ and has been handled.
 DialogWindow objects have the following methods besides those of
 \code{Window} objects:
 
-\renewcommand{\indexsubitem}{(DialogWindow method)}
+\setindexsubitem{(DialogWindow method)}
 
 \begin{funcdesc}{open}{resid}
 Create the dialog window, from the DLOG resource with id
@@ -358,7 +358,7 @@ application scriptable.
 
 The \var{MiniAEFrame} module defines the following classes:
 
-\renewcommand{\indexsubitem}{(in module MiniAEFrame)}
+\setindexsubitem{(in module MiniAEFrame)}
 
 \begin{funcdesc}{AEServer}{}
 A class that handles AppleEvent dispatch. Your application should
@@ -379,7 +379,7 @@ provide its own windows, etc.
 
 \subsection{AEServer Objects}
 
-\renewcommand{\indexsubitem}{(AEServer method)}
+\setindexsubitem{(AEServer method)}
 
 \begin{funcdesc}{installaehandler}{classe\, type\, callback}
 Installs an AppleEvent handler. \code{Classe} and \code{type} are the
index 29aeb639fdc55ae0ee9b868b299745c7cbb14f6c..43756494559555d8871f4e57d85612c0a7dcf5ca 100644 (file)
@@ -45,7 +45,7 @@ The \code{spam} module defines the following functions:
 % Redefine the ``indexsubitem'' macro to point to this module
 % (alternatively, you can put this at the top of the file):
 
-\renewcommand{\indexsubitem}{(in module spam)}
+\setindexsubitem{(in module spam)}
 
 % ---- 3.2. ----
 % For each function, use a ``funcdesc'' block.  This has exactly two
@@ -101,12 +101,12 @@ failure.
 
 Example:
 
-\bcode\begin{verbatim}
+\begin{verbatim}
 >>> import spam
 >>> can = spam.open('/etc/passwd')
 >>> can.empty()
 >>> can.close()
-\end{verbatim}\ecode
+\end{verbatim}
 %
 % ==== 5. ====
 % If your module defines new object types (for a built-in module) or
@@ -120,7 +120,7 @@ Example:
 Spam objects (returned by \code{open()} above) have the following
 methods.
 
-\renewcommand{\indexsubitem}{(spam method)}
+\setindexsubitem{(spam method)}
 
 \begin{funcdesc}{empty}{}
 Empty the can into the trash.