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

Skip to content

Commit 91f2f26

Browse files
committed
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more difficult for non-native speakers.
1 parent 6ee4234 commit 91f2f26

12 files changed

Lines changed: 105 additions & 103 deletions

Doc/lib/libaifc.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ \section{\module{aifc} ---
2929
For example, CD quality audio has a sample size of two bytes (16
3030
bits), uses two channels (stereo) and has a frame rate of 44,100
3131
frames/second. This gives a frame size of 4 bytes (2*2), and a
32-
second's worth occupies 2*2*44100 bytes, i.e.\ 176,400 bytes.
32+
second's worth occupies 2*2*44100 bytes (176,400 bytes).
3333

3434
Module \module{aifc} defines the following function:
3535

Doc/lib/libarray.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ \section{\module{array} ---
108108

109109
\begin{methoddesc}[array]{fromstring}{s}
110110
Appends items from the string, interpreting the string as an
111-
array of machine values (i.e. as if it had been read from a
111+
array of machine values (as if it had been read from a
112112
file using the \method{fromfile()} method).
113113
\end{methoddesc}
114114

Doc/lib/libbisect.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ \section{\module{bisect} ---
1515
improvement over the more common approach. The module is called
1616
\module{bisect} because it uses a basic bisection algorithm to do its
1717
work. The source code may be most useful as a working example of the
18-
algorithm (i.e., the boundary conditions are already right!).
18+
algorithm (the boundary conditions are already right!).
1919

2020
The following functions are provided:
2121

Doc/lib/libcgi.tex

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ \subsection{Using the cgi module}
112112
instance but a list of such instances. Similarly, in this situation,
113113
\samp{form.getvalue(\var{key})} would return a list of strings.
114114
If you expect this possibility
115-
(i.e., when your HTML form contains multiple fields with the same
115+
(when your HTML form contains multiple fields with the same
116116
name), use the \function{type()} function to determine whether you
117117
have a single instance or a list of instances. For example, here's
118118
code that concatenates any number of username fields, separated by
@@ -283,21 +283,21 @@ \subsection{Functions}
283283
HTML-safe sequences. Use this if you need to display text that might
284284
contain such characters in HTML. If the optional flag \var{quote} is
285285
true, the double quote character (\character{"}) is also translated;
286-
this helps for inclusion in an HTML attribute value, e.g. in \code{<A
286+
this helps for inclusion in an HTML attribute value, as in \code{<A
287287
HREF="...">}.
288288
\end{funcdesc}
289289
290290
291291
\subsection{Caring about security}
292292
293-
There's one important rule: if you invoke an external program (e.g.
294-
via the \function{os.system()} or \function{os.popen()} functions),
295-
make very sure you don't pass arbitrary strings received from the
296-
client to the shell. This is a well-known security hole whereby
297-
clever hackers anywhere on the web can exploit a gullible CGI script
298-
to invoke arbitrary shell commands. Even parts of the URL or field
299-
names cannot be trusted, since the request doesn't have to come from
300-
your form!
293+
There's one important rule: if you invoke an external program (via the
294+
\function{os.system()} or \function{os.popen()} functions. or others
295+
with similar functionality), make very sure you don't pass arbitrary
296+
strings received from the client to the shell. This is a well-known
297+
security hole whereby clever hackers anywhere on the web can exploit a
298+
gullible CGI script to invoke arbitrary shell commands. Even parts of
299+
the URL or field names cannot be trusted, since the request doesn't
300+
have to come from your form!
301301
302302
To be on the safe side, if you must pass a string gotten from a form
303303
to a shell command, you should make sure the string contains only
@@ -337,7 +337,7 @@ \subsection{Installing your CGI script on a Unix system}
337337
338338
If you need to load modules from a directory which is not on Python's
339339
default module search path, you can change the path in your script,
340-
before importing other modules, e.g.:
340+
before importing other modules. For example:
341341
342342
\begin{verbatim}
343343
import sys
@@ -383,7 +383,7 @@ \subsection{Debugging CGI scripts}
383383
384384
If this gives an error of type 404, the server cannot find the script
385385
-- perhaps you need to install it in a different directory. If it
386-
gives another error (e.g. 500), there's an installation problem that
386+
gives another error, there's an installation problem that
387387
you should fix before trying to go any further. If you get a nicely
388388
formatted listing of the environment and form content (in this
389389
example, the fields should be listed as ``addr'' with value ``At Home''
@@ -402,12 +402,12 @@ \subsection{Debugging CGI scripts}
402402
This should produce the same results as those gotten from installing
403403
the \file{cgi.py} file itself.
404404
405-
When an ordinary Python script raises an unhandled exception
406-
(e.g. because of a typo in a module name, a file that can't be opened,
407-
etc.), the Python interpreter prints a nice traceback and exits.
408-
While the Python interpreter will still do this when your CGI script
409-
raises an exception, most likely the traceback will end up in one of
410-
the HTTP server's log file, or be discarded altogether.
405+
When an ordinary Python script raises an unhandled exception (for
406+
whatever reason: of a typo in a module name, a file that can't be
407+
opened, etc.), the Python interpreter prints a nice traceback and
408+
exits. While the Python interpreter will still do this when your CGI
409+
script raises an exception, most likely the traceback will end up in
410+
one of the HTTP server's log file, or be discarded altogether.
411411
412412
Fortunately, once you have managed to get your script to execute
413413
\emph{some} code, it is easy to catch exceptions and cause a traceback

Doc/lib/libcurses.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ \subsection{Functions \label{curses-functions}}
331331
size, and is not necessarily associated with a particular part of the
332332
screen. Pads can be used when a large window is needed, and only a
333333
part of the window will be on the screen at one time. Automatic
334-
refreshes of pads (e.g., from scrolling or echoing of input) do not
334+
refreshes of pads (such as from scrolling or echoing of input) do not
335335
occur. The \method{refresh()} and \method{noutrefresh()} methods of a
336336
pad require 6 arguments to specify the part of the pad to be
337337
displayed and the location on the screen to be used for the display.
@@ -542,7 +542,7 @@ \subsection{Window Objects \label{curses-window-objects}}
542542
following methods:
543543

544544
\begin{methoddesc}{addch}{\optional{y, x,} ch\optional{, attr}}
545-
\strong{Note:} A \emph{character} means a C character (i.e., an
545+
\strong{Note:} A \emph{character} means a C character (an
546546
\ASCII{} code), rather then a Python character (a string of length 1).
547547
(This note is true whenever the documentation mentions a character.)
548548
The builtin \function{ord()} is handy for conveying strings to codes.

Doc/lib/libftplib.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ \subsection{FTP Objects \label{ftp-objects}}
148148
\begin{methoddesc}{retrbinary}{command,
149149
callback\optional{, maxblocksize\optional{, rest}}}
150150
Retrieve a file in binary transfer mode. \var{command} should be an
151-
appropriate \samp{RETR} command, i.e.\ \code{'RETR \var{filename}'}.
151+
appropriate \samp{RETR} command: \code{'RETR \var{filename}'}.
152152
The \var{callback} function is called for each block of data received,
153153
with a single string argument giving the data block.
154154
The optional \var{maxblocksize} argument specifies the maximum chunk size to
@@ -175,7 +175,7 @@ \subsection{FTP Objects \label{ftp-objects}}
175175

176176
\begin{methoddesc}{storbinary}{command, file\optional{, blocksize}}
177177
Store a file in binary transfer mode. \var{command} should be an
178-
appropriate \samp{STOR} command, i.e.\ \code{"STOR \var{filename}"}.
178+
appropriate \samp{STOR} command: \code{"STOR \var{filename}"}.
179179
\var{file} is an open file object which is read until \EOF{} using its
180180
\method{read()} method in blocks of size \var{blocksize} to provide the
181181
data to be stored. The \var{blocksize} argument defaults to 8192.
@@ -281,9 +281,9 @@ \subsection{FTP Objects \label{ftp-objects}}
281281

282282
\begin{methoddesc}{close}{}
283283
Close the connection unilaterally. This should not be applied to an
284-
already closed connection (e.g.\ after a successful call to
284+
already closed connection (such as after a successful call to
285285
\method{quit()}. After this call the \class{FTP} instance should not
286-
be used any more (i.e., after a call to \method{close()} or
286+
be used any more (after a call to \method{close()} or
287287
\method{quit()} you cannot reopen the connection by issuing another
288288
\method{login()} method).
289289
\end{methoddesc}

0 commit comments

Comments
 (0)