Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e07745ec
Commit
e07745ec
authored
Mar 26, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few lines were indented using spaces instead of tabs -- fix them.
parent
3e415c72
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
282 additions
and
265 deletions
+282
-265
Lib/binhex.py
Lib/binhex.py
+7
-7
Lib/bisect.py
Lib/bisect.py
+2
-2
Lib/copy.py
Lib/copy.py
+14
-14
Lib/ftplib.py
Lib/ftplib.py
+137
-132
Lib/gopherlib.py
Lib/gopherlib.py
+12
-10
Lib/mailbox.py
Lib/mailbox.py
+43
-37
Lib/multifile.py
Lib/multifile.py
+9
-9
Lib/nntplib.py
Lib/nntplib.py
+9
-8
Lib/profile.py
Lib/profile.py
+11
-10
Lib/quopri.py
Lib/quopri.py
+28
-28
Lib/string.py
Lib/string.py
+5
-4
Lib/stringold.py
Lib/stringold.py
+5
-4
No files found.
Lib/binhex.py
View file @
e07745ec
Lib/bisect.py
View file @
e07745ec
Lib/copy.py
View file @
e07745ec
Lib/ftplib.py
View file @
e07745ec
...
...
@@ -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
':
...
...
Lib/gopherlib.py
View file @
e07745ec
...
...
@@ -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
)
...
...
Lib/mailbox.py
View file @
e07745ec
...
...
@@ -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
()
...
...
Lib/multifile.py
View file @
e07745ec
Lib/nntplib.py
View file @
e07745ec
...
...
@@ -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
...
...
Lib/profile.py
View file @
e07745ec
...
...
@@ -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)"
...
...
Lib/quopri.py
View file @
e07745ec
Lib/string.py
View file @
e07745ec
...
...
@@ -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
:
...
...
Lib/stringold.py
View file @
e07745ec
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment