Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6bb1adc

Browse files
committed
small changes by Soren Larsen
1 parent a8a8d4a commit 6bb1adc

62 files changed

Lines changed: 394 additions & 406 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/lib/libaifc.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ \section{Standard Module \sectcode{aifc}}
1111
sound is sampled. The number of channels indicate if the audio is
1212
mono, stereo, or quadro. Each frame consists of one sample per
1313
channel. The sample size is the size in bytes of each sample. Thus a
14-
frame consists of nchannels*framesize bytes, and a second's worth of
15-
audio consists of nchannels*framesize*framerate bytes.
14+
frame consists of \var{nchannels}*\var{framesize} bytes, and a second's worth of
15+
audio consists of \var{nchannels}*\var{framesize}*\var{framerate} bytes.
1616

1717
Module \code{aifc} defines the following function:
1818

1919
\renewcommand{\indexsubitem}{(in module aifc)}
2020
\begin{funcdesc}{open}{file\, mode}
21-
Opens an AIFF or AIFF-C file and returns an object instance with
21+
Open an AIFF or AIFF-C file and return an object instance with
2222
methods that are described below. The argument file is either a
2323
string naming a file or a file object. The mode is either the string
2424
'r' when the file must be opened for reading, or 'w' when the file
@@ -75,7 +75,7 @@ \section{Standard Module \sectcode{aifc}}
7575
\end{funcdesc}
7676

7777
\begin{funcdesc}{readframes}{nframes}
78-
Read and return the next nframes frames from the audio file. The
78+
Read and return the next \var{nframes} frames from the audio file. The
7979
returned data is a string containing for each frame the uncompressed
8080
samples of all channels.
8181
\end{funcdesc}
@@ -175,6 +175,6 @@ \section{Standard Module \sectcode{aifc}}
175175

176176
\begin{funcdesc}{close}{}
177177
Close the AIFF file. The header of the file is updated to reflect the
178-
actual size of the audio data After calling this method, the object
178+
actual size of the audio data. After calling this method, the object
179179
can no longer be used.
180180
\end{funcdesc}

Doc/lib/libaudioop.tex

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
\section{Built-in module \sectcode{audioop}}
22
\bimodindex{audioop}
33

4-
The audioop module contains some useful operations on sound fragments.
5-
It operates on sound fragments consisting of signed integer samples of
4+
The \code{audioop} module contains some useful operations on sound fragments.
5+
It operates on sound fragments consisting of signed integer samples
66
8, 16 or 32 bits wide, stored in Python strings. This is the same
77
format as used by the \code{al} and \code{sunaudiodev} modules. All
88
scalar items are integers, unless specified otherwise.
@@ -19,7 +19,7 @@ \section{Built-in module \sectcode{audioop}}
1919
\end{excdesc}
2020

2121
\begin{funcdesc}{add}{fragment1\, fragment2\, width}
22-
This function returns a fragment that is the addition of the two samples
22+
This function returns a fragment which is the addition of the two samples
2323
passed as parameters. \var{width} is the sample width in bytes, either
2424
\code{1}, \code{2} or \code{4}. Both fragments should have the same length.
2525
\end{funcdesc}
@@ -60,16 +60,16 @@ \section{Built-in module \sectcode{audioop}}
6060
\begin{funcdesc}{findfactor}{fragment\, reference}
6161
This routine (which only accepts 2-byte sample fragments) calculates a
6262
factor \var{F} such that \code{rms(add(fragment, mul(reference, -F)))}
63-
is minimal, i.e. it calculates the factor with which you should
64-
multiply \var{reference} to make it match as good as possible to
63+
is minimal, i.e.\ it calculates the factor with which you should
64+
multiply \var{reference} to make it match as well as possible to
6565
\var{fragment}. The fragments should be the same size.
6666

6767
The time taken by this routine is proportional to \code{len(fragment)}.
6868
\end{funcdesc}
6969

7070
\begin{funcdesc}{findfit}{fragment\, reference}
7171
This routine (which only accepts 2-byte sample fragments) tries to
72-
match \var{reference} as good as possible to a portion of
72+
match \var{reference} as well as possible to a portion of
7373
\var{fragment} (which should be the longer fragment). It
7474
(conceptually) does this by taking slices out of \var{fragment}, using
7575
\code{findfactor} to compute the best match, and minimizing the
@@ -81,8 +81,8 @@ \section{Built-in module \sectcode{audioop}}
8181

8282
\begin{funcdesc}{findmax}{fragment\, length}
8383
This routine (which only accepts 2-byte sample fragments) searches
84-
\var{fragment} for a slice of length \var{length} samples (not bytes!)
85-
with maximum energy, i.e. it returns \var{i} for which
84+
\var{fragment} for a slice of length \var{length} samples (not bytes!)\
85+
with maximum energy, i.e.\ it returns \var{i} for which
8686
\code{rms(fragment[i*2:(i+length)*2])} is maximal.
8787

8888
The routine takes time proportional to \code{len(fragment)}.
@@ -140,7 +140,7 @@ \section{Built-in module \sectcode{audioop}}
140140
\end{funcdesc}
141141

142142
\begin{funcdesc}{mul}{fragment\, width\, factor}
143-
Mul returns a fragment that has all samples in the original framgent
143+
Return a fragment that has all samples in the original framgent
144144
multiplied by the floating-point value \var{factor}. Overflow is
145145
silently ignored.
146146
\end{funcdesc}
@@ -150,25 +150,6 @@ \section{Built-in module \sectcode{audioop}}
150150
modified fragment.
151151
\end{funcdesc}
152152

153-
\begin{funcdesc}{tomono}{fragment\, width\, lfactor\, rfactor}
154-
This function converts a stereo fragment to a mono fragment. The left
155-
channel is multiplied by \var{lfactor} and the right channel by
156-
\var{rfactor} before adding the two channels to give a mono signal.
157-
\end{funcdesc}
158-
159-
\begin{funcdesc}{tostereo}{fragment\, width\, lfactor\, rfactor}
160-
This function generates a stereo fragment from a mono fragment. Each
161-
pair of samples in the stereo fragment are computed from the mono
162-
sample, whereby left channel samples are multiplied by \var{lfactor}
163-
and right channel samples by \var{rfactor}.
164-
\end{funcdesc}
165-
166-
\begin{funcdesc}{mul}{fragment\, width\, factor}
167-
Mul returns a fragment that has all samples in the original framgent
168-
multiplied by the floating-point value \var{factor}. Overflow is
169-
silently ignored.
170-
\end{funcdesc}
171-
172153
\begin{funcdesc}{rms}{fragment\, width\, factor}
173154
Returns the root-mean-square of the fragment, i.e.
174155
\iftexi
@@ -184,14 +165,27 @@ \section{Built-in module \sectcode{audioop}}
184165
This is a measure of the power in an audio signal.
185166
\end{funcdesc}
186167

168+
\begin{funcdesc}{tomono}{fragment\, width\, lfactor\, rfactor}
169+
This function converts a stereo fragment to a mono fragment. The left
170+
channel is multiplied by \var{lfactor} and the right channel by
171+
\var{rfactor} before adding the two channels to give a mono signal.
172+
\end{funcdesc}
173+
174+
\begin{funcdesc}{tostereo}{fragment\, width\, lfactor\, rfactor}
175+
This function generates a stereo fragment from a mono fragment. Each
176+
pair of samples in the stereo fragment are computed from the mono
177+
sample, whereby left channel samples are multiplied by \var{lfactor}
178+
and right channel samples by \var{rfactor}.
179+
\end{funcdesc}
180+
187181
\begin{funcdesc}{ulaw2lin}{fragment\, width}
188182
This function converts sound fragments in ULAW encoding to linearly
189183
encoded sound fragments. ULAW encoding always uses 8 bits samples, so
190184
\var{width} refers only to the sample width of the output fragment here.
191185
\end{funcdesc}
192186

193187
Note that operations such as \code{mul} or \code{max} make no
194-
distinction between mono and stereo fragments, i.e. all samples are
188+
distinction between mono and stereo fragments, i.e.\ all samples are
195189
treated equal. If this is a problem the stereo fragment should be split
196190
into two mono fragments first and recombined later. Here is an example
197191
of how to do that:
@@ -207,10 +201,10 @@ \section{Built-in module \sectcode{audioop}}
207201
\end{verbatim}\ecode
208202

209203
If you use the ADPCM coder to build network packets and you want your
210-
protocol to be stateless (i.e. to be able to tolerate packet loss)
204+
protocol to be stateless (i.e.\ to be able to tolerate packet loss)
211205
you should not only transmit the data but also the state. Note that
212206
you should send the \var{initial} state (the one you passed to
213-
lin2adpcm) along to the decoder, not the final state (as returned by
207+
\code{lin2adpcm}) along to the decoder, not the final state (as returned by
214208
the coder). If you want to use \code{struct} to store the state in
215209
binary you can code the first element (the predicted value) in 16 bits
216210
and the second (the delta index) in 8.

Doc/lib/libcopy.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ \section{Built-in module \sectcode{copy}}
1010
\begin{verbatim}
1111
import copy
1212
13-
x = copy.copy(y) # make a shallow copy of y
14-
x = copy.deepcopy(y) # make a deep copy of y
13+
x = copy.copy(y) # make a shallow copy of y
14+
x = copy.deepcopy(y) # make a deep copy of y
1515
\end{verbatim}
1616

1717
For module specific errors, \code{copy.Error} is raised.
@@ -44,7 +44,7 @@ \section{Built-in module \sectcode{copy}}
4444
contain a reference to themselves) may cause a recursive loop.
4545

4646
\item
47-
Because deep copy copies {\em everything} it may copy too much, e.g.
47+
Because deep copy copies {\em everything} it may copy too much, e.g.\
4848
administrative data structures that should be shared even between
4949
copies.
5050

Doc/lib/libdbm.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ \section{Built-in Module \sectcode{dbm}}
1919
Open a dbm database and return a mapping object. \var{filename} is
2020
the name of the database file (without the \file{.dir} or \file{.pag}
2121
extensions), \var{rwmode} is \code{'r'}, \code{'w'} or \code{'rw'} as for
22-
\code{open}, and \var{filemode} is the unix mode of the file, used only
22+
\code{open}, and \var{filemode} is the \UNIX{} mode of the file, used only
2323
when the database has to be created.
2424
\end{funcdesc}

Doc/lib/libfcntl.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
% Manual text by Jaap Vermeulen
22
\section{Built-in module \sectcode{fcntl}}
33
\bimodindex{fcntl}
4-
\indexii{UNIX}{file control}
5-
\indexii{UNIX}{IO control}
4+
\indexii{\UNIX{}}{file control}
5+
\indexii{\UNIX{}}{I/O control}
66

7-
This module performs file control and IO control on file descriptors.
8-
It is an interface to the \dfn{fcntl()} and \dfn{ioctl()} \UNIX routines.
7+
This module performs file control and I/O control on file descriptors.
8+
It is an interface to the \dfn{fcntl()} and \dfn{ioctl()} \UNIX{} routines.
99
File descriptors can be obtained with the \dfn{fileno()} method of a
1010
file or socket object.
1111

@@ -23,10 +23,10 @@ \section{Built-in module \sectcode{fcntl}}
2323
the argument missing or an integer value, the return value of this
2424
function is the integer return value of the real \code{fcntl()}
2525
call. When the argument is a string it represents a binary
26-
structure, e.g. created by \code{struct.pack()}. The binary data is
26+
structure, e.g.\ created by \code{struct.pack()}. The binary data is
2727
copied to a buffer whose address is passed to the real \code{fcntl()}
2828
call. The return value after a successful call is the contents of
29-
the buffer, converted to a string object. In the case the
29+
the buffer, converted to a string object. In case the
3030
\code{fcntl()} fails, an \code{IOError} will be raised.
3131
\end{funcdesc}
3232

Doc/lib/libfuncs.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ \section{Built-in Functions}
405405
\end{verbatim}\ecode
406406
\end{funcdesc}
407407

408-
\begin{funcdesc}{vars}{}
408+
\begin{funcdesc}{vars}{\optional{object}}
409409
Without arguments, return a dictionary corresponding to the current
410410
local symbol table. With a module, class or class instance object as
411411
argument (or anything else that has a \code{__dict__} attribute),

Doc/lib/libgdbm.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ \section{Built-in Module \sectcode{gdbm}}
2121
Open a gdbm database and return a mapping object. \var{filename} is
2222
the name of the database file, \var{rwmode} is \code{'r'}, \code{'w'},
2323
\code{'c'}, or \code{'n'} for reader, writer (this also gives read
24-
access), create (writer, but create the database if it doesnt already
24+
access), create (writer, but create the database if it doesn't already
2525
exist) and newdb (which will always create a new database). Only one
2626
writer may open a gdbm file and many readers may open the file. Readers
27-
and writers can not open the gdbm file at the same time. Note that the
27+
and writers cannot open the gdbm file at the same time. Note that the
2828
\code{GDBM_FAST} mode of opening the database is not supported. \var{filemode}
29-
is the unix mode of the file, used only when a database is created.
29+
is the \UNIX\ mode of the file, used only when a database is created.
3030
\end{funcdesc}

Doc/lib/libgrp.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ \section{Built-in Module \sectcode{grp}}
2828
\end{funcdesc}
2929

3030
\begin{funcdesc}{getgrall}{}
31-
Return a list of all available group entries entries, in arbitrary order.
31+
Return a list of all available group entries, in arbitrary order.
3232
\end{funcdesc}

Doc/lib/libimageop.tex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
\section{Built-in module \sectcode{imageop}}
22
\bimodindex{imageop}
33

4-
The imageop module contains some useful operations on images.
4+
The \code{imageop} module contains some useful operations on images.
55
It operates on images consisting of 8 or 32 bit pixels
6-
stored in python strings. This is the same format as used
6+
stored in Python strings. This is the same format as used
77
by \code{gl.lrectwrite} and the \code{imgfile} module.
88

99
The module defines the following variables and functions:
@@ -17,20 +17,20 @@ \section{Built-in module \sectcode{imageop}}
1717

1818

1919
\begin{funcdesc}{crop}{image\, psize\, width\, height\, x0\, y0\, x1\, y1}
20-
This function takes the image in \code{image}, which should by
21-
\code{width} by \code{height} in size and consist of pixels of
22-
\code{psize} bytes, and returns the selected part of that image. \code{x0},
23-
\code{y0}, \code{x1} and \code{y1} are like the \code{lrectread}
20+
This function takes the image in \var{image}, which should by
21+
\var{width} by \var{height} in size and consist of pixels of
22+
\var{psize} bytes, and returns the selected part of that image. \var{x0},
23+
\var{y0}, \var{x1} and \var{y1} are like the \code{lrectread}
2424
parameters, i.e. the boundary is included in the new image.
2525
The new boundaries need not be inside the picture. Pixels that fall
2626
outside the old image will have their value set to zero.
27-
If \code{x0} is bigger than \code{x1} the new image is mirrored. The
27+
If \var{x0} is bigger than \var{x1} the new image is mirrored. The
2828
same holds for the y coordinates.
2929
\end{funcdesc}
3030

3131
\begin{funcdesc}{scale}{image\, psize\, width\, height\, newwidth\, newheight}
32-
This function returns a \code{image} scaled to size \code{newwidth} by
33-
\code{newheight}. No interpolation is done, scaling is done by
32+
This function returns an \var{image} scaled to size \var{newwidth} by
33+
\var{newheight}. No interpolation is done, scaling is done by
3434
simple-minded pixel duplication or removal. Therefore, computer-generated
3535
images or dithered images will not look nice after scaling.
3636
\end{funcdesc}
@@ -57,7 +57,7 @@ \section{Built-in module \sectcode{imageop}}
5757
\begin{funcdesc}{mono2grey}{image\, width\, height\, p0\, p1}
5858
This function converts a 1-bit monochrome image to an 8 bit greyscale
5959
or color image. All pixels that are zero-valued on input get value
60-
\code{p0} on output and all one-value input pixels get value \code{p1}
60+
\var{p0} on output and all one-value input pixels get value \var{p1}
6161
on output. To convert a monochrome black-and-white image to greyscale
6262
pass the values \code{0} and \code{255} respectively.
6363
\end{funcdesc}

Doc/lib/libimp.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ \section{Built-in module \sectcode{imp}}
3939
Initialize the built-in module called \var{name} and return its module
4040
object. If the module was already initialized, it will be initialized
4141
{\em again}. A few modules cannot be initialized twice --- attempting
42-
to initialize these again will raise an exception. If there is no
42+
to initialize these again will raise an \code{ImportError} exception.
43+
If there is no
4344
built-in module called \var{name}, \code{None} is returned.
4445
\end{funcdesc}
4546

0 commit comments

Comments
 (0)