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
add_module
Commits
b3bfd868
Commit
b3bfd868
authored
Oct 23, 2020
by
Paul McCarthy
🚵
Browse files
BF: Skip downloads that already exist, even if there is no checksum to compare
parent
51ed5402
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsl/add_module/ui.py
View file @
b3bfd868
...
...
@@ -308,7 +308,16 @@ def downloadPlugin(plugin : Plugin, destDir, **kwargs) -> Tuple[str, bool]:
info
(
f
'
{
plugin
.
name
}
...'
,
EMPHASIS
)
if
op
.
exists
(
destFile
)
and
plugin
.
checksum
is
not
None
:
# if file exists, but we don't
# have a checksum to verify it,
# we assume that it is ok
if
op
.
exists
(
destFile
)
and
plugin
.
checksum
is
None
:
skipDownload
=
True
# otherwise we compare checksums,
# and re-download the file if they
# don't match
elif
op
.
exists
(
destFile
)
and
plugin
.
checksum
is
not
None
:
info
(
f
'
{
fname
}
already exists - calculating SHA256 checksum...'
)
destchecksum
=
calcChecksum
(
destFile
)
if
destchecksum
==
plugin
.
checksum
:
...
...
fsl/scripts/fsl_add_module.py
View file @
b3bfd868
...
...
@@ -133,7 +133,9 @@ def parseArgs(argv : List[str]) -> argparse.Namespace:
}
parser
=
argparse
.
ArgumentParser
(
'fsl_add_module'
,
'Download and install FSL plugins'
)
'fsl_add_module'
,
usage
=
'fsl_add_module [options] [plugins]'
,
description
=
'Download and install FSL plugins'
)
parser
.
add_argument
(
'-V'
,
'--version'
,
action
=
'version'
,
help
=
helps
[
'version'
],
version
=
'%(prog)s {}'
.
format
(
__VERSION__
))
...
...
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