rclone-api 1.0.73__py2.py3-none-any.whl → 1.0.76__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/diff.py +2 -3
- rclone_api/dir.py +1 -1
- rclone_api/rclone.py +18 -0
- rclone_api/scan_missing_folders.py +26 -16
- {rclone_api-1.0.73.dist-info → rclone_api-1.0.76.dist-info}/METADATA +1 -1
- {rclone_api-1.0.73.dist-info → rclone_api-1.0.76.dist-info}/RECORD +10 -10
- {rclone_api-1.0.73.dist-info → rclone_api-1.0.76.dist-info}/LICENSE +0 -0
- {rclone_api-1.0.73.dist-info → rclone_api-1.0.76.dist-info}/WHEEL +0 -0
- {rclone_api-1.0.73.dist-info → rclone_api-1.0.76.dist-info}/entry_points.txt +0 -0
- {rclone_api-1.0.73.dist-info → rclone_api-1.0.76.dist-info}/top_level.txt +0 -0
rclone_api/diff.py
CHANGED
@@ -126,19 +126,18 @@ def _async_diff_stream_from_running_process(
|
|
126
126
|
except UnicodeDecodeError:
|
127
127
|
print("UnicodeDecodeError")
|
128
128
|
continue
|
129
|
-
output.put(None)
|
130
129
|
except KeyboardInterrupt:
|
131
130
|
import _thread
|
132
131
|
|
133
132
|
print("KeyboardInterrupt")
|
134
|
-
output.put(None)
|
135
133
|
_thread.interrupt_main()
|
136
134
|
except Exception as e:
|
137
135
|
import _thread
|
138
136
|
|
139
137
|
print(f"Error: {e}")
|
140
|
-
output.put(None)
|
141
138
|
_thread.interrupt_main()
|
139
|
+
finally:
|
140
|
+
output.put(None)
|
142
141
|
|
143
142
|
|
144
143
|
def diff_stream_from_running_process(
|
rclone_api/dir.py
CHANGED
rclone_api/rclone.py
CHANGED
@@ -349,12 +349,17 @@ class Rclone:
|
|
349
349
|
dst: str,
|
350
350
|
files: list[str] | Path,
|
351
351
|
check: bool | None = None,
|
352
|
+
max_backlog: int | None = None,
|
352
353
|
verbose: bool | None = None,
|
353
354
|
checkers: int | None = None,
|
354
355
|
transfers: int | None = None,
|
355
356
|
low_level_retries: int | None = None,
|
356
357
|
retries: int | None = None,
|
358
|
+
retries_sleep: str | None = None,
|
359
|
+
metadata: bool | None = None,
|
360
|
+
timeout: str | None = None,
|
357
361
|
max_partition_workers: int | None = None,
|
362
|
+
multi_thread_streams: int | None = None,
|
358
363
|
other_args: list[str] | None = None,
|
359
364
|
) -> list[CompletedProcess]:
|
360
365
|
"""Copy multiple files from source to destination.
|
@@ -444,6 +449,19 @@ class Rclone:
|
|
444
449
|
"--retries",
|
445
450
|
str(retries),
|
446
451
|
]
|
452
|
+
if metadata:
|
453
|
+
cmd_list.append("--metadata")
|
454
|
+
if retries_sleep is not None:
|
455
|
+
cmd_list += ["--retries-sleep", retries_sleep]
|
456
|
+
if timeout is not None:
|
457
|
+
cmd_list += ["--timeout", timeout]
|
458
|
+
if max_backlog is not None:
|
459
|
+
cmd_list += ["--max-backlog", str(max_backlog)]
|
460
|
+
if multi_thread_streams is not None:
|
461
|
+
cmd_list += [
|
462
|
+
"--multi-thread-streams",
|
463
|
+
str(multi_thread_streams),
|
464
|
+
]
|
447
465
|
if verbose:
|
448
466
|
if not any(["-v" in x for x in other_args]):
|
449
467
|
cmd_list.append("-vvvv")
|
@@ -13,11 +13,23 @@ from rclone_api.walk import walk_runner_depth_first
|
|
13
13
|
_MAX_OUT_QUEUE_SIZE = 50
|
14
14
|
|
15
15
|
|
16
|
+
def _reorder_inplace(data: list, order: Order) -> None:
|
17
|
+
if order == Order.NORMAL:
|
18
|
+
return
|
19
|
+
elif order == Order.REVERSE:
|
20
|
+
data.reverse()
|
21
|
+
return
|
22
|
+
elif order == Order.RANDOM:
|
23
|
+
random.shuffle(data)
|
24
|
+
return
|
25
|
+
else:
|
26
|
+
raise ValueError(f"Invalid order: {order}")
|
27
|
+
|
28
|
+
|
16
29
|
# ONLY Works from src -> dst diffing.
|
17
30
|
def _async_diff_dir_walk_task(
|
18
31
|
src: Dir, dst: Dir, max_depth: int, out_queue: Queue[Dir | None], order: Order
|
19
32
|
) -> None:
|
20
|
-
curr_src, curr_dst = src, dst
|
21
33
|
can_scan_two_deep = max_depth > 1 or max_depth == -1
|
22
34
|
ls_depth = 2 if can_scan_two_deep else 1
|
23
35
|
with ThreadPoolExecutor(max_workers=2) as executor:
|
@@ -35,27 +47,25 @@ def _async_diff_dir_walk_task(
|
|
35
47
|
)
|
36
48
|
src_dir_listing: DirListing = t1.result()
|
37
49
|
dst_dir_listing: DirListing = t2.result()
|
38
|
-
next_depth = max_depth -
|
39
|
-
dst_dirs: list[str] = [d.
|
40
|
-
src_dirs: list[str] = [d.
|
50
|
+
next_depth = max_depth - ls_depth if max_depth > 0 else max_depth
|
51
|
+
dst_dirs: list[str] = [d.relative_to(src) for d in dst_dir_listing.dirs]
|
52
|
+
src_dirs: list[str] = [d.relative_to(dst) for d in src_dir_listing.dirs]
|
41
53
|
dst_files_set: set[str] = set(dst_dirs)
|
42
54
|
matching_dirs: list[str] = []
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
random.shuffle(dst_dirs)
|
49
|
-
for file in src_dirs:
|
50
|
-
if file not in dst_files_set:
|
55
|
+
_reorder_inplace(src_dirs, order)
|
56
|
+
_reorder_inplace(dst_dirs, order)
|
57
|
+
for i, src_dir in enumerate(src_dirs):
|
58
|
+
src_dir_dir = src / src_dir
|
59
|
+
if src_dir not in dst_files_set:
|
51
60
|
queue_dir_listing: Queue[DirListing | None] = Queue()
|
52
61
|
if next_depth > 0 or next_depth == -1:
|
53
62
|
walk_runner_depth_first(
|
54
|
-
dir=
|
63
|
+
dir=src_dir_dir,
|
55
64
|
out_queue=queue_dir_listing,
|
56
65
|
order=order,
|
57
66
|
max_depth=next_depth,
|
58
67
|
)
|
68
|
+
out_queue.put(src)
|
59
69
|
while dirlisting := queue_dir_listing.get():
|
60
70
|
if dirlisting is None:
|
61
71
|
break
|
@@ -63,13 +73,13 @@ def _async_diff_dir_walk_task(
|
|
63
73
|
for d in dirlisting.dirs:
|
64
74
|
out_queue.put(d)
|
65
75
|
else:
|
66
|
-
matching_dirs.append(
|
76
|
+
matching_dirs.append(src_dir)
|
67
77
|
|
68
78
|
for matching_dir in matching_dirs:
|
69
79
|
# print(f"matching dir: {matching_dir}")
|
70
80
|
if next_depth > 0 or next_depth == -1:
|
71
|
-
src_next =
|
72
|
-
dst_next =
|
81
|
+
src_next = src / matching_dir
|
82
|
+
dst_next = dst / matching_dir
|
73
83
|
_async_diff_dir_walk_task(
|
74
84
|
src=src_next,
|
75
85
|
dst=dst_next,
|
@@ -4,26 +4,26 @@ rclone_api/completed_process.py,sha256=Pp-hXnLgej0IGO5ee9Fmx64dGzIofbQFEUyXdFCvO
|
|
4
4
|
rclone_api/config.py,sha256=tP6cU9DnCCEIRc_KP9HPur1jFLLg2QGFSxNwFm6_MVw,118
|
5
5
|
rclone_api/convert.py,sha256=Mx9Qo7zhkOedJd8LdhPvNGHp8znJzOk4f_2KWnoGc78,1012
|
6
6
|
rclone_api/deprecated.py,sha256=qWKpnZdYcBK7YQZKuVoWWXDwi-uqiAtbjgPcci_efow,590
|
7
|
-
rclone_api/diff.py,sha256=
|
8
|
-
rclone_api/dir.py,sha256=
|
7
|
+
rclone_api/diff.py,sha256=tMoJMAGmLSE6Q_7QhPf6PnCzb840djxMZtDmhc2GlGQ,5227
|
8
|
+
rclone_api/dir.py,sha256=i4h7LX5hB_WmVixxDRWL_l1nifvscrdWct_8Wx7wHZc,3540
|
9
9
|
rclone_api/dir_listing.py,sha256=9Qqf2SUswrOEkyqmaH23V51I18X6ePiXb9B1vUwRF5o,1571
|
10
10
|
rclone_api/exec.py,sha256=1ovvaMXDEfLiT7BrYZyE85u_yFhEUwUNW3jPOzqknR8,1023
|
11
11
|
rclone_api/file.py,sha256=YtR5Y6c0YfXTS-sReOy2UgiSnafcAeO6b2hnbojBQD4,1423
|
12
12
|
rclone_api/filelist.py,sha256=xbiusvNgaB_b_kQOZoHMJJxn6TWGtPrWd2J042BI28o,767
|
13
13
|
rclone_api/group_files.py,sha256=kOHh6ysFDkxjldSwvW6KqmiADUC1yFCdrZRY57TvbGY,5328
|
14
14
|
rclone_api/process.py,sha256=RrMfTe0bndmJ6gBK67ioqNvCstJ8aTC8RlGX1XBLlcw,4191
|
15
|
-
rclone_api/rclone.py,sha256=
|
15
|
+
rclone_api/rclone.py,sha256=JeeqJsJH8rBZW895rkT3HMCkaWeKllnG-6xj_PzLwXY,29738
|
16
16
|
rclone_api/remote.py,sha256=c9hlRKBCg1BFB9MCINaQIoCg10qyAkeqiS4brl8ce-8,343
|
17
17
|
rclone_api/rpath.py,sha256=8ZA_1wxWtskwcy0I8V2VbjKDmzPkiWd8Q2JQSvh-sYE,2586
|
18
|
-
rclone_api/scan_missing_folders.py,sha256=
|
18
|
+
rclone_api/scan_missing_folders.py,sha256=Kulca2Q6WZodt00ATFHkmqqInuoPvBkhTcS9703y6po,4740
|
19
19
|
rclone_api/types.py,sha256=DcbNw1R6j2f_1zHrhqEJcpCR-8kJfFJawMY0AmPsCnM,321
|
20
20
|
rclone_api/util.py,sha256=_cvmHcJPRl2yXw4zgZiop3z-riA_8Ek6S5NDPw8cqSY,4198
|
21
21
|
rclone_api/walk.py,sha256=-54NVE8EJcCstwDoaC_UtHm73R2HrZwVwQmsnv55xNU,3369
|
22
22
|
rclone_api/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
23
23
|
rclone_api/cmd/list_files.py,sha256=x8FHODEilwKqwdiU1jdkeJbLwOqUkUQuDWPo2u_zpf0,741
|
24
|
-
rclone_api-1.0.
|
25
|
-
rclone_api-1.0.
|
26
|
-
rclone_api-1.0.
|
27
|
-
rclone_api-1.0.
|
28
|
-
rclone_api-1.0.
|
29
|
-
rclone_api-1.0.
|
24
|
+
rclone_api-1.0.76.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
25
|
+
rclone_api-1.0.76.dist-info/METADATA,sha256=13_xQBLBt8rYCmVYCXjHahKRMdC8p1Ao0lKOY8xhlVU,4489
|
26
|
+
rclone_api-1.0.76.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
|
27
|
+
rclone_api-1.0.76.dist-info/entry_points.txt,sha256=XUoTX3m7CWxdj2VAKhEuO0NMOfX2qf-OcEDFwdyk9ZE,72
|
28
|
+
rclone_api-1.0.76.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
|
29
|
+
rclone_api-1.0.76.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|