gopherlib
index
/usr/lib/python1.6/gopherlib.py

Gopher protocol client interface.

 
Modules
            
string

 
Functions
            
get_alt_binary(f, func, blocksize)
Get a binary file and pass each block to a function.
get_alt_textfile(f, func)
Get a text file and pass each line to a function, with trailing CRLF stripped.
get_binary(f)
Get a binary file as one solid data block.
get_directory(f)
Get a directory in the form of a list of entries.
get_textfile(f)
Get a text file as a list of lines, with trailing CRLF stripped.
path_to_datatype_name(path)
Takes a path as returned by urlparse and maps it to a string.
See section 3.4 of RFC 1738 for details.
path_to_selector(path)
Takes a path as returned by urlparse and returns the appropriate selector.
send_query(selector, query, host, port=0)
Send a selector and a query string.
send_selector(selector, host, port=0)
Send a selector to a given host and port, return a file with the reply.
test()
Trivial test program.
type_to_name(gtype)
Map all file types to strings; unknown types become TYPE='x'.

 
Data
             A_BINARY = '9'
A_CALENDAR = 'c'
A_CSO = '2'
A_DUPLICATE = '+'
A_ERROR = '3'
A_EVENT = 'e'
A_GIF = 'g'
A_HTML = 'h'
A_IMAGE = 'I'
A_INDEX = '7'
A_MACBINHEX = '4'
A_MENU = '1'
A_MIME = 'M'
A_PCBINHEX = '5'
A_PLUS_IMAGE = ':'
A_PLUS_MOVIE = ';'
A_PLUS_SOUND = '<'
A_QUERY = 'q'
A_SOUND = 's'
A_TELNET = '8'
A_TEXT = '0'
A_TN3270 = 'T'
A_UUENCODED = '6'
A_WHOIS = 'w'
A_WWW = 'w'
CRLF = '\015\012'
DEF_HOST = 'gopher.micro.umn.edu'
DEF_PORT = 70
DEF_SELECTOR = '1/'
TAB = '\011'
__file__ = '/usr/lib/python1.6/gopherlib.pyc'
__name__ = 'gopherlib'
_names = ['A_BINARY', 'A_CALENDAR', 'A_CSO', 'A_DUPLICATE', 'A_ERROR', 'A_EVENT', 'A_GIF', 'A_HTML', 'A_IMAGE', 'A_INDEX', 'A_MACBINHEX', 'A_MENU', 'A_MIME', 'A_PCBINHEX', 'A_PLUS_IMAGE', 'A_PLUS_MOVIE', 'A_PLUS_SOUND', 'A_QUERY', 'A_SOUND', 'A_TELNET', ...]
_type_to_name_map = {}