rclone-api 1.0.47__py2.py3-none-any.whl → 1.0.49__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- rclone_api/__init__.py +2 -0
- rclone_api/rclone.py +28 -10
- {rclone_api-1.0.47.dist-info → rclone_api-1.0.49.dist-info}/METADATA +1 -1
- {rclone_api-1.0.47.dist-info → rclone_api-1.0.49.dist-info}/RECORD +8 -8
- {rclone_api-1.0.47.dist-info → rclone_api-1.0.49.dist-info}/LICENSE +0 -0
- {rclone_api-1.0.47.dist-info → rclone_api-1.0.49.dist-info}/WHEEL +0 -0
- {rclone_api-1.0.47.dist-info → rclone_api-1.0.49.dist-info}/entry_points.txt +0 -0
- {rclone_api-1.0.47.dist-info → rclone_api-1.0.49.dist-info}/top_level.txt +0 -0
rclone_api/__init__.py
CHANGED
rclone_api/rclone.py
CHANGED
@@ -261,7 +261,13 @@ class Rclone:
|
|
261
261
|
cmd_list: list[str] = ["copyto", src, dst]
|
262
262
|
self._run(cmd_list)
|
263
263
|
|
264
|
-
def copy_to(
|
264
|
+
def copy_to(
|
265
|
+
self,
|
266
|
+
src: File | str,
|
267
|
+
dst: File | str,
|
268
|
+
check=True,
|
269
|
+
other_args: list[str] | None = None,
|
270
|
+
) -> None:
|
265
271
|
"""Copy multiple files from source to destination.
|
266
272
|
|
267
273
|
Warning - slow.
|
@@ -272,9 +278,16 @@ class Rclone:
|
|
272
278
|
src = str(src)
|
273
279
|
dst = str(dst)
|
274
280
|
cmd_list: list[str] = ["copyto", src, dst]
|
275
|
-
|
281
|
+
if other_args is not None:
|
282
|
+
cmd_list += other_args
|
283
|
+
self._run(cmd_list, check=check)
|
276
284
|
|
277
|
-
def copyfiles(
|
285
|
+
def copyfiles(
|
286
|
+
self,
|
287
|
+
files: str | File | list[str] | list[File],
|
288
|
+
check=True,
|
289
|
+
other_args: list[str] | None = None,
|
290
|
+
) -> list[CompletedProcess]:
|
278
291
|
"""Copy multiple files from source to destination.
|
279
292
|
|
280
293
|
Warning - slow.
|
@@ -284,10 +297,11 @@ class Rclone:
|
|
284
297
|
"""
|
285
298
|
payload: list[str] = convert_to_filestr_list(files)
|
286
299
|
if len(payload) == 0:
|
287
|
-
return
|
300
|
+
return []
|
288
301
|
|
289
302
|
datalists: dict[str, list[str]] = group_files(payload)
|
290
|
-
out: subprocess.CompletedProcess | None = None
|
303
|
+
# out: subprocess.CompletedProcess | None = None
|
304
|
+
out: list[CompletedProcess] = []
|
291
305
|
|
292
306
|
futures: list[Future] = []
|
293
307
|
|
@@ -309,19 +323,23 @@ class Rclone:
|
|
309
323
|
"--transfers",
|
310
324
|
"1000",
|
311
325
|
]
|
326
|
+
if other_args is not None:
|
327
|
+
cmd_list += other_args
|
312
328
|
out = self._run(cmd_list)
|
313
329
|
return out
|
314
330
|
|
315
331
|
fut: Future = EXECUTOR.submit(_task)
|
316
332
|
futures.append(fut)
|
317
333
|
for fut in futures:
|
318
|
-
|
319
|
-
assert
|
320
|
-
|
334
|
+
cp: subprocess.CompletedProcess = fut.result()
|
335
|
+
assert cp is not None
|
336
|
+
out.append(CompletedProcess.from_subprocess(cp))
|
337
|
+
if cp.returncode != 0:
|
321
338
|
if check:
|
322
|
-
raise ValueError(f"Error deleting files: {
|
339
|
+
raise ValueError(f"Error deleting files: {cp.stderr}")
|
323
340
|
else:
|
324
|
-
warnings.warn(f"Error deleting files: {
|
341
|
+
warnings.warn(f"Error deleting files: {cp.stderr}")
|
342
|
+
return out
|
325
343
|
|
326
344
|
def copy(self, src: Dir | str, dst: Dir | str) -> CompletedProcess:
|
327
345
|
"""Copy files from source to destination.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
rclone_api/__init__.py,sha256=
|
1
|
+
rclone_api/__init__.py,sha256=qHDw2YKWpuJ_pzcpdCqGgFS5tk3_KC4M8VGqlMd3SRE,567
|
2
2
|
rclone_api/cli.py,sha256=dibfAZIh0kXWsBbfp3onKLjyZXo54mTzDjUdzJlDlWo,231
|
3
3
|
rclone_api/completed_process.py,sha256=Pp-hXnLgej0IGO5ee9Fmx64dGzIofbQFEUyXdFCvO54,1371
|
4
4
|
rclone_api/config.py,sha256=tP6cU9DnCCEIRc_KP9HPur1jFLLg2QGFSxNwFm6_MVw,118
|
@@ -12,16 +12,16 @@ rclone_api/file.py,sha256=D02iHJW1LhfOiM_R_yPHP8_ApnDiYrkuraVcrV8-qkw,1246
|
|
12
12
|
rclone_api/filelist.py,sha256=xbiusvNgaB_b_kQOZoHMJJxn6TWGtPrWd2J042BI28o,767
|
13
13
|
rclone_api/group_files.py,sha256=HxrRUi_kFlMblrCMFyv6rO56tVMEzgU4-vVeB_2-lbc,4606
|
14
14
|
rclone_api/process.py,sha256=RrMfTe0bndmJ6gBK67ioqNvCstJ8aTC8RlGX1XBLlcw,4191
|
15
|
-
rclone_api/rclone.py,sha256
|
15
|
+
rclone_api/rclone.py,sha256=KBT3mugMPqH1Ftz7aBeu9qwZr2lxRErgCkYNgpgI3KM,23815
|
16
16
|
rclone_api/remote.py,sha256=c9hlRKBCg1BFB9MCINaQIoCg10qyAkeqiS4brl8ce-8,343
|
17
17
|
rclone_api/rpath.py,sha256=8ZA_1wxWtskwcy0I8V2VbjKDmzPkiWd8Q2JQSvh-sYE,2586
|
18
18
|
rclone_api/util.py,sha256=IWNOOcPE0xdKvehzXQ9okIppGDBYWJPIfdbUME8BFVM,4015
|
19
19
|
rclone_api/walk.py,sha256=kca0t1GAnF6FLclN01G8NG__Qe-ggodLtAbQSHyVPng,2968
|
20
20
|
rclone_api/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
21
21
|
rclone_api/cmd/list_files.py,sha256=x8FHODEilwKqwdiU1jdkeJbLwOqUkUQuDWPo2u_zpf0,741
|
22
|
-
rclone_api-1.0.
|
23
|
-
rclone_api-1.0.
|
24
|
-
rclone_api-1.0.
|
25
|
-
rclone_api-1.0.
|
26
|
-
rclone_api-1.0.
|
27
|
-
rclone_api-1.0.
|
22
|
+
rclone_api-1.0.49.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
23
|
+
rclone_api-1.0.49.dist-info/METADATA,sha256=5KZV7DH3K6978ZqgXkqEMlde0SbF1keferoXKi7Ywcw,4489
|
24
|
+
rclone_api-1.0.49.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
|
25
|
+
rclone_api-1.0.49.dist-info/entry_points.txt,sha256=XUoTX3m7CWxdj2VAKhEuO0NMOfX2qf-OcEDFwdyk9ZE,72
|
26
|
+
rclone_api-1.0.49.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
|
27
|
+
rclone_api-1.0.49.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|