Skip to content

Commit

Permalink
allow for user input to redownload data archive file (not activated)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikohansen committed Jun 6, 2022
1 parent 7e07868 commit 413f1ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code-postprocessing/cocopp/archiving.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ def get(self, substr=None, remote=True):
if names[0] in self._redownload_if_changed:
self._download(names[0])
self.check_hash(full_name)
elif 11 < 3 and not input("\n\n ** wrong hash, download {} again? [n=no, return=yes] **".format(names[0])).lower().startswith('n'):
# seems to break tests?
self._download(names[0])
self.check_hash(full_name)
else:
raise
try: self._redownload_if_changed.remove(names[0])
Expand Down Expand Up @@ -832,7 +836,8 @@ def check_hash(self, name):
' %s\n'
'as it may be a partial or unsuccessful download.\n'
'A missing file will be downloaded again by `get`.\n'
'Alternatively, call `update` to update definitions\n'
'Alternatively, call `cocopp.archives.this-archive.update()`\n'
'of the respective data archive to update definitions\n'
'and checksums and allow for automatic re-downloads.\n'
'If this is not a remote archive consider to re-`create` it.'
'' % (name, self.local_data_path, str(self.remote_data_path),
Expand Down

0 comments on commit 413f1ba

Please sign in to comment.