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
FSL
conda
installer
Commits
cbb906c0
Commit
cbb906c0
authored
Jul 26, 2021
by
Paul McCarthy
🚵
Browse files
Merge branch 'enh/local_manifest' into 'master'
Enh/local manifest See merge request fsl/conda/installer!1
parents
3fa8bb05
eaa746ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
fslinstaller.py
View file @
cbb906c0
...
...
@@ -34,13 +34,9 @@ import traceback
# TODO check py2/3
try
:
import
urllib
import
urllib.parse
as
urlparse
import
urllib.request
as
urlrequest
except
ImportError
:
import
urllib2
as
urllib
import
urllib2
as
urlparse
import
urllib2
as
urlrequest
import
urllib
as
urlrequest
try
:
import
queue
except
ImportError
:
import
Queue
as
queue
...
...
@@ -783,6 +779,10 @@ def download_file(url, destination, progress=None, blocksize=131072):
log
.
debug
(
'Downloading %s ...'
,
url
)
# Path to local file
if
op
.
exists
(
url
):
url
=
'file:'
+
urlrequest
.
pathname2url
(
op
.
abspath
(
url
))
req
=
None
try
:
# py2: urlopen result cannot be
...
...
@@ -1681,6 +1681,10 @@ def parse_args(argv=None):
if
not
op
.
exists
(
args
.
workdir
):
os
.
mkdir
(
args
.
workdir
)
# accept local path for manifest
if
args
.
manifest
is
not
None
and
op
.
exists
(
args
.
manifest
):
args
.
manifest
=
op
.
abspath
(
args
.
manifest
)
return
args
...
...
test/test_routines.py
View file @
cbb906c0
...
...
@@ -168,6 +168,14 @@ def test_download_file():
with
open
(
'copy'
,
'rt'
)
as
f
:
assert
f
.
read
()
==
'hello
\n
'
# download_file should also work
# with a path to a local file
os
.
remove
(
'copy'
)
inst
.
download_file
(
'file'
,
'copy'
)
with
open
(
'copy'
,
'rt'
)
as
f
:
assert
f
.
read
()
==
'hello
\n
'
def
test_patch_file
():
...
...
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