source: vendor/python/2.5/Doc/lib/libgopherlib.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 1.5 KB
Line 
1\section{\module{gopherlib} ---
2 Gopher protocol client}
3
4\declaremodule{standard}{gopherlib}
5\modulesynopsis{Gopher protocol client (requires sockets).}
6
7\deprecated{2.5}{The \code{gopher} protocol is not in active use
8 anymore.}
9
10\indexii{Gopher}{protocol}
11
12This module provides a minimal implementation of client side of the
13Gopher protocol. It is used by the module \refmodule{urllib} to
14handle URLs that use the Gopher protocol.
15
16The module defines the following functions:
17
18\begin{funcdesc}{send_selector}{selector, host\optional{, port}}
19Send a \var{selector} string to the gopher server at \var{host} and
20\var{port} (default \code{70}). Returns an open file object from
21which the returned document can be read.
22\end{funcdesc}
23
24\begin{funcdesc}{send_query}{selector, query, host\optional{, port}}
25Send a \var{selector} string and a \var{query} string to a gopher
26server at \var{host} and \var{port} (default \code{70}). Returns an
27open file object from which the returned document can be read.
28\end{funcdesc}
29
30Note that the data returned by the Gopher server can be of any type,
31depending on the first character of the selector string. If the data
32is text (first character of the selector is \samp{0}), lines are
33terminated by CRLF, and the data is terminated by a line consisting of
34a single \samp{.}, and a leading \samp{.} should be stripped from
35lines that begin with \samp{..}. Directory listings (first character
36of the selector is \samp{1}) are transferred using the same protocol.
Note: See TracBrowser for help on using the repository browser.