pybiolib 1.1.2004__py3-none-any.whl → 1.1.2013__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
biolib/jobs/job_result.py CHANGED
@@ -74,9 +74,23 @@ class JobResult:
74
74
  if dir_path:
75
75
  dir_path.mkdir(parents=True, exist_ok=True)
76
76
 
77
- with open(destination_file_path, mode='wb') as destination_file:
78
- for chunk in stream_seeker.seek_and_read(file_start=file.start, file_length=file.length):
79
- destination_file.write(chunk)
77
+ # write content to temporary (partial) file
78
+ partial_path = destination_file_path.with_suffix(
79
+ destination_file_path.suffix + f'.{self._job_uuid}.partial_biolib_download'
80
+ )
81
+ file_start = file.start
82
+ data_to_download = file.length
83
+ if partial_path.exists():
84
+ data_already_downloaded = partial_path.stat().st_size
85
+ file_start += data_already_downloaded
86
+ data_to_download -= data_already_downloaded
87
+
88
+ with open(partial_path, mode='ab') as partial_file:
89
+ for chunk in stream_seeker.seek_and_read(file_start=file_start, file_length=data_to_download):
90
+ partial_file.write(chunk)
91
+
92
+ # rename partial file to actual file name
93
+ partial_path.rename(destination_file_path)
80
94
 
81
95
  def get_output_file(self, filename) -> LazyLoadedFile:
82
96
  files = self._get_module_output().get_files()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.2004
3
+ Version: 1.1.2013
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -90,7 +90,7 @@ biolib/experiments/experiment.py,sha256=_ied3A3U6NFa6_ewEYn2TCozqeHvDxDqdRhMtZbF
90
90
  biolib/experiments/types.py,sha256=n9GxdFA7cLMfHvLLqLmZzX31ELeSSkMXFoEEdFsdWGY,171
91
91
  biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
92
92
  biolib/jobs/job.py,sha256=aWKnf_2pYdr76gh3hxPiVs2iuXlpwZkKPTK81Pz4G2U,19072
93
- biolib/jobs/job_result.py,sha256=GAM99MOcHUgUvzL5r9BpdBKnTPfm6ipOh67HvNDO9TY,5236
93
+ biolib/jobs/job_result.py,sha256=qj4H8LQFtHqJzLik0lvpZDAIXJptalIwqt7CvpXAB9g,5860
94
94
  biolib/jobs/types.py,sha256=qhadtH2KDC2WUOOqPiwke0YgtQY4FtuB71Stekq1k48,970
95
95
  biolib/lfs/__init__.py,sha256=Qv8vdYeK43JecT4SsE93ZYE2VmNiZENdNpW8P9-omxs,115
96
96
  biolib/lfs/cache.py,sha256=pQS2np21rdJ6I3DpoOutnzPHpLOZgUIS8TMltUJk_k4,2226
@@ -109,8 +109,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
109
109
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
110
110
  biolib/utils/seq_util.py,sha256=jC5WhH63FTD7SLFJbxQGA2hOt9NTwq9zHl_BEec1Z0c,4907
111
111
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
112
- pybiolib-1.1.2004.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
113
- pybiolib-1.1.2004.dist-info/METADATA,sha256=ulvo3XlgpOcN4qybIW2FgOo3oNBqcHeMb4uXUPI94WE,1508
114
- pybiolib-1.1.2004.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
115
- pybiolib-1.1.2004.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
116
- pybiolib-1.1.2004.dist-info/RECORD,,
112
+ pybiolib-1.1.2013.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
113
+ pybiolib-1.1.2013.dist-info/METADATA,sha256=B93geN5rthLJykSPAxcveRjO45iKhcoMeMi_MyQYXw0,1508
114
+ pybiolib-1.1.2013.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
115
+ pybiolib-1.1.2013.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
116
+ pybiolib-1.1.2013.dist-info/RECORD,,