home *** CD-ROM | disk | FTP | other *** search
- <TITLE>gopherlib -- Python library reference</TITLE>
- Next: <A HREF="../n/nntplib" TYPE="Next">nntplib</A>
- Prev: <A HREF="../f/ftplib" TYPE="Prev">ftplib</A>
- Up: <A HREF="../i/internet_and_www" TYPE="Up">Internet and WWW</A>
- Top: <A HREF="../t/top" TYPE="Top">Top</A>
- <H1>10.5. Standard Module <CODE>gopherlib</CODE></H1>
- This module provides a minimal implementation of client side of the
- the Gopher protocol. It is used by the module <CODE>urllib</CODE> to handle
- URLs that use the Gopher protocol.
- <P>
- The module defines the following functions:
- <P>
- <DL><DT><B>send_selector</B> (<VAR>selector</VAR>, <VAR>host</VAR>[, <VAR>port</VAR>]) -- function of module gopherlib<DD>
- Send a <VAR>selector</VAR> string to the gopher server at <VAR>host</VAR> and
- <VAR>port</VAR> (default 70). Return an open file object from which the
- returned document can be read.
- </DL>
- <DL><DT><B>send_query</B> (<VAR>selector</VAR>, <VAR>query</VAR>, <VAR>host</VAR>[, <VAR>port</VAR>]) -- function of module gopherlib<DD>
- Send a <VAR>selector</VAR> string and a <VAR>query</VAR> string to a gopher
- server at <VAR>host</VAR> and <VAR>port</VAR> (default 70). Return an open file
- object from which the returned document can be read.
- </DL>
- Note that the data returned by the Gopher server can be of any type,
- depending on the first character of the selector string. If the data
- is text (first character of the selector is `<SAMP>0</SAMP>'), lines are
- terminated by CRLF, and the data is terminated by a line consisting of
- a single `<SAMP>.</SAMP>', and a leading `<SAMP>.</SAMP>' should be stripped from
- lines that begin with `<SAMP>..</SAMP>'. Directory listings (first charactger
- of the selector is `<SAMP>1</SAMP>') are transferred using the same protocol.
-