annotate Doc/lib/libgopherlib.tex @ 39042:c02fa187e0f4 legacy-trunk

Part of SF patch #1484695. This removes dead code. The chksum was already verified in .frombuf() on the lines above. If there was a problem an exception is raised, so there was no way this condition could have been true.
author Neal Norwitz <nnorwitz@gmail.com>
date Mon, 10 Jul 2006 00:23:17 +0000
parents a9f9db9fa974
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
1 \section{\module{gopherlib} ---
10685
85cf476657c5 Reference to urllib module can be a hyperlink.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
2 Gopher protocol client}
85cf476657c5 Reference to urllib module can be a hyperlink.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
3
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
4 \declaremodule{standard}{gopherlib}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
5 \modulesynopsis{Gopher protocol client (requires sockets).}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
6
36551
a9f9db9fa974 Add deprecation notices to modules deprecated since 2000.
Georg Brandl <georg@python.org>
parents: 30505
diff changeset
7 \deprecated{2.5}{The \code{gopher} protocol is not in active use
a9f9db9fa974 Add deprecation notices to modules deprecated since 2000.
Georg Brandl <georg@python.org>
parents: 30505
diff changeset
8 anymore.}
a9f9db9fa974 Add deprecation notices to modules deprecated since 2000.
Georg Brandl <georg@python.org>
parents: 30505
diff changeset
9
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
10 \indexii{Gopher}{protocol}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
11
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
12 This module provides a minimal implementation of client side of the
30505
f4a01c405a44 Fix doubled word errors.
Raymond Hettinger <python@rcn.com>
parents: 10685
diff changeset
13 Gopher protocol. It is used by the module \refmodule{urllib} to
10685
85cf476657c5 Reference to urllib module can be a hyperlink.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
14 handle URLs that use the Gopher protocol.
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
15
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
16 The module defines the following functions:
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
17
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
18 \begin{funcdesc}{send_selector}{selector, host\optional{, port}}
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
19 Send a \var{selector} string to the gopher server at \var{host} and
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
20 \var{port} (default \code{70}). Returns an open file object from
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
21 which the returned document can be read.
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
22 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
23
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
24 \begin{funcdesc}{send_query}{selector, query, host\optional{, port}}
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
25 Send a \var{selector} string and a \var{query} string to a gopher
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
26 server at \var{host} and \var{port} (default \code{70}). Returns an
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
27 open file object from which the returned document can be read.
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
28 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
29
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
30 Note that the data returned by the Gopher server can be of any type,
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
31 depending on the first character of the selector string. If the data
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
32 is text (first character of the selector is \samp{0}), lines are
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
33 terminated by CRLF, and the data is terminated by a line consisting of
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
34 a single \samp{.}, and a leading \samp{.} should be stripped from
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
35 lines that begin with \samp{..}. Directory listings (first character
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
36 of the selector is \samp{1}) are transferred using the same protocol.