rclone-api 1.0.21__tar.gz → 1.0.22__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. {rclone_api-1.0.21 → rclone_api-1.0.22}/PKG-INFO +1 -1
  2. {rclone_api-1.0.21 → rclone_api-1.0.22}/pyproject.toml +1 -1
  3. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/rclone.py +3 -8
  4. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/util.py +15 -0
  5. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api.egg-info/PKG-INFO +1 -1
  6. {rclone_api-1.0.21 → rclone_api-1.0.22}/.aiderignore +0 -0
  7. {rclone_api-1.0.21 → rclone_api-1.0.22}/.github/workflows/lint.yml +0 -0
  8. {rclone_api-1.0.21 → rclone_api-1.0.22}/.github/workflows/push_macos.yml +0 -0
  9. {rclone_api-1.0.21 → rclone_api-1.0.22}/.github/workflows/push_ubuntu.yml +0 -0
  10. {rclone_api-1.0.21 → rclone_api-1.0.22}/.github/workflows/push_win.yml +0 -0
  11. {rclone_api-1.0.21 → rclone_api-1.0.22}/.gitignore +0 -0
  12. {rclone_api-1.0.21 → rclone_api-1.0.22}/.pylintrc +0 -0
  13. {rclone_api-1.0.21 → rclone_api-1.0.22}/.vscode/launch.json +0 -0
  14. {rclone_api-1.0.21 → rclone_api-1.0.22}/.vscode/settings.json +0 -0
  15. {rclone_api-1.0.21 → rclone_api-1.0.22}/.vscode/tasks.json +0 -0
  16. {rclone_api-1.0.21 → rclone_api-1.0.22}/LICENSE +0 -0
  17. {rclone_api-1.0.21 → rclone_api-1.0.22}/MANIFEST.in +0 -0
  18. {rclone_api-1.0.21 → rclone_api-1.0.22}/README.md +0 -0
  19. {rclone_api-1.0.21 → rclone_api-1.0.22}/clean +0 -0
  20. {rclone_api-1.0.21 → rclone_api-1.0.22}/install +0 -0
  21. {rclone_api-1.0.21 → rclone_api-1.0.22}/lint +0 -0
  22. {rclone_api-1.0.21 → rclone_api-1.0.22}/requirements.testing.txt +0 -0
  23. {rclone_api-1.0.21 → rclone_api-1.0.22}/setup.cfg +0 -0
  24. {rclone_api-1.0.21 → rclone_api-1.0.22}/setup.py +0 -0
  25. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/__init__.py +0 -0
  26. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/assets/example.txt +0 -0
  27. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/cli.py +0 -0
  28. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/config.py +0 -0
  29. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/convert.py +0 -0
  30. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/dir.py +0 -0
  31. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/dir_listing.py +0 -0
  32. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/exec.py +0 -0
  33. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/file.py +0 -0
  34. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/filelist.py +0 -0
  35. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/process.py +0 -0
  36. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/remote.py +0 -0
  37. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/rpath.py +0 -0
  38. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api/walk.py +0 -0
  39. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api.egg-info/SOURCES.txt +0 -0
  40. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api.egg-info/dependency_links.txt +0 -0
  41. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api.egg-info/requires.txt +0 -0
  42. {rclone_api-1.0.21 → rclone_api-1.0.22}/src/rclone_api.egg-info/top_level.txt +0 -0
  43. {rclone_api-1.0.21 → rclone_api-1.0.22}/test +0 -0
  44. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_copy.py +0 -0
  45. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_is_synced.py +0 -0
  46. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_ls.py +0 -0
  47. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_mount.py +0 -0
  48. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_mount_webdav.py +0 -0
  49. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_obscure.py +0 -0
  50. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_remotes.py +0 -0
  51. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_serve_webdav.py +0 -0
  52. {rclone_api-1.0.21 → rclone_api-1.0.22}/tests/test_walk.py +0 -0
  53. {rclone_api-1.0.21 → rclone_api-1.0.22}/tox.ini +0 -0
  54. {rclone_api-1.0.21 → rclone_api-1.0.22}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.0.21
3
+ Version: 1.0.22
4
4
  Summary: rclone api in python
5
5
  Home-page: https://github.com/zackees/rclone-api
6
6
  Maintainer: Zachary Vorhies
@@ -15,7 +15,7 @@ dependencies = [
15
15
  "python-dotenv>=1.0.0",
16
16
  ]
17
17
  # Change this with the version number bump.
18
- version = "1.0.21"
18
+ version = "1.0.22"
19
19
 
20
20
  [tool.setuptools]
21
21
  package-dir = {"" = "src"}
@@ -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
- time.sleep(2) # give it a moment to mount
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
- # proc = rclone_exec.launch_process(cmd_list)
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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.0.21
3
+ Version: 1.0.22
4
4
  Summary: rclone api in python
5
5
  Home-page: https://github.com/zackees/rclone-api
6
6
  Maintainer: Zachary Vorhies
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