rclone-api 1.4.5__py2.py3-none-any.whl → 1.4.7__py2.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.
- rclone_api/detail/copy_file_parts.py +41 -4
- {rclone_api-1.4.5.dist-info → rclone_api-1.4.7.dist-info}/METADATA +1 -1
- {rclone_api-1.4.5.dist-info → rclone_api-1.4.7.dist-info}/RECORD +7 -7
- {rclone_api-1.4.5.dist-info → rclone_api-1.4.7.dist-info}/LICENSE +0 -0
- {rclone_api-1.4.5.dist-info → rclone_api-1.4.7.dist-info}/WHEEL +0 -0
- {rclone_api-1.4.5.dist-info → rclone_api-1.4.7.dist-info}/entry_points.txt +0 -0
- {rclone_api-1.4.5.dist-info → rclone_api-1.4.7.dist-info}/top_level.txt +0 -0
@@ -248,6 +248,36 @@ class InfoJson:
|
|
248
248
|
return self.to_json_str()
|
249
249
|
|
250
250
|
|
251
|
+
def collapse_runs(numbers: list[int]) -> list[str]:
|
252
|
+
if not numbers:
|
253
|
+
return []
|
254
|
+
|
255
|
+
runs = []
|
256
|
+
start = numbers[0]
|
257
|
+
prev = numbers[0]
|
258
|
+
|
259
|
+
for num in numbers[1:]:
|
260
|
+
if num == prev + 1:
|
261
|
+
# Continue current run
|
262
|
+
prev = num
|
263
|
+
else:
|
264
|
+
# End current run
|
265
|
+
if start == prev:
|
266
|
+
runs.append(str(start))
|
267
|
+
else:
|
268
|
+
runs.append(f"{start}-{prev}")
|
269
|
+
start = num
|
270
|
+
prev = num
|
271
|
+
|
272
|
+
# Append the final run
|
273
|
+
if start == prev:
|
274
|
+
runs.append(str(start))
|
275
|
+
else:
|
276
|
+
runs.append(f"{start}-{prev}")
|
277
|
+
|
278
|
+
return runs
|
279
|
+
|
280
|
+
|
251
281
|
def copy_file_parts(
|
252
282
|
self: RcloneImpl,
|
253
283
|
src: str, # src:/Bucket/path/myfile.large.zst
|
@@ -293,7 +323,13 @@ def copy_file_parts(
|
|
293
323
|
all_numbers_already_done: set[int] = set(
|
294
324
|
info_json.fetch_all_finished_part_numbers()
|
295
325
|
)
|
296
|
-
|
326
|
+
|
327
|
+
first_part_number = part_infos[0].part_number
|
328
|
+
last_part_number = part_infos[-1].part_number
|
329
|
+
|
330
|
+
print(
|
331
|
+
f"all_numbers_already_done: {collapse_runs(sorted(list(all_numbers_already_done)))}"
|
332
|
+
)
|
297
333
|
|
298
334
|
filtered_part_infos: list[PartInfo] = []
|
299
335
|
for part_info in part_infos:
|
@@ -302,15 +338,16 @@ def copy_file_parts(
|
|
302
338
|
part_infos = filtered_part_infos
|
303
339
|
|
304
340
|
remaining_part_numbers: list[int] = [p.part_number for p in part_infos]
|
305
|
-
print(f"remaining_part_numbers: {remaining_part_numbers}")
|
341
|
+
print(f"remaining_part_numbers: {collapse_runs(remaining_part_numbers)}")
|
306
342
|
|
307
343
|
if len(part_infos) == 0:
|
308
344
|
return Exception(f"No parts to copy for {src}")
|
309
345
|
chunk_size = SizeSuffix(part_infos[0].range.end - part_infos[0].range.start)
|
310
346
|
|
311
347
|
info_json.chunksize = chunk_size
|
312
|
-
|
313
|
-
info_json.
|
348
|
+
|
349
|
+
info_json.first_part = first_part_number
|
350
|
+
info_json.last_part = last_part_number
|
314
351
|
info_json.save()
|
315
352
|
|
316
353
|
# We are now validated
|
@@ -32,7 +32,7 @@ rclone_api/cmd/save_to_db.py,sha256=ylvnhg_yzexM-m6Zr7XDiswvoDVSl56ELuFAdb9gqBY,
|
|
32
32
|
rclone_api/db/__init__.py,sha256=OSRUdnSWUlDTOHmjdjVmxYTUNpTbtaJ5Ll9sl-PfZg0,40
|
33
33
|
rclone_api/db/db.py,sha256=YRnYrCaXHwytQt07uEZ_mMpvPHo9-0IWcOb95fVOOfs,10086
|
34
34
|
rclone_api/db/models.py,sha256=v7qaXUehvsDvU51uk69JI23fSIs9JFGcOa-Tv1c_wVs,1600
|
35
|
-
rclone_api/detail/copy_file_parts.py,sha256=
|
35
|
+
rclone_api/detail/copy_file_parts.py,sha256=CmkMqGTYe2F7MQ4scHy-ZJoaKKILVIaqAUmidHV3adE,13412
|
36
36
|
rclone_api/detail/walk.py,sha256=-54NVE8EJcCstwDoaC_UtHm73R2HrZwVwQmsnv55xNU,3369
|
37
37
|
rclone_api/experimental/flags.py,sha256=qCVD--fSTmzlk9hloRLr0q9elzAOFzPsvVpKM3aB1Mk,2739
|
38
38
|
rclone_api/experimental/flags_base.py,sha256=ajU_czkTcAxXYU-SlmiCfHY7aCQGHvpCLqJ-Z8uZLk0,2102
|
@@ -47,9 +47,9 @@ rclone_api/s3/multipart/file_info.py,sha256=8v_07_eADo0K-Nsv7F0Ac1wcv3lkIsrR3MaR
|
|
47
47
|
rclone_api/s3/multipart/finished_piece.py,sha256=TcwA58-qgKBiskfHrePoCWaSSep6Za9psZEpzrLUUhE,1199
|
48
48
|
rclone_api/s3/multipart/upload_info.py,sha256=d6_OfzFR_vtDzCEegFfzCfWi2kUBUV4aXZzqAEVp1c4,1874
|
49
49
|
rclone_api/s3/multipart/upload_state.py,sha256=f-Aq2NqtAaMUMhYitlICSNIxCKurWAl2gDEUVizLIqw,6019
|
50
|
-
rclone_api-1.4.
|
51
|
-
rclone_api-1.4.
|
52
|
-
rclone_api-1.4.
|
53
|
-
rclone_api-1.4.
|
54
|
-
rclone_api-1.4.
|
55
|
-
rclone_api-1.4.
|
50
|
+
rclone_api-1.4.7.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
51
|
+
rclone_api-1.4.7.dist-info/METADATA,sha256=kFj6G3KlaQXxERlakrTl-RW0KUJHwSWckEKwJ-1iVb8,4627
|
52
|
+
rclone_api-1.4.7.dist-info/WHEEL,sha256=rF4EZyR2XVS6irmOHQIJx2SUqXLZKRMUrjsg8UwN-XQ,109
|
53
|
+
rclone_api-1.4.7.dist-info/entry_points.txt,sha256=fJteOlYVwgX3UbNuL9jJ0zUTuX2O79JFAeNgK7Sw7EQ,255
|
54
|
+
rclone_api-1.4.7.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
|
55
|
+
rclone_api-1.4.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|