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
b6ef5ffb
Commit
b6ef5ffb
authored
Sep 22, 2003
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid list as a variable name.
parent
a6090ea9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Lib/gopherlib.py
Lib/gopherlib.py
+10
-10
No files found.
Lib/gopherlib.py
View file @
b6ef5ffb
...
...
@@ -95,7 +95,7 @@ def path_to_datatype_name(path):
def
get_directory
(
f
):
"""Get a directory in the form of a list of entries."""
list
=
[]
entries
=
[]
while
1
:
line
=
f
.
readline
()
if
not
line
:
...
...
@@ -122,14 +122,14 @@ def get_directory(f):
else
:
parts
.
append
(
''
)
parts
.
insert
(
0
,
gtype
)
list
.
append
(
parts
)
return
list
entries
.
append
(
parts
)
return
entries
def
get_textfile
(
f
):
"""Get a text file as a list of lines, with trailing CRLF stripped."""
li
st
=
[]
get_alt_textfile
(
f
,
li
st
.
append
)
return
li
st
li
nes
=
[]
get_alt_textfile
(
f
,
li
nes
.
append
)
return
li
nes
def
get_alt_textfile
(
f
,
func
):
"""Get a text file and pass each line to a function, with trailing CRLF stripped."""
...
...
@@ -191,11 +191,11 @@ def test():
else
:
f
=
send_selector
(
selector
,
host
)
if
type
==
A_TEXT
:
li
st
=
get_textfile
(
f
)
for
item
in
li
st
:
print
item
li
nes
=
get_textfile
(
f
)
for
item
in
li
nes
:
print
item
elif
type
in
(
A_MENU
,
A_INDEX
):
list
=
get_directory
(
f
)
for
item
in
list
:
print
item
entries
=
get_directory
(
f
)
for
item
in
entries
:
print
item
else
:
data
=
get_binary
(
f
)
print
'binary data:'
,
len
(
data
),
'bytes:'
,
`data[:100]`
[:
40
]
...
...
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