Minor changes to match the style guide.
This commit is contained in:
parent
4124a0b343
commit
8ee679f0ce
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
\index{WWW}
|
\index{WWW}
|
||||||
\index{Internet}
|
\index{Internet}
|
||||||
\index{World-Wide Web}
|
\index{World Wide Web}
|
||||||
|
|
||||||
The modules described in this chapter implement Internet protocols and
|
The modules described in this chapter implement Internet protocols and
|
||||||
support for related technology. They are all implemented in Python.
|
support for related technology. They are all implemented in Python.
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
\noindent
|
\noindent
|
||||||
Python is an extensible, interpreted, object-oriented programming
|
Python is an extensible, interpreted, object-oriented programming
|
||||||
language. It supports a wide range of applications, from simple text
|
language. It supports a wide range of applications, from simple text
|
||||||
processing scripts to interactive WWW browsers.
|
processing scripts to interactive Web browsers.
|
||||||
|
|
||||||
While the \citetitle[../ref/ref.html]{Python Reference Manual}
|
While the \citetitle[../ref/ref.html]{Python Reference Manual}
|
||||||
describes the exact syntax and semantics of the language, it does not
|
describes the exact syntax and semantics of the language, it does not
|
||||||
|
|
|
@ -17,8 +17,8 @@ simplest and most popular way to do it, but there is another very
|
||||||
different technique, that lets you have nearly all the advantages of
|
different technique, that lets you have nearly all the advantages of
|
||||||
multi-threading, without actually using multiple threads. It's really
|
multi-threading, without actually using multiple threads. It's really
|
||||||
only practical if your program is largely I/O bound. If your program
|
only practical if your program is largely I/O bound. If your program
|
||||||
is CPU bound, then pre-emptive scheduled threads are probably what
|
is processor bound, then pre-emptive scheduled threads are probably what
|
||||||
you really need. Network servers are rarely CPU-bound, however.
|
you really need. Network servers are rarely processor bound, however.
|
||||||
|
|
||||||
If your operating system supports the \cfunction{select()} system call
|
If your operating system supports the \cfunction{select()} system call
|
||||||
in its I/O library (and nearly all do), then you can use it to juggle
|
in its I/O library (and nearly all do), then you can use it to juggle
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
\index{MIME!base64 encoding}
|
\index{MIME!base64 encoding}
|
||||||
|
|
||||||
This module performs base64 encoding and decoding of arbitrary binary
|
This module performs base64 encoding and decoding of arbitrary binary
|
||||||
strings into text strings that can be safely emailed or posted. The
|
strings into text strings that can be safely sent by email or included
|
||||||
|
as part of an HTTP POST request. The
|
||||||
encoding scheme is defined in \rfc{1521} (\emph{MIME
|
encoding scheme is defined in \rfc{1521} (\emph{MIME
|
||||||
(Multipurpose Internet Mail Extensions) Part One: Mechanisms for
|
(Multipurpose Internet Mail Extensions) Part One: Mechanisms for
|
||||||
Specifying and Describing the Format of Internet Message Bodies},
|
Specifying and Describing the Format of Internet Message Bodies},
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
\index{httpd}
|
\index{httpd}
|
||||||
|
|
||||||
This module defines two classes for implementing HTTP servers
|
This module defines two classes for implementing HTTP servers
|
||||||
(web servers). Usually, this module isn't used directly, but is used
|
(Web servers). Usually, this module isn't used directly, but is used
|
||||||
as a basis for building functioning web servers. See the
|
as a basis for building functioning Web servers. See the
|
||||||
\module{SimpleHTTPServer}\refstmodindex{SimpleHTTPServer} and
|
\module{SimpleHTTPServer}\refstmodindex{SimpleHTTPServer} and
|
||||||
\refmodule{CGIHTTPServer}\refstmodindex{CGIHTTPServer} modules.
|
\refmodule{CGIHTTPServer}\refstmodindex{CGIHTTPServer} modules.
|
||||||
|
|
||||||
The first class, \class{HTTPServer}, is a
|
The first class, \class{HTTPServer}, is a
|
||||||
\class{SocketServer.TCPServer} subclass. It creates and listens at the
|
\class{SocketServer.TCPServer} subclass. It creates and listens at the
|
||||||
web socket, dispatching the requests to a handler. Code to create and
|
HTTP socket, dispatching the requests to a handler. Code to create and
|
||||||
run the server looks like this:
|
run the server looks like this:
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
|
|
|
@ -12,7 +12,7 @@ forms in server-side scripts.}
|
||||||
\index{URL}
|
\index{URL}
|
||||||
|
|
||||||
|
|
||||||
Support module for CGI (Common Gateway Interface) scripts.%
|
Support module for Common Gateway Interface (CGI) scripts.%
|
||||||
\index{Common Gateway Interface}
|
\index{Common Gateway Interface}
|
||||||
|
|
||||||
This module defines a number of utilities for use by CGI scripts
|
This module defines a number of utilities for use by CGI scripts
|
||||||
|
@ -294,7 +294,7 @@ There's one important rule: if you invoke an external program (via the
|
||||||
\function{os.system()} or \function{os.popen()} functions. or others
|
\function{os.system()} or \function{os.popen()} functions. or others
|
||||||
with similar functionality), make very sure you don't pass arbitrary
|
with similar functionality), make very sure you don't pass arbitrary
|
||||||
strings received from the client to the shell. This is a well-known
|
strings received from the client to the shell. This is a well-known
|
||||||
security hole whereby clever hackers anywhere on the web can exploit a
|
security hole whereby clever hackers anywhere on the Web can exploit a
|
||||||
gullible CGI script to invoke arbitrary shell commands. Even parts of
|
gullible CGI script to invoke arbitrary shell commands. Even parts of
|
||||||
the URL or field names cannot be trusted, since the request doesn't
|
the URL or field names cannot be trusted, since the request doesn't
|
||||||
have to come from your form!
|
have to come from your form!
|
||||||
|
@ -330,7 +330,7 @@ as user ``nobody'', without any special privileges. It can only read
|
||||||
(write, execute) files that everybody can read (write, execute). The
|
(write, execute) files that everybody can read (write, execute). The
|
||||||
current directory at execution time is also different (it is usually
|
current directory at execution time is also different (it is usually
|
||||||
the server's cgi-bin directory) and the set of environment variables
|
the server's cgi-bin directory) and the set of environment variables
|
||||||
is also different from what you get at login. In particular, don't
|
is also different from what you get when you log in. In particular, don't
|
||||||
count on the shell's search path for executables (\envvar{PATH}) or
|
count on the shell's search path for executables (\envvar{PATH}) or
|
||||||
the Python module search path (\envvar{PYTHONPATH}) to be set to
|
the Python module search path (\envvar{PYTHONPATH}) to be set to
|
||||||
anything interesting.
|
anything interesting.
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
\section{\module{fl} ---
|
\section{\module{fl} ---
|
||||||
FORMS library interface for GUI applications}
|
FORMS library for graphical user interfaces}
|
||||||
|
|
||||||
\declaremodule{builtin}{fl}
|
\declaremodule{builtin}{fl}
|
||||||
\platform{IRIX}
|
\platform{IRIX}
|
||||||
\modulesynopsis{FORMS library interface for GUI applications.}
|
\modulesynopsis{FORMS library for applications with graphical user
|
||||||
|
interfaces.}
|
||||||
|
|
||||||
|
|
||||||
This module provides an interface to the FORMS Library\index{FORMS
|
This module provides an interface to the FORMS Library\index{FORMS
|
||||||
|
|
|
@ -200,7 +200,7 @@ need to inherit any implementation.
|
||||||
The standard formatter. This implementation has demonstrated wide
|
The standard formatter. This implementation has demonstrated wide
|
||||||
applicability to many writers, and may be used directly in most
|
applicability to many writers, and may be used directly in most
|
||||||
circumstances. It has been used to implement a full-featured
|
circumstances. It has been used to implement a full-featured
|
||||||
world-wide web browser.
|
World Wide Web browser.
|
||||||
\end{classdesc}
|
\end{classdesc}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ interfaces that are highly specific to Python, like printing a stack
|
||||||
trace; some provide interfaces that are specific to particular
|
trace; some provide interfaces that are specific to particular
|
||||||
operating systems, such as access to specific hardware; others provide
|
operating systems, such as access to specific hardware; others provide
|
||||||
interfaces that are
|
interfaces that are
|
||||||
specific to a particular application domain, like the World-Wide Web.
|
specific to a particular application domain, like the World Wide Web.
|
||||||
Some modules are available in all versions and ports of Python; others
|
Some modules are available in all versions and ports of Python; others
|
||||||
are only available when the underlying system supports or requires
|
are only available when the underlying system supports or requires
|
||||||
them; yet others are available only when a particular configuration
|
them; yet others are available only when a particular configuration
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
\section{\module{os} ---
|
\section{\module{os} ---
|
||||||
Miscellaneous OS interfaces}
|
Miscellaneous operating system interfaces}
|
||||||
|
|
||||||
\declaremodule{standard}{os}
|
\declaremodule{standard}{os}
|
||||||
\modulesynopsis{Miscellaneous OS interfaces.}
|
\modulesynopsis{Miscellaneous operating system interfaces.}
|
||||||
|
|
||||||
|
|
||||||
This module provides a more portable way of using operating system
|
This module provides a more portable way of using operating system
|
||||||
(OS) dependent functionality than importing an OS dependent built-in
|
dependent functionality than importing a operating system dependent
|
||||||
module like \refmodule{posix} or \module{nt}.
|
built-in module like \refmodule{posix} or \module{nt}.
|
||||||
|
|
||||||
This module searches for an OS dependent built-in module like
|
This module searches for an operating system dependent built-in module like
|
||||||
\module{mac} or \refmodule{posix} and exports the same functions and data
|
\module{mac} or \refmodule{posix} and exports the same functions and data
|
||||||
as found there. The design of all Python's built-in OS dependent
|
as found there. The design of all Python's built-in operating system dependent
|
||||||
modules is such that as long as the same functionality is available,
|
modules is such that as long as the same functionality is available,
|
||||||
it uses the same interface; for example, the function
|
it uses the same interface; for example, the function
|
||||||
\code{os.stat(\var{path})} returns stat information about \var{path} in
|
\code{os.stat(\var{path})} returns stat information about \var{path} in
|
||||||
the same format (which happens to have originated with the
|
the same format (which happens to have originated with the
|
||||||
\POSIX{} interface).
|
\POSIX{} interface).
|
||||||
|
|
||||||
Extensions peculiar to a particular OS are also available through the
|
Extensions peculiar to a particular operating system are also
|
||||||
\module{os} module, but using them is of course a threat to
|
available through the \module{os} module, but using them is of course a
|
||||||
portability!
|
threat to portability!
|
||||||
|
|
||||||
Note that after the first time \module{os} is imported, there is
|
Note that after the first time \module{os} is imported, there is
|
||||||
\emph{no} performance penalty in using functions from \module{os}
|
\emph{no} performance penalty in using functions from \module{os}
|
||||||
instead of directly from the OS dependent built-in module, so there
|
instead of directly from the operating system dependent built-in module,
|
||||||
should be \emph{no} reason not to use \module{os}!
|
so there should be \emph{no} reason not to use \module{os}!
|
||||||
|
|
||||||
|
|
||||||
% Frank Stajano <fstajano@uk.research.att.com> complained that it
|
% Frank Stajano <fstajano@uk.research.att.com> complained that it
|
||||||
|
@ -65,13 +65,13 @@ When exceptions are strings, the string for the exception is
|
||||||
\end{excdesc}
|
\end{excdesc}
|
||||||
|
|
||||||
\begin{datadesc}{name}
|
\begin{datadesc}{name}
|
||||||
The name of the OS dependent module imported. The following names
|
The name of the operating system dependent module imported. The
|
||||||
have currently been registered: \code{'posix'}, \code{'nt'},
|
following names have currently been registered: \code{'posix'}, \code{'nt'},
|
||||||
\code{'dos'}, \code{'mac'}, \code{'os2'}, \code{'ce'}, \code{'java'}.
|
\code{'dos'}, \code{'mac'}, \code{'os2'}, \code{'ce'}, \code{'java'}.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{path}
|
\begin{datadesc}{path}
|
||||||
The corresponding OS dependent standard module for pathname
|
The corresponding operating system dependent standard module for pathname
|
||||||
operations, such as \module{posixpath} or \module{macpath}. Thus,
|
operations, such as \module{posixpath} or \module{macpath}. Thus,
|
||||||
given the proper imports, \code{os.path.split(\var{file})} is
|
given the proper imports, \code{os.path.split(\var{file})} is
|
||||||
equivalent to but more portable than
|
equivalent to but more portable than
|
||||||
|
@ -636,7 +636,7 @@ is \code{0777} (octal).
|
||||||
Return system configuration information relevant to a named file.
|
Return system configuration information relevant to a named file.
|
||||||
\var{name} specifies the configuration value to retrieve; it may be a
|
\var{name} specifies the configuration value to retrieve; it may be a
|
||||||
string which is the name of a defined system value; these names are
|
string which is the name of a defined system value; these names are
|
||||||
specified in a number of standards (\POSIX.1, Unix95, Unix98, and
|
specified in a number of standards (\POSIX.1, \UNIX 95, \UNIX 98, and
|
||||||
others). Some platforms define additional names as well. The names
|
others). Some platforms define additional names as well. The names
|
||||||
known to the host operating system are given in the
|
known to the host operating system are given in the
|
||||||
\code{pathconf_names} dictionary. For configuration variables not
|
\code{pathconf_names} dictionary. For configuration variables not
|
||||||
|
@ -737,9 +737,9 @@ order
|
||||||
\code{st_mtime},
|
\code{st_mtime},
|
||||||
\code{st_ctime}.
|
\code{st_ctime}.
|
||||||
More items may be added at the end by some implementations. Note that
|
More items may be added at the end by some implementations. Note that
|
||||||
on the Macintosh, the time values are floating point values, like all
|
on the Mac OS, the time values are floating point values, like all
|
||||||
time values on the Macintosh.
|
time values on the Mac OS.
|
||||||
(On MS Windows, some items are filled with dummy values.)
|
(On Windows, some items are filled with dummy values.)
|
||||||
Availability: Macintosh, \UNIX{}, Windows.
|
Availability: Macintosh, \UNIX{}, Windows.
|
||||||
|
|
||||||
Note: The standard module \refmodule{stat}\refstmodindex{stat} defines
|
Note: The standard module \refmodule{stat}\refstmodindex{stat} defines
|
||||||
|
@ -983,8 +983,9 @@ Availability: Windows.
|
||||||
\begin{funcdesc}{startfile}{path}
|
\begin{funcdesc}{startfile}{path}
|
||||||
Start a file with its associated application. This acts like
|
Start a file with its associated application. This acts like
|
||||||
double-clicking the file in Windows Explorer, or giving the file name
|
double-clicking the file in Windows Explorer, or giving the file name
|
||||||
as an argument to the DOS \program{start} command: the file is opened
|
as an argument to the \program{start} command from the interactive
|
||||||
with whatever application (if any) its extension is associated.
|
command shell: the file is opened with whatever application (if any)
|
||||||
|
its extension is associated.
|
||||||
|
|
||||||
\function{startfile()} returns as soon as the associated application
|
\function{startfile()} returns as soon as the associated application
|
||||||
is launched. There is no option to wait for the application to close,
|
is launched. There is no option to wait for the application to close,
|
||||||
|
@ -1012,8 +1013,8 @@ Availability: \UNIX{}, Windows.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{times}{}
|
\begin{funcdesc}{times}{}
|
||||||
Return a 5-tuple of floating point numbers indicating accumulated (CPU
|
Return a 5-tuple of floating point numbers indicating accumulated
|
||||||
or other)
|
(processor or other)
|
||||||
times, in seconds. The items are: user time, system time, children's
|
times, in seconds. The items are: user time, system time, children's
|
||||||
user time, children's system time, and elapsed real time since a fixed
|
user time, children's system time, and elapsed real time since a fixed
|
||||||
point in the past, in that order. See the \UNIX{} manual page
|
point in the past, in that order. See the \UNIX{} manual page
|
||||||
|
@ -1100,7 +1101,7 @@ Availability: \UNIX{}.
|
||||||
Return string-valued system configuration values.
|
Return string-valued system configuration values.
|
||||||
\var{name} specifies the configuration value to retrieve; it may be a
|
\var{name} specifies the configuration value to retrieve; it may be a
|
||||||
string which is the name of a defined system value; these names are
|
string which is the name of a defined system value; these names are
|
||||||
specified in a number of standards (\POSIX, Unix95, Unix98, and
|
specified in a number of standards (\POSIX, \UNIX 95, \UNIX 98, and
|
||||||
others). Some platforms define additional names as well. The names
|
others). Some platforms define additional names as well. The names
|
||||||
known to the host operating system are given in the
|
known to the host operating system are given in the
|
||||||
\code{confstr_names} dictionary. For configuration variables not
|
\code{confstr_names} dictionary. For configuration variables not
|
||||||
|
@ -1151,17 +1152,19 @@ Higher-level operations on pathnames are defined in the
|
||||||
|
|
||||||
|
|
||||||
\begin{datadesc}{curdir}
|
\begin{datadesc}{curdir}
|
||||||
The constant string used by the OS to refer to the current directory.
|
The constant string used by the operating system to refer to the current
|
||||||
|
directory.
|
||||||
For example: \code{'.'} for \POSIX{} or \code{':'} for the Macintosh.
|
For example: \code{'.'} for \POSIX{} or \code{':'} for the Macintosh.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{pardir}
|
\begin{datadesc}{pardir}
|
||||||
The constant string used by the OS to refer to the parent directory.
|
The constant string used by the operating system to refer to the parent
|
||||||
|
directory.
|
||||||
For example: \code{'..'} for \POSIX{} or \code{'::'} for the Macintosh.
|
For example: \code{'..'} for \POSIX{} or \code{'::'} for the Macintosh.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{sep}
|
\begin{datadesc}{sep}
|
||||||
The character used by the OS to separate pathname components,
|
The character used by the operating system to separate pathname components,
|
||||||
for example, \character{/} for \POSIX{} or \character{:} for the
|
for example, \character{/} for \POSIX{} or \character{:} for the
|
||||||
Macintosh. Note that knowing this is not sufficient to be able to
|
Macintosh. Note that knowing this is not sufficient to be able to
|
||||||
parse or concatenate pathnames --- use \function{os.path.split()} and
|
parse or concatenate pathnames --- use \function{os.path.split()} and
|
||||||
|
@ -1169,15 +1172,16 @@ parse or concatenate pathnames --- use \function{os.path.split()} and
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{altsep}
|
\begin{datadesc}{altsep}
|
||||||
An alternative character used by the OS to separate pathname components,
|
An alternative character used by the operating system to separate pathname
|
||||||
or \code{None} if only one separator character exists. This is set to
|
components, or \code{None} if only one separator character exists. This is
|
||||||
\character{/} on DOS and Windows systems where \code{sep} is a backslash.
|
set to \character{/} on DOS and Windows systems where \code{sep} is a
|
||||||
|
backslash.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{pathsep}
|
\begin{datadesc}{pathsep}
|
||||||
The character conventionally used by the OS to separate search patch
|
The character conventionally used by the operating system to separate
|
||||||
components (as in \envvar{PATH}), such as \character{:} for \POSIX{} or
|
search patch components (as in \envvar{PATH}), such as \character{:} for
|
||||||
\character{;} for DOS and Windows.
|
\POSIX{} or \character{;} for DOS and Windows.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{defpath}
|
\begin{datadesc}{defpath}
|
||||||
|
@ -1188,6 +1192,6 @@ doesn't have a \code{'PATH'} key.
|
||||||
\begin{datadesc}{linesep}
|
\begin{datadesc}{linesep}
|
||||||
The string used to separate (or, rather, terminate) lines on the
|
The string used to separate (or, rather, terminate) lines on the
|
||||||
current platform. This may be a single character, such as \code{'\e
|
current platform. This may be a single character, such as \code{'\e
|
||||||
n'} for \POSIX{} or \code{'\e r'} for MacOS, or multiple characters,
|
n'} for \POSIX{} or \code{'\e r'} for the Mac OS, or multiple characters,
|
||||||
for example, \code{'\e r\e n'} for MS-DOS and MS Windows.
|
for example, \code{'\e r\e n'} for DOS and Windows.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
|
@ -60,7 +60,7 @@ For more details, read the module file.
|
||||||
|
|
||||||
This module provides access to the
|
This module provides access to the
|
||||||
\emph{Panel Library}
|
\emph{Panel Library}
|
||||||
built by NASA Ames\index{NASA} (to get it, send e-mail to
|
built by NASA Ames\index{NASA} (to get it, send email to
|
||||||
\code{panel-request@nas.nasa.gov}).
|
\code{panel-request@nas.nasa.gov}).
|
||||||
All access to it should be done through the standard module
|
All access to it should be done through the standard module
|
||||||
\code{panel}\refstmodindex{panel},
|
\code{panel}\refstmodindex{panel},
|
||||||
|
|
|
@ -77,7 +77,7 @@ value to denote the same resource.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{RLIMIT_CPU}
|
\begin{datadesc}{RLIMIT_CPU}
|
||||||
The maximum amount of CPU time (in seconds) that a process can
|
The maximum amount of processor time (in seconds) that a process can
|
||||||
use. If this limit is exceeded, a \constant{SIGXCPU} signal is sent to
|
use. If this limit is exceeded, a \constant{SIGXCPU} signal is sent to
|
||||||
the process. (See the \refmodule{signal} module documentation for
|
the process. (See the \refmodule{signal} module documentation for
|
||||||
information about how to catch this signal and do something useful,
|
information about how to catch this signal and do something useful,
|
||||||
|
|
|
@ -4,11 +4,11 @@ In general, Python programs have complete access to the underlying
|
||||||
operating system throug the various functions and classes, For
|
operating system throug the various functions and classes, For
|
||||||
example, a Python program can open any file for reading and writing by
|
example, a Python program can open any file for reading and writing by
|
||||||
using the \function{open()} built-in function (provided the underlying
|
using the \function{open()} built-in function (provided the underlying
|
||||||
OS gives you permission!). This is exactly what you want for most
|
operating system gives you permission!). This is exactly what you want
|
||||||
applications.
|
for most applications.
|
||||||
|
|
||||||
There exists a class of applications for which this ``openness'' is
|
There exists a class of applications for which this ``openness'' is
|
||||||
inappropriate. Take Grail: a web browser that accepts ``applets,''
|
inappropriate. Take Grail: a Web browser that accepts ``applets,''
|
||||||
snippets of Python code, from anywhere on the Internet for execution
|
snippets of Python code, from anywhere on the Internet for execution
|
||||||
on the local system. This can be used to improve the user interface
|
on the local system. This can be used to improve the user interface
|
||||||
of forms, for instance. Since the originator of the code is unknown,
|
of forms, for instance. Since the originator of the code is unknown,
|
||||||
|
|
|
@ -18,7 +18,7 @@ can subclass \class{RExec} to add or remove capabilities as desired.
|
||||||
\emph{Note:} The \class{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
|
unsafe operations like reading or writing disk files, or using TCP/IP
|
||||||
sockets. However, it does not protect against code using extremely
|
sockets. However, it does not protect against code using extremely
|
||||||
large amounts of memory or CPU time.
|
large amounts of memory or processor time.
|
||||||
|
|
||||||
\begin{classdesc}{RExec}{\optional{hooks\optional{, verbose}}}
|
\begin{classdesc}{RExec}{\optional{hooks\optional{, verbose}}}
|
||||||
Returns an instance of the \class{RExec} class.
|
Returns an instance of the \class{RExec} class.
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
\sectionauthor{Skip Montanaro}{skip@mojam.com}
|
\sectionauthor{Skip Montanaro}{skip@mojam.com}
|
||||||
|
|
||||||
\index{WWW}
|
\index{WWW}
|
||||||
\index{World-Wide Web}
|
\index{World Wide Web}
|
||||||
\index{URL}
|
\index{URL}
|
||||||
\index{robots.txt}
|
\index{robots.txt}
|
||||||
|
|
||||||
This module provides a single class, \class{RobotFileParser}, which answers
|
This module provides a single class, \class{RobotFileParser}, which answers
|
||||||
questions about whether or not a particular user agent can fetch a URL on
|
questions about whether or not a particular user agent can fetch a URL on
|
||||||
the web site that published the \file{robots.txt} file. For more details on
|
the Web site that published the \file{robots.txt} file. For more details on
|
||||||
the structure of \file{robots.txt} files, see
|
the structure of \file{robots.txt} files, see
|
||||||
\url{http://info.webcrawler.com/mak/projects/robots/norobots.html}.
|
\url{http://info.webcrawler.com/mak/projects/robots/norobots.html}.
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ native toolkit interfaces for the Macintosh.
|
||||||
|
|
||||||
|
|
||||||
\section{\module{stdwin} ---
|
\section{\module{stdwin} ---
|
||||||
Platform-independent GUI System}
|
Platform-independent Graphical User Interface System}
|
||||||
|
|
||||||
\declaremodule{builtin}{stdwin}
|
\declaremodule{builtin}{stdwin}
|
||||||
\modulesynopsis{Older GUI system for X11 and Macintosh.}
|
\modulesynopsis{Older graphical user interface system for X11 and Macintosh.}
|
||||||
|
|
||||||
|
|
||||||
This module defines several new object types and functions that
|
This module defines several new object types and functions that
|
||||||
|
|
|
@ -126,11 +126,12 @@ the C function of the same name, there is no trailing newline.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{clock}{}
|
\begin{funcdesc}{clock}{}
|
||||||
Return the current CPU time as a floating point number expressed in
|
Return the current processor time as a floating point number expressed in
|
||||||
seconds. The precision, and in fact the very definition of the meaning
|
seconds. The precision, and in fact the very definition of the meaning
|
||||||
of ``CPU time''\index{CPU time}, depends on that of the C function
|
of ``processor time''\index{CPU time}\index{processor time}, depends on
|
||||||
of the same name, but in any case, this is the function to use for
|
that of the C function of the same name, but in any case, this is the
|
||||||
benchmarking\index{benchmarking} Python or timing algorithms.
|
function to use for benchmarking\index{benchmarking} Python or timing
|
||||||
|
algorithms.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{ctime}{\optional{secs}}
|
\begin{funcdesc}{ctime}{\optional{secs}}
|
||||||
|
|
|
@ -627,7 +627,7 @@ be of interest when inspecting the results of running a set of tests:
|
||||||
The following methods of the \class{TestResult} class are used to
|
The following methods of the \class{TestResult} class are used to
|
||||||
maintain the internal data structures, and mmay be extended in
|
maintain the internal data structures, and mmay be extended in
|
||||||
subclasses to support additional reporting requirements. This is
|
subclasses to support additional reporting requirements. This is
|
||||||
particularly useful in building GUI tools which support interactive
|
particularly useful in building tools which support interactive
|
||||||
reporting while tests are being run.
|
reporting while tests are being run.
|
||||||
|
|
||||||
\begin{methoddesc}[TestResult]{startTest}{test}
|
\begin{methoddesc}[TestResult]{startTest}{test}
|
||||||
|
@ -667,8 +667,8 @@ One additional method is available for \class{TestResult} objects:
|
||||||
\class{TestRunner} object return to its caller without running any
|
\class{TestRunner} object return to its caller without running any
|
||||||
additional tests. This is used by the \class{TextTestRunner} class
|
additional tests. This is used by the \class{TextTestRunner} class
|
||||||
to stop the test framework when the user signals an interrupt from
|
to stop the test framework when the user signals an interrupt from
|
||||||
the keyboard. GUI tools which provide runners can use this in a
|
the keyboard. Interactive tools which provide runners can use this
|
||||||
similar manner.
|
in a similar manner.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
\modulesynopsis{Open an arbitrary network resource by URL (requires sockets).}
|
\modulesynopsis{Open an arbitrary network resource by URL (requires sockets).}
|
||||||
|
|
||||||
\index{WWW}
|
\index{WWW}
|
||||||
\index{World-Wide Web}
|
\index{World Wide Web}
|
||||||
\index{URL}
|
\index{URL}
|
||||||
|
|
||||||
|
|
||||||
This module provides a high-level interface for fetching data across
|
This module provides a high-level interface for fetching data across
|
||||||
the World-Wide Web. In particular, the \function{urlopen()} function
|
the World Wide Web. In particular, the \function{urlopen()} function
|
||||||
is similar to the built-in function \function{open()}, but accepts
|
is similar to the built-in function \function{open()}, but accepts
|
||||||
Universal Resource Locators (URLs) instead of filenames. Some
|
Universal Resource Locators (URLs) instead of filenames. Some
|
||||||
restrictions apply --- it can only open URLs for reading, and no seek
|
restrictions apply --- it can only open URLs for reading, and no seek
|
||||||
|
@ -249,7 +249,7 @@ protocol. This can sometimes cause confusing error messages.
|
||||||
The \function{urlopen()} and \function{urlretrieve()} functions can
|
The \function{urlopen()} and \function{urlretrieve()} functions can
|
||||||
cause arbitrarily long delays while waiting for a network connection
|
cause arbitrarily long delays while waiting for a network connection
|
||||||
to be set up. This means that it is difficult to build an interactive
|
to be set up. This means that it is difficult to build an interactive
|
||||||
web client using these functions without using threads.
|
Web client using these functions without using threads.
|
||||||
|
|
||||||
\item
|
\item
|
||||||
The data returned by \function{urlopen()} or \function{urlretrieve()}
|
The data returned by \function{urlopen()} or \function{urlretrieve()}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
\modulesynopsis{Parse URLs into components.}
|
\modulesynopsis{Parse URLs into components.}
|
||||||
|
|
||||||
\index{WWW}
|
\index{WWW}
|
||||||
\index{World-Wide Web}
|
\index{World Wide Web}
|
||||||
\index{URL}
|
\index{URL}
|
||||||
\indexii{URL}{parsing}
|
\indexii{URL}{parsing}
|
||||||
\indexii{relative}{URL}
|
\indexii{relative}{URL}
|
||||||
|
|
|
@ -281,7 +281,7 @@ triggers a warning.
|
||||||
|
|
||||||
\begin{seealso}
|
\begin{seealso}
|
||||||
\seetitle[http://www.w3.org/TR/REC-xml-names/]{Namespaces in XML}{
|
\seetitle[http://www.w3.org/TR/REC-xml-names/]{Namespaces in XML}{
|
||||||
This World-Wide Web Consortium recommendation describes the
|
This World Wide Web Consortium recommendation describes the
|
||||||
proper syntax and processing requirements for namespaces in
|
proper syntax and processing requirements for namespaces in
|
||||||
XML.}
|
XML.}
|
||||||
\end{seealso}
|
\end{seealso}
|
||||||
|
|
Loading…
Reference in New Issue