rclone-api 1.0.38__py2.py3-none-any.whl → 1.0.40__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- rclone_api/completed_process.py +6 -0
- rclone_api/rclone.py +9 -1
- rclone_api/util.py +6 -9
- {rclone_api-1.0.38.dist-info → rclone_api-1.0.40.dist-info}/METADATA +1 -1
- {rclone_api-1.0.38.dist-info → rclone_api-1.0.40.dist-info}/RECORD +9 -9
- {rclone_api-1.0.38.dist-info → rclone_api-1.0.40.dist-info}/LICENSE +0 -0
- {rclone_api-1.0.38.dist-info → rclone_api-1.0.40.dist-info}/WHEEL +0 -0
- {rclone_api-1.0.38.dist-info → rclone_api-1.0.40.dist-info}/entry_points.txt +0 -0
- {rclone_api-1.0.38.dist-info → rclone_api-1.0.40.dist-info}/top_level.txt +0 -0
rclone_api/completed_process.py
CHANGED
@@ -13,3 +13,9 @@ class CompletedProcess:
|
|
13
13
|
@staticmethod
|
14
14
|
def from_subprocess(process: subprocess.CompletedProcess) -> "CompletedProcess":
|
15
15
|
return CompletedProcess(completed=[process])
|
16
|
+
|
17
|
+
def failed(self) -> list[subprocess.CompletedProcess]:
|
18
|
+
return [p for p in self.completed if p.returncode != 0]
|
19
|
+
|
20
|
+
def successes(self) -> list[subprocess.CompletedProcess]:
|
21
|
+
return [p for p in self.completed if p.returncode == 0]
|
rclone_api/rclone.py
CHANGED
@@ -259,7 +259,11 @@ class Rclone:
|
|
259
259
|
return CompletedProcess.from_subprocess(cp)
|
260
260
|
|
261
261
|
def delete_files(
|
262
|
-
self,
|
262
|
+
self,
|
263
|
+
files: str | File | list[str] | list[File],
|
264
|
+
check=True,
|
265
|
+
rmdirs=False,
|
266
|
+
other_args: list[str] | None = None,
|
263
267
|
) -> CompletedProcess:
|
264
268
|
"""Delete a directory"""
|
265
269
|
payload: list[str] = convert_to_filestr_list(files)
|
@@ -293,6 +297,10 @@ class Rclone:
|
|
293
297
|
"--transfers",
|
294
298
|
"1000",
|
295
299
|
]
|
300
|
+
if rmdirs:
|
301
|
+
cmd_list.append("--rmdirs")
|
302
|
+
if other_args:
|
303
|
+
cmd_list += other_args
|
296
304
|
out = self._run(cmd_list)
|
297
305
|
completed_processes.append(out)
|
298
306
|
if out.returncode != 0:
|
rclone_api/util.py
CHANGED
@@ -132,15 +132,12 @@ def wait_for_mount(path: Path, mount_process: Any, timeout: int = 60) -> None:
|
|
132
132
|
|
133
133
|
|
134
134
|
def partition_files(files: list[str]) -> dict[str, list[str]]:
|
135
|
+
"""split between filename and parent directory path"""
|
135
136
|
datalists: dict[str, list[str]] = {}
|
136
137
|
for f in files:
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
remote = f"{remote}:"
|
143
|
-
if remote not in datalists:
|
144
|
-
datalists[remote] = []
|
145
|
-
datalists[remote].append(path)
|
138
|
+
base = os.path.basename(f)
|
139
|
+
parent_path = os.path.dirname(f)
|
140
|
+
if parent_path not in datalists:
|
141
|
+
datalists[parent_path] = []
|
142
|
+
datalists[parent_path].append(base)
|
146
143
|
return datalists
|
@@ -1,6 +1,6 @@
|
|
1
1
|
rclone_api/__init__.py,sha256=L_ulzYG9WmQqmrVANt-Omi1FJUQVTkXA7SVZx9QH_9M,457
|
2
2
|
rclone_api/cli.py,sha256=dibfAZIh0kXWsBbfp3onKLjyZXo54mTzDjUdzJlDlWo,231
|
3
|
-
rclone_api/completed_process.py,sha256=
|
3
|
+
rclone_api/completed_process.py,sha256=s0flUibhTWU2d-KgVnZ62VGFS3HlICJrtPr8YJCdk3A,651
|
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
|
@@ -11,16 +11,16 @@ rclone_api/exec.py,sha256=HWmnU2Jwb-3EttSbAJSaLloYA7YI2mHTzRJ5VEri9aM,941
|
|
11
11
|
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/process.py,sha256=RrMfTe0bndmJ6gBK67ioqNvCstJ8aTC8RlGX1XBLlcw,4191
|
14
|
-
rclone_api/rclone.py,sha256=
|
14
|
+
rclone_api/rclone.py,sha256=dU2MEiMXC6l_QrvnWkSFpJ0sC7xyyNXCIlhEAzw2puA,19909
|
15
15
|
rclone_api/remote.py,sha256=c9hlRKBCg1BFB9MCINaQIoCg10qyAkeqiS4brl8ce-8,343
|
16
16
|
rclone_api/rpath.py,sha256=8ZA_1wxWtskwcy0I8V2VbjKDmzPkiWd8Q2JQSvh-sYE,2586
|
17
|
-
rclone_api/util.py,sha256=
|
17
|
+
rclone_api/util.py,sha256=yUN7afH4PuuUNcrXwdtyDTIluvkNOw-c5v5VPKDXoBM,4325
|
18
18
|
rclone_api/walk.py,sha256=kca0t1GAnF6FLclN01G8NG__Qe-ggodLtAbQSHyVPng,2968
|
19
19
|
rclone_api/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
20
20
|
rclone_api/cmd/list_files.py,sha256=x8FHODEilwKqwdiU1jdkeJbLwOqUkUQuDWPo2u_zpf0,741
|
21
|
-
rclone_api-1.0.
|
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.
|
21
|
+
rclone_api-1.0.40.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
22
|
+
rclone_api-1.0.40.dist-info/METADATA,sha256=E5JPNd4jSud_1zO4llJkI2X9uO_HpoqMnKCk-fRqBGc,4489
|
23
|
+
rclone_api-1.0.40.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
|
24
|
+
rclone_api-1.0.40.dist-info/entry_points.txt,sha256=XUoTX3m7CWxdj2VAKhEuO0NMOfX2qf-OcEDFwdyk9ZE,72
|
25
|
+
rclone_api-1.0.40.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
|
26
|
+
rclone_api-1.0.40.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|