rclone-api 1.0.20__tar.gz → 1.0.22__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {rclone_api-1.0.20 → rclone_api-1.0.22}/PKG-INFO +1 -1
- {rclone_api-1.0.20 → rclone_api-1.0.22}/pyproject.toml +1 -1
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/process.py +11 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/rclone.py +3 -8
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/util.py +15 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api.egg-info/PKG-INFO +1 -1
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.aiderignore +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.github/workflows/lint.yml +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.github/workflows/push_macos.yml +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.github/workflows/push_ubuntu.yml +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.github/workflows/push_win.yml +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.gitignore +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.pylintrc +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.vscode/launch.json +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.vscode/settings.json +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/.vscode/tasks.json +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/LICENSE +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/MANIFEST.in +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/README.md +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/clean +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/install +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/lint +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/requirements.testing.txt +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/setup.cfg +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/setup.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/__init__.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/assets/example.txt +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/cli.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/config.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/convert.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/dir.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/dir_listing.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/exec.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/file.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/filelist.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/remote.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/rpath.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api/walk.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api.egg-info/SOURCES.txt +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api.egg-info/dependency_links.txt +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api.egg-info/requires.txt +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/src/rclone_api.egg-info/top_level.txt +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/test +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_copy.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_is_synced.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_ls.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_mount.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_mount_webdav.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_obscure.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_remotes.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_serve_webdav.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tests/test_walk.py +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/tox.ini +0 -0
- {rclone_api-1.0.20 → rclone_api-1.0.22}/upload_package.sh +0 -0
@@ -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})"
|
@@ -19,7 +19,7 @@ from rclone_api.file import File
|
|
19
19
|
from rclone_api.process import Process
|
20
20
|
from rclone_api.remote import Remote
|
21
21
|
from rclone_api.rpath import RPath
|
22
|
-
from rclone_api.util import get_rclone_exe, to_path
|
22
|
+
from rclone_api.util import get_rclone_exe, to_path, wait_for_mount
|
23
23
|
from rclone_api.walk import walk
|
24
24
|
|
25
25
|
|
@@ -291,9 +291,7 @@ class Rclone:
|
|
291
291
|
if other_cmds:
|
292
292
|
cmd_list += other_cmds
|
293
293
|
proc = self._launch_process(cmd_list)
|
294
|
-
|
295
|
-
if proc.poll() is not None:
|
296
|
-
raise ValueError("Mount process failed to start")
|
294
|
+
wait_for_mount(outdir, proc)
|
297
295
|
return proc
|
298
296
|
|
299
297
|
def mount_webdav(
|
@@ -330,10 +328,7 @@ class Rclone:
|
|
330
328
|
if other_cmds:
|
331
329
|
cmd_list += other_cmds
|
332
330
|
proc = self._launch_process(cmd_list)
|
333
|
-
|
334
|
-
time.sleep(2)
|
335
|
-
if proc.poll() is not None:
|
336
|
-
raise ValueError("Mount process failed to start")
|
331
|
+
wait_for_mount(outdir, proc)
|
337
332
|
return proc
|
338
333
|
|
339
334
|
def serve_webdav(
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
import shutil
|
3
3
|
import subprocess
|
4
|
+
import time
|
4
5
|
from pathlib import Path
|
5
6
|
from tempfile import TemporaryDirectory
|
6
7
|
from typing import Any
|
@@ -112,3 +113,17 @@ def rclone_execute(
|
|
112
113
|
tempdir.cleanup()
|
113
114
|
except Exception as e:
|
114
115
|
print(f"Error cleaning up tempdir: {e}")
|
116
|
+
|
117
|
+
|
118
|
+
def wait_for_mount(path: Path, mount_process: Any, timeout: int = 60) -> None:
|
119
|
+
from rclone_api.process import Process
|
120
|
+
|
121
|
+
assert isinstance(mount_process, Process)
|
122
|
+
expire_time = time.time() + timeout
|
123
|
+
while time.time() < expire_time:
|
124
|
+
rtn = mount_process.poll()
|
125
|
+
if rtn is not None:
|
126
|
+
raise subprocess.CalledProcessError(rtn, mount_process.cmd)
|
127
|
+
if path.exists():
|
128
|
+
return
|
129
|
+
raise TimeoutError(f"Path {path} did not exist after {timeout} seconds")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|