summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-02-09 10:10:02 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2001-02-09 10:10:02 (GMT)
commit19e6d6218ecd7ec34083ab74c953ccf63d98798a (patch)
treeddfbbcaf58a833a99e501a5be763382ca50aed9a /Lib
parentc95bf69fcedd40b81f98d58a6955322712e726b3 (diff)
downloadcpython-19e6d6218ecd7ec34083ab74c953ccf63d98798a.zip
cpython-19e6d6218ecd7ec34083ab74c953ccf63d98798a.tar.gz
cpython-19e6d6218ecd7ec34083ab74c953ccf63d98798a.tar.bz2
String method conversion.
(This one was trivial -- no actual string. references in it!)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/gopherlib.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/gopherlib.py b/Lib/gopherlib.py
index 9514832..f5bbca5 100644
--- a/Lib/gopherlib.py
+++ b/Lib/gopherlib.py
@@ -1,7 +1,5 @@
"""Gopher protocol client interface."""
-import string
-
__all__ = ["send_selector","send_query"]
# Default selector, host and port
@@ -58,15 +56,14 @@ TAB = '\t'
def send_selector(selector, host, port = 0):
"""Send a selector to a given host and port, return a file with the reply."""
import socket
- import string
if not port:
- i = string.find(host, ':')
+ i = host.find(':')
if i >= 0:
- host, port = host[:i], string.atoi(host[i+1:])
+ host, port = host[:i], int(host[i+1:])
if not port:
port = DEF_PORT
elif type(port) == type(''):
- port = string.atoi(port)
+ port = int(port)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.send(selector + CRLF)
@@ -98,7 +95,6 @@ def path_to_datatype_name(path):
def get_directory(f):
"""Get a directory in the form of a list of entries."""
- import string
list = []
while 1:
line = f.readline()
@@ -115,7 +111,7 @@ def get_directory(f):
print '(Empty line from server)'
continue
gtype = line[0]
- parts = string.splitfields(line[1:], TAB)
+ parts = line[1:].split(TAB)
if len(parts) < 4:
print '(Bad line from server:', `line`, ')'
continue