rclone-api 1.0.19__py2.py3-none-any.whl → 1.0.21__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- rclone_api/process.py +11 -0
- rclone_api/rclone.py +8 -4
- {rclone_api-1.0.19.dist-info → rclone_api-1.0.21.dist-info}/METADATA +1 -1
- {rclone_api-1.0.19.dist-info → rclone_api-1.0.21.dist-info}/RECORD +7 -7
- {rclone_api-1.0.19.dist-info → rclone_api-1.0.21.dist-info}/LICENSE +0 -0
- {rclone_api-1.0.19.dist-info → rclone_api-1.0.21.dist-info}/WHEEL +0 -0
- {rclone_api-1.0.19.dist-info → rclone_api-1.0.21.dist-info}/top_level.txt +0 -0
rclone_api/process.py
CHANGED
@@ -124,3 +124,14 @@ class Process:
|
|
124
124
|
|
125
125
|
def send_signal(self, signal: int) -> None:
|
126
126
|
return self.process.send_signal(signal)
|
127
|
+
|
128
|
+
def __str__(self) -> str:
|
129
|
+
state = ""
|
130
|
+
rtn = self.process.poll()
|
131
|
+
if rtn is None:
|
132
|
+
state = "running"
|
133
|
+
elif rtn != 0:
|
134
|
+
state = f"error: {rtn}"
|
135
|
+
else:
|
136
|
+
state = "finished ok"
|
137
|
+
return f"Process({self.cmd}, {state})"
|
rclone_api/rclone.py
CHANGED
@@ -4,6 +4,7 @@ Unit test file.
|
|
4
4
|
|
5
5
|
import subprocess
|
6
6
|
import time
|
7
|
+
import warnings
|
7
8
|
from concurrent.futures import ThreadPoolExecutor
|
8
9
|
from fnmatch import fnmatch
|
9
10
|
from pathlib import Path
|
@@ -15,7 +16,6 @@ from rclone_api.convert import convert_to_filestr_list, convert_to_str
|
|
15
16
|
from rclone_api.dir_listing import DirListing
|
16
17
|
from rclone_api.exec import RcloneExec
|
17
18
|
from rclone_api.file import File
|
18
|
-
from rclone_api.filelist import FileList
|
19
19
|
from rclone_api.process import Process
|
20
20
|
from rclone_api.remote import Remote
|
21
21
|
from rclone_api.rpath import RPath
|
@@ -174,9 +174,7 @@ class Rclone:
|
|
174
174
|
# self._run(cmd_list)
|
175
175
|
executor.submit(self._run, cmd_list)
|
176
176
|
|
177
|
-
def copy(
|
178
|
-
self, src: Dir | str, dst: Dir | str, filelist: FileList | None = None
|
179
|
-
) -> subprocess.CompletedProcess:
|
177
|
+
def copy(self, src: Dir | str, dst: Dir | str) -> subprocess.CompletedProcess:
|
180
178
|
"""Copy files from source to destination.
|
181
179
|
|
182
180
|
Args:
|
@@ -275,6 +273,12 @@ class Rclone:
|
|
275
273
|
f"Mount directory already exists and is not empty: {outdir}"
|
276
274
|
)
|
277
275
|
outdir.rmdir()
|
276
|
+
try:
|
277
|
+
outdir.parent.mkdir(parents=True, exist_ok=True)
|
278
|
+
except PermissionError:
|
279
|
+
warnings.warn(
|
280
|
+
f"Permission error creating parent directory: {outdir.parent}"
|
281
|
+
)
|
278
282
|
src_str = convert_to_str(src)
|
279
283
|
cmd_list: list[str] = ["mount", src_str, str(outdir)]
|
280
284
|
if not allow_writes:
|
@@ -7,15 +7,15 @@ rclone_api/dir_listing.py,sha256=8t5Jx9ZVOJPqGKTJbWaES6bjgogUT2bnpbPVWwK1Fcs,112
|
|
7
7
|
rclone_api/exec.py,sha256=9qSOpZo8YRYxv3hOvNr57ApnY2KbjxwT1QNr8OgcLM4,883
|
8
8
|
rclone_api/file.py,sha256=D02iHJW1LhfOiM_R_yPHP8_ApnDiYrkuraVcrV8-qkw,1246
|
9
9
|
rclone_api/filelist.py,sha256=xbiusvNgaB_b_kQOZoHMJJxn6TWGtPrWd2J042BI28o,767
|
10
|
-
rclone_api/process.py,sha256=
|
11
|
-
rclone_api/rclone.py,sha256=
|
10
|
+
rclone_api/process.py,sha256=iVA8_qtJFgHtg92Yb4W7xv9jnyds_7kAdKeSiGCBIZ0,3952
|
11
|
+
rclone_api/rclone.py,sha256=MyFpjzC1Dh5TJbuulraXdtVSPAS3zuERrDj5TIdam6o,12887
|
12
12
|
rclone_api/remote.py,sha256=c9hlRKBCg1BFB9MCINaQIoCg10qyAkeqiS4brl8ce-8,343
|
13
13
|
rclone_api/rpath.py,sha256=8ZA_1wxWtskwcy0I8V2VbjKDmzPkiWd8Q2JQSvh-sYE,2586
|
14
14
|
rclone_api/util.py,sha256=BDRJ2MIceDoKVTjUQBwyhjbA8UwPrZ-0ZSa9xyMJd0E,3343
|
15
15
|
rclone_api/walk.py,sha256=kca0t1GAnF6FLclN01G8NG__Qe-ggodLtAbQSHyVPng,2968
|
16
16
|
rclone_api/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
17
|
-
rclone_api-1.0.
|
18
|
-
rclone_api-1.0.
|
19
|
-
rclone_api-1.0.
|
20
|
-
rclone_api-1.0.
|
21
|
-
rclone_api-1.0.
|
17
|
+
rclone_api-1.0.21.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
18
|
+
rclone_api-1.0.21.dist-info/METADATA,sha256=Q7JVaJrhz9EHv7XdQR-VyulReTUJRCajvqsEiQowsw4,4454
|
19
|
+
rclone_api-1.0.21.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
|
20
|
+
rclone_api-1.0.21.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
|
21
|
+
rclone_api-1.0.21.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|