annotate Doc/lib/libgopherlib.tex @ 8831:00a6bb65ff29 legacy-trunk

Getting rid of this ancient stuff.
author Guido van Rossum <guido@python.org>
date Wed, 05 Aug 1998 21:10:09 +0000
parents 760dcf197048
children acfffe14628e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7877
8e5223680a9d Remove all uses of \sectcode; we can now use logical markup everywhere.
Fred Drake <fdrake@acm.org>
parents: 7863
diff changeset
1 \section{Standard Module \module{gopherlib}}
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
2 \declaremodule{standard}{gopherlib}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
3
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
4 \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
5
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
6 \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
7
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
8
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
9 This module provides a minimal implementation of client side of the
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
10 the Gopher protocol. It is used by the module \code{urllib} to handle
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
11 URLs that use the Gopher protocol.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
12
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
13 The module defines the following functions:
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
14
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
15 \begin{funcdesc}{send_selector}{selector, host\optional{, port}}
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
16 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
17 \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
18 which the returned document can be read.
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
19 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
20
7036
d0a97014ed42 Added index entry for the protocol.
Fred Drake <fdrake@acm.org>
parents: 5818
diff changeset
21 \begin{funcdesc}{send_query}{selector, query, host\optional{, port}}
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
22 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
23 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
24 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
25 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
26
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
27 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
28 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
29 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
30 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
31 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
32 lines that begin with \samp{..}. Directory listings (first character
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
33 of the selector is \samp{1}) are transferred using the same protocol.