A few lines were indented using spaces instead of tabs -- fix them.

This commit is contained in:
Guido van Rossum 1998-03-26 20:56:10 +00:00
parent fa6e254b34
commit 8ca842066c
12 changed files with 282 additions and 265 deletions

View File

@ -486,7 +486,8 @@ def parse150(resp):
global _150_re
if _150_re is None:
import re
_150_re = re.compile("150 .* \(([0-9][0-9]*) bytes\)", re.IGNORECASE)
_150_re = re.compile("150 .* \(([0-9][0-9]*) bytes\)",
re.IGNORECASE)
m = _150_re.match(resp)
if m:
return string.atoi(m.group(1))
@ -573,9 +574,11 @@ class Netrc:
def __init__(self, filename=None):
if not filename:
if os.environ.has_key("HOME"):
filename = os.path.join(os.environ["HOME"], ".netrc")
filename = os.path.join(os.environ["HOME"],
".netrc")
else:
raise IOError, "specify file to load or set $HOME"
raise IOError, \
"specify file to load or set $HOME"
self.__hosts = {}
self.__macros = {}
fp = open(filename, "r")
@ -625,7 +628,8 @@ class Netrc:
self.__defacct = acct or self.__defacct
if host:
if self.__hosts.has_key(host):
ouser, opasswd, oacct = self.__hosts[host]
ouser, opasswd, oacct = \
self.__hosts[host]
user = user or ouser
passwd = passwd or opasswd
acct = acct or oacct
@ -639,8 +643,8 @@ class Netrc:
def get_account(self, host):
"""Returns login information for the named host.
The return value is a triple containing userid, password, and the
accounting field.
The return value is a triple containing userid,
password, and the accounting field.
"""
host = string.lower(host)
@ -690,7 +694,8 @@ def test():
userid, passwd, acct = netrc.get_account(host)
except KeyError:
# no account for host
sys.stderr.write("No account -- using anonymous login.")
sys.stderr.write(
"No account -- using anonymous login.")
ftp.login(userid, passwd, acct)
for file in sys.argv[2:]:
if file[:2] == '-l':

View File

@ -86,7 +86,8 @@ def path_to_selector(path):
# See section 3.4 of RFC 1738 for details
def path_to_datatype_name(path):
if path=="/":
return "TYPE='unknown'" # No way to tell, although "INDEX" is probable
# No way to tell, although "INDEX" is likely
return "TYPE='unknown'"
else:
return type_to_name(path[1])
@ -118,7 +119,8 @@ def get_directory(f):
continue
if len(parts) > 4:
if parts[4:] != ['+']:
print '(Extra info from server:', parts[4:], ')'
print '(Extra info from server:',
print parts[4:], ')'
else:
parts.append('')
parts.insert(0, gtype)

View File

@ -7,6 +7,7 @@ import rfc822
import os
class _Mailbox:
def __init__(self, fp):
self.fp = fp
self.seekp = 0
@ -35,6 +36,7 @@ class _Mailbox:
return rfc822.Message(_Subfile(self.fp, start, stop))
class _Subfile:
def __init__(self, fp, start, stop):
self.fp = fp
self.start = start
@ -77,6 +79,7 @@ class _Subfile:
pass
class UnixMailbox(_Mailbox):
def _search_start(self):
while 1:
line = self.fp.readline()
@ -96,6 +99,7 @@ class UnixMailbox(_Mailbox):
return
class MmdfMailbox(_Mailbox):
def _search_start(self):
while 1:
line = self.fp.readline()
@ -115,6 +119,7 @@ class MmdfMailbox(_Mailbox):
return
class MHMailbox:
def __init__(self, dirname):
import re
pat = re.compile('^[0-9][0-9]*$')
@ -135,6 +140,7 @@ class MHMailbox:
class BabylMailbox(_Mailbox):
def _search_start(self):
while 1:
line = self.fp.readline()

View File

@ -77,7 +77,8 @@ class NNTP:
if not password:
raise error_reply, resp
else:
resp = self.shortcmd('authinfo pass '+password)
resp = self.shortcmd(
'authinfo pass '+password)
if resp[:3] != '281':
raise error_perm, resp

View File

@ -482,22 +482,23 @@ class Profile:
#**************************************************************
def calibrate(self, m):
# Modified by Tim Peters
n = m
s = self.timer()
s = self.get_time()
while n:
self.simple()
n = n - 1
f = self.timer()
my_simple = f[0]+f[1]-s[0]-s[1]
f = self.get_time()
my_simple = f - s
#print "Simple =", my_simple,
n = m
s = self.timer()
s = self.get_time()
while n:
self.instrumented()
n = n - 1
f = self.timer()
my_inst = f[0]+f[1]-s[0]-s[1]
f = self.get_time()
my_inst = f - s
# print "Instrumented =", my_inst
avg_cost = (my_inst - my_simple)/m
#print "Delta/call =", avg_cost, "(profiler fixup constant)"

View File

@ -508,7 +508,8 @@ def translate(s, table, deletions=""):
"""
if type(table) != type('') or len(table) != 256:
raise TypeError, "translation table must be 256 characters long"
raise TypeError, \
"translation table must be 256 characters long"
res = ""
for c in s:
if c not in deletions:

View File

@ -508,7 +508,8 @@ def translate(s, table, deletions=""):
"""
if type(table) != type('') or len(table) != 256:
raise TypeError, "translation table must be 256 characters long"
raise TypeError, \
"translation table must be 256 characters long"
res = ""
for c in s:
if c not in deletions: