Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.extension
Commits
1cc7229b
Commit
1cc7229b
authored
Sep 15, 2014
by
André Anjos
💬
Browse files
Make file readout py3 compatible
parent
fc037212
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/extension/utils.py
View file @
1cc7229b
...
...
@@ -332,6 +332,12 @@ def load_requirements(f=None):
Defaults to "./requirements.txt"
"""
f
=
f
if
f
is
not
None
else
open
(
"requirements.txt"
,
'rt'
)
retval
=
[
k
.
strip
()
for
k
in
f
]
return
[
k
for
k
in
retval
if
k
and
k
[
0
]
!=
'#'
]
def
readlines
(
f
):
retval
=
[
str
(
k
.
strip
())
for
k
in
f
]
return
[
k
for
k
in
retval
if
k
and
k
[
0
]
!=
'#'
]
if
f
:
return
readlines
(
f
)
# otherwise, just open requirements.txt and read all contents
with
open
(
'requirements.txt'
,
'rt'
)
as
f
:
return
readlines
(
f
)
Write
Preview
Supports
Markdown
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