rclone-api 1.0.70__tar.gz → 1.0.73__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. {rclone_api-1.0.70 → rclone_api-1.0.73}/PKG-INFO +1 -1
  2. {rclone_api-1.0.70 → rclone_api-1.0.73}/pyproject.toml +1 -1
  3. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/__init__.py +5 -2
  4. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/dir.py +3 -3
  5. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/rclone.py +13 -14
  6. rclone_api-1.0.70/src/rclone_api/diff_walk.py → rclone_api-1.0.73/src/rclone_api/scan_missing_folders.py +41 -21
  7. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/types.py +6 -0
  8. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/walk.py +16 -10
  9. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api.egg-info/PKG-INFO +1 -1
  10. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api.egg-info/SOURCES.txt +2 -2
  11. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_diff.py +2 -2
  12. rclone_api-1.0.70/tests/test_diff_walk.py → rclone_api-1.0.73/tests/test_scan_missing_folders.py +8 -4
  13. {rclone_api-1.0.70 → rclone_api-1.0.73}/.aiderignore +0 -0
  14. {rclone_api-1.0.70 → rclone_api-1.0.73}/.github/workflows/lint.yml +0 -0
  15. {rclone_api-1.0.70 → rclone_api-1.0.73}/.github/workflows/push_macos.yml +0 -0
  16. {rclone_api-1.0.70 → rclone_api-1.0.73}/.github/workflows/push_ubuntu.yml +0 -0
  17. {rclone_api-1.0.70 → rclone_api-1.0.73}/.github/workflows/push_win.yml +0 -0
  18. {rclone_api-1.0.70 → rclone_api-1.0.73}/.gitignore +0 -0
  19. {rclone_api-1.0.70 → rclone_api-1.0.73}/.pylintrc +0 -0
  20. {rclone_api-1.0.70 → rclone_api-1.0.73}/.vscode/launch.json +0 -0
  21. {rclone_api-1.0.70 → rclone_api-1.0.73}/.vscode/settings.json +0 -0
  22. {rclone_api-1.0.70 → rclone_api-1.0.73}/.vscode/tasks.json +0 -0
  23. {rclone_api-1.0.70 → rclone_api-1.0.73}/LICENSE +0 -0
  24. {rclone_api-1.0.70 → rclone_api-1.0.73}/MANIFEST.in +0 -0
  25. {rclone_api-1.0.70 → rclone_api-1.0.73}/README.md +0 -0
  26. {rclone_api-1.0.70 → rclone_api-1.0.73}/clean +0 -0
  27. {rclone_api-1.0.70 → rclone_api-1.0.73}/install +0 -0
  28. {rclone_api-1.0.70 → rclone_api-1.0.73}/lint +0 -0
  29. {rclone_api-1.0.70 → rclone_api-1.0.73}/requirements.testing.txt +0 -0
  30. {rclone_api-1.0.70 → rclone_api-1.0.73}/setup.cfg +0 -0
  31. {rclone_api-1.0.70 → rclone_api-1.0.73}/setup.py +0 -0
  32. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/assets/example.txt +0 -0
  33. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/cli.py +0 -0
  34. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/cmd/list_files.py +0 -0
  35. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/completed_process.py +0 -0
  36. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/config.py +0 -0
  37. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/convert.py +0 -0
  38. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/deprecated.py +0 -0
  39. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/diff.py +0 -0
  40. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/dir_listing.py +0 -0
  41. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/exec.py +0 -0
  42. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/file.py +0 -0
  43. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/filelist.py +0 -0
  44. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/group_files.py +0 -0
  45. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/process.py +0 -0
  46. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/remote.py +0 -0
  47. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/rpath.py +0 -0
  48. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api/util.py +0 -0
  49. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api.egg-info/dependency_links.txt +0 -0
  50. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api.egg-info/entry_points.txt +0 -0
  51. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api.egg-info/requires.txt +0 -0
  52. {rclone_api-1.0.70 → rclone_api-1.0.73}/src/rclone_api.egg-info/top_level.txt +0 -0
  53. {rclone_api-1.0.70 → rclone_api-1.0.73}/test +0 -0
  54. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_cmd_list_files.py +0 -0
  55. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_copy.py +0 -0
  56. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_copy_files.py +0 -0
  57. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_group_files.py +0 -0
  58. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_is_synced.py +0 -0
  59. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_ls.py +0 -0
  60. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_mount.py +0 -0
  61. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_mount_s3.py +0 -0
  62. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_mount_webdav.py +0 -0
  63. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_obscure.py +0 -0
  64. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_remote_control.py +0 -0
  65. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_remotes.py +0 -0
  66. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_serve_webdav.py +0 -0
  67. {rclone_api-1.0.70 → rclone_api-1.0.73}/tests/test_walk.py +0 -0
  68. {rclone_api-1.0.70 → rclone_api-1.0.73}/tox.ini +0 -0
  69. {rclone_api-1.0.70 → rclone_api-1.0.73}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.0.70
3
+ Version: 1.0.73
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.70"
18
+ version = "1.0.73"
19
19
 
20
20
  [tool.setuptools]
21
21
  package-dir = {"" = "src"}
@@ -1,14 +1,15 @@
1
1
  from .completed_process import CompletedProcess
2
2
  from .config import Config
3
- from .diff import DiffItem, DiffType
3
+ from .diff import DiffItem, DiffOption, DiffType
4
4
  from .dir import Dir
5
5
  from .dir_listing import DirListing
6
6
  from .file import File
7
7
  from .filelist import FileList
8
8
  from .process import Process
9
- from .rclone import DiffOption, ListingOption, Rclone, rclone_verbose
9
+ from .rclone import Rclone, rclone_verbose
10
10
  from .remote import Remote
11
11
  from .rpath import RPath
12
+ from .types import ListingOption, Order
12
13
 
13
14
  __all__ = [
14
15
  "Rclone",
@@ -26,4 +27,6 @@ __all__ = [
26
27
  "CompletedProcess",
27
28
  "DiffOption",
28
29
  "ListingOption",
30
+ "Order",
31
+ "ListingOption",
29
32
  ]
@@ -5,7 +5,7 @@ from typing import Generator
5
5
  from rclone_api.dir_listing import DirListing
6
6
  from rclone_api.remote import Remote
7
7
  from rclone_api.rpath import RPath
8
- from rclone_api.types import ListingOption
8
+ from rclone_api.types import ListingOption, Order
9
9
 
10
10
 
11
11
  class Dir:
@@ -47,7 +47,7 @@ class Dir:
47
47
  self,
48
48
  max_depth: int | None = None,
49
49
  glob: str | None = None,
50
- reverse: bool = False,
50
+ order: Order = Order.NORMAL,
51
51
  listing_option: ListingOption = ListingOption.ALL,
52
52
  ) -> DirListing:
53
53
  """List files and directories in the given path."""
@@ -57,7 +57,7 @@ class Dir:
57
57
  dir,
58
58
  max_depth=max_depth,
59
59
  glob=glob,
60
- reverse=reverse,
60
+ order=order,
61
61
  listing_option=listing_option,
62
62
  )
63
63
 
@@ -3,6 +3,7 @@ Unit test file.
3
3
  """
4
4
 
5
5
  import os
6
+ import random
6
7
  import subprocess
7
8
  import time
8
9
  import warnings
@@ -25,7 +26,7 @@ from rclone_api.group_files import group_files
25
26
  from rclone_api.process import Process
26
27
  from rclone_api.remote import Remote
27
28
  from rclone_api.rpath import RPath
28
- from rclone_api.types import ListingOption, ModTimeStrategy
29
+ from rclone_api.types import ListingOption, ModTimeStrategy, Order
29
30
  from rclone_api.util import (
30
31
  get_check,
31
32
  get_rclone_exe,
@@ -118,7 +119,7 @@ class Rclone:
118
119
  path: Dir | Remote | str,
119
120
  max_depth: int | None = None,
120
121
  glob: str | None = None,
121
- reverse: bool = False,
122
+ order: Order = Order.NORMAL,
122
123
  listing_option: ListingOption = ListingOption.ALL,
123
124
  ) -> DirListing:
124
125
  """List files in the given path.
@@ -164,8 +165,10 @@ class Rclone:
164
165
  if glob is not None:
165
166
  paths = [p for p in paths if fnmatch(p.path, glob)]
166
167
 
167
- if reverse:
168
+ if order == Order.REVERSE:
168
169
  paths.reverse()
170
+ elif order == Order.RANDOM:
171
+ random.shuffle(paths)
169
172
  return DirListing(paths)
170
173
 
171
174
  def listremotes(self) -> list[Remote]:
@@ -242,7 +245,7 @@ class Rclone:
242
245
  path: Dir | Remote | str,
243
246
  max_depth: int = -1,
244
247
  breadth_first: bool = True,
245
- reverse: bool = False,
248
+ order: Order = Order.NORMAL,
246
249
  ) -> Generator[DirListing, None, None]:
247
250
  """Walk through the given path recursively.
248
251
 
@@ -277,15 +280,15 @@ class Rclone:
277
280
  assert f"Invalid type for path: {type(path)}"
278
281
 
279
282
  yield from walk(
280
- dir_obj, max_depth=max_depth, breadth_first=breadth_first, reverse=reverse
283
+ dir_obj, max_depth=max_depth, breadth_first=breadth_first, order=order
281
284
  )
282
285
 
283
- def diff_walk(
286
+ def scan_missing_folders(
284
287
  self,
285
288
  src: Dir | Remote | str,
286
289
  dst: Dir | Remote | str,
287
290
  max_depth: int = -1,
288
- reverse: bool = False,
291
+ order: Order = Order.NORMAL,
289
292
  ) -> Generator[Dir, None, None]:
290
293
  """Walk through the given path recursively.
291
294
 
@@ -299,12 +302,12 @@ class Rclone:
299
302
  Yields:
300
303
  DirListing: Directory listing for each directory encountered
301
304
  """
302
- from rclone_api.diff_walk import diff_walk
305
+ from rclone_api.scan_missing_folders import scan_missing_folders
303
306
 
304
307
  src_dir = Dir(to_path(src, self))
305
308
  dst_dir = Dir(to_path(dst, self))
306
- yield from diff_walk(
307
- src=src_dir, dst=dst_dir, max_depth=max_depth, reverse=reverse
309
+ yield from scan_missing_folders(
310
+ src=src_dir, dst=dst_dir, max_depth=max_depth, order=order
308
311
  )
309
312
 
310
313
  def cleanup(
@@ -426,10 +429,6 @@ class Rclone:
426
429
  chunk = files_fqdn[i : i + chunk_size]
427
430
  files_str = "\n".join(chunk)
428
431
  print(f"{files_str}")
429
- # files_str = "\n".join(files_fqdn)
430
- # print(f"Copying {nfiles} files: \n{files_str}")
431
-
432
- # print(include_files_txt)
433
432
  cmd_list: list[str] = [
434
433
  "copy",
435
434
  src_path,
@@ -1,3 +1,4 @@
1
+ import random
1
2
  import time
2
3
  from concurrent.futures import ThreadPoolExecutor
3
4
  from queue import Empty, Queue
@@ -6,7 +7,7 @@ from typing import Generator
6
7
 
7
8
  from rclone_api import Dir
8
9
  from rclone_api.dir_listing import DirListing
9
- from rclone_api.types import ListingOption
10
+ from rclone_api.types import ListingOption, Order
10
11
  from rclone_api.walk import walk_runner_depth_first
11
12
 
12
13
  _MAX_OUT_QUEUE_SIZE = 50
@@ -14,34 +15,45 @@ _MAX_OUT_QUEUE_SIZE = 50
14
15
 
15
16
  # ONLY Works from src -> dst diffing.
16
17
  def _async_diff_dir_walk_task(
17
- src: Dir, dst: Dir, max_depth: int, out_queue: Queue[Dir | None], reverse
18
+ src: Dir, dst: Dir, max_depth: int, out_queue: Queue[Dir | None], order: Order
18
19
  ) -> None:
19
20
  curr_src, curr_dst = src, dst
21
+ can_scan_two_deep = max_depth > 1 or max_depth == -1
22
+ ls_depth = 2 if can_scan_two_deep else 1
20
23
  with ThreadPoolExecutor(max_workers=2) as executor:
21
- # src_dir_listing = src.ls(listing_option=ListingOption.DIRS_ONLY)
22
- # dst_dir_listing = dst.ls(listing_option=ListingOption.DIRS_ONLY)
23
24
  t1 = executor.submit(
24
- src.ls, listing_option=ListingOption.DIRS_ONLY, reverse=reverse
25
+ src.ls,
26
+ listing_option=ListingOption.DIRS_ONLY,
27
+ order=order,
28
+ max_depth=ls_depth,
25
29
  )
26
30
  t2 = executor.submit(
27
- dst.ls, listing_option=ListingOption.DIRS_ONLY, reverse=reverse
31
+ dst.ls,
32
+ listing_option=ListingOption.DIRS_ONLY,
33
+ order=order,
34
+ max_depth=ls_depth,
28
35
  )
29
36
  src_dir_listing: DirListing = t1.result()
30
37
  dst_dir_listing: DirListing = t2.result()
31
38
  next_depth = max_depth - 1 if max_depth > 0 else max_depth
32
- dst_files: list[str] = [d.name for d in dst_dir_listing.dirs]
33
- src_files: list[str] = [d.name for d in src_dir_listing.dirs]
34
- dst_files_set: set[str] = set(dst_files)
39
+ dst_dirs: list[str] = [d.name for d in dst_dir_listing.dirs]
40
+ src_dirs: list[str] = [d.name for d in src_dir_listing.dirs]
41
+ dst_files_set: set[str] = set(dst_dirs)
35
42
  matching_dirs: list[str] = []
36
- for file in src_files:
43
+ if order == Order.REVERSE:
44
+ src_dirs.reverse()
45
+ dst_dirs.reverse()
46
+ elif order == Order.RANDOM:
47
+ random.shuffle(src_dirs)
48
+ random.shuffle(dst_dirs)
49
+ for file in src_dirs:
37
50
  if file not in dst_files_set:
38
- # print(f"missing dir on src: {file}")
39
51
  queue_dir_listing: Queue[DirListing | None] = Queue()
40
52
  if next_depth > 0 or next_depth == -1:
41
53
  walk_runner_depth_first(
42
54
  dir=curr_src,
43
55
  out_queue=queue_dir_listing,
44
- reverse=reverse,
56
+ order=order,
45
57
  max_depth=next_depth,
46
58
  )
47
59
  while dirlisting := queue_dir_listing.get():
@@ -63,15 +75,17 @@ def _async_diff_dir_walk_task(
63
75
  dst=dst_next,
64
76
  max_depth=next_depth,
65
77
  out_queue=out_queue,
66
- reverse=reverse,
78
+ order=order,
67
79
  )
68
80
 
69
81
 
70
82
  def async_diff_dir_walk_task(
71
- src: Dir, dst: Dir, max_depth: int, out_queue: Queue[Dir | None], reverse=False
83
+ src: Dir, dst: Dir, max_depth: int, out_queue: Queue[Dir | None], order: Order
72
84
  ) -> None:
73
85
  try:
74
- _async_diff_dir_walk_task(src, dst, max_depth, out_queue, reverse)
86
+ _async_diff_dir_walk_task(
87
+ src=src, dst=dst, max_depth=max_depth, out_queue=out_queue, order=order
88
+ )
75
89
  except Exception:
76
90
  import _thread
77
91
 
@@ -81,11 +95,11 @@ def async_diff_dir_walk_task(
81
95
  out_queue.put(None)
82
96
 
83
97
 
84
- def diff_walk(
98
+ def scan_missing_folders(
85
99
  src: Dir,
86
100
  dst: Dir,
87
101
  max_depth: int = -1,
88
- reverse: bool = False,
102
+ order: Order = Order.NORMAL,
89
103
  ) -> Generator[Dir, None, None]:
90
104
  """Walk through the given directory recursively.
91
105
 
@@ -101,7 +115,13 @@ def diff_walk(
101
115
  out_queue: Queue[Dir | None] = Queue(maxsize=_MAX_OUT_QUEUE_SIZE)
102
116
 
103
117
  def task() -> None:
104
- async_diff_dir_walk_task(src, dst, max_depth, out_queue, reverse=reverse)
118
+ async_diff_dir_walk_task(
119
+ src=src,
120
+ dst=dst,
121
+ max_depth=max_depth,
122
+ out_queue=out_queue,
123
+ order=order,
124
+ )
105
125
 
106
126
  worker = Thread(
107
127
  target=task,
@@ -111,10 +131,10 @@ def diff_walk(
111
131
 
112
132
  while True:
113
133
  try:
114
- dirlisting = out_queue.get_nowait()
115
- if dirlisting is None:
134
+ dir = out_queue.get_nowait()
135
+ if dir is None:
116
136
  break
117
- yield dirlisting
137
+ yield dir
118
138
  except Empty:
119
139
  time.sleep(0.1)
120
140
 
@@ -10,3 +10,9 @@ class ListingOption(Enum):
10
10
  DIRS_ONLY = "dirs-only"
11
11
  FILES_ONLY = "files-only"
12
12
  ALL = "all"
13
+
14
+
15
+ class Order(Enum):
16
+ NORMAL = "normal"
17
+ REVERSE = "reverse"
18
+ RANDOM = "random"
@@ -1,3 +1,4 @@
1
+ import random
1
2
  from queue import Queue
2
3
  from threading import Thread
3
4
  from typing import Generator
@@ -5,6 +6,7 @@ from typing import Generator
5
6
  from rclone_api import Dir
6
7
  from rclone_api.dir_listing import DirListing
7
8
  from rclone_api.remote import Remote
9
+ from rclone_api.types import Order
8
10
 
9
11
  _MAX_OUT_QUEUE_SIZE = 50
10
12
 
@@ -13,14 +15,14 @@ def walk_runner_breadth_first(
13
15
  dir: Dir,
14
16
  max_depth: int,
15
17
  out_queue: Queue[DirListing | None],
16
- reverse: bool = False,
18
+ order: Order = Order.NORMAL,
17
19
  ) -> None:
18
20
  queue: Queue[Dir] = Queue()
19
21
  queue.put(dir)
20
22
  try:
21
23
  while not queue.empty():
22
24
  current_dir = queue.get()
23
- dirlisting = current_dir.ls(max_depth=0, reverse=reverse)
25
+ dirlisting = current_dir.ls(max_depth=0, order=order)
24
26
  out_queue.put(dirlisting)
25
27
  dirs = dirlisting.dirs
26
28
 
@@ -41,22 +43,26 @@ def walk_runner_breadth_first(
41
43
 
42
44
 
43
45
  def walk_runner_depth_first(
44
- dir: Dir, max_depth: int, out_queue: Queue[DirListing | None], reverse=False
46
+ dir: Dir,
47
+ max_depth: int,
48
+ out_queue: Queue[DirListing | None],
49
+ order: Order = Order.NORMAL,
45
50
  ) -> None:
46
51
  try:
47
52
  stack = [(dir, max_depth)]
48
53
  while stack:
49
54
  current_dir, depth = stack.pop()
50
55
  dirlisting = current_dir.ls()
51
- if reverse:
56
+ if order == Order.REVERSE:
52
57
  dirlisting.dirs.reverse()
58
+ if order == Order.RANDOM:
59
+
60
+ random.shuffle(dirlisting.dirs)
53
61
  if depth != 0:
54
62
  for subdir in dirlisting.dirs: # Process deeper directories first
55
63
  # stack.append((child, depth - 1 if depth > 0 else depth))
56
64
  next_depth = depth - 1 if depth > 0 else depth
57
- walk_runner_depth_first(
58
- subdir, next_depth, out_queue, reverse=reverse
59
- )
65
+ walk_runner_depth_first(subdir, next_depth, out_queue, order=order)
60
66
  out_queue.put(dirlisting)
61
67
  out_queue.put(None)
62
68
  except KeyboardInterrupt:
@@ -70,7 +76,7 @@ def walk(
70
76
  dir: Dir | Remote,
71
77
  breadth_first: bool,
72
78
  max_depth: int = -1,
73
- reverse: bool = False,
79
+ order: Order = Order.NORMAL,
74
80
  ) -> Generator[DirListing, None, None]:
75
81
  """Walk through the given directory recursively.
76
82
 
@@ -89,9 +95,9 @@ def walk(
89
95
 
90
96
  def _task() -> None:
91
97
  if breadth_first:
92
- walk_runner_breadth_first(dir, max_depth, out_queue, reverse)
98
+ walk_runner_breadth_first(dir, max_depth, out_queue, order)
93
99
  else:
94
- walk_runner_depth_first(dir, max_depth, out_queue, reverse)
100
+ walk_runner_depth_first(dir, max_depth, out_queue, order)
95
101
 
96
102
  # Start worker thread
97
103
  worker = Thread(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.0.70
3
+ Version: 1.0.73
4
4
  Summary: rclone api in python
5
5
  Home-page: https://github.com/zackees/rclone-api
6
6
  Maintainer: Zachary Vorhies
@@ -27,7 +27,6 @@ src/rclone_api/config.py
27
27
  src/rclone_api/convert.py
28
28
  src/rclone_api/deprecated.py
29
29
  src/rclone_api/diff.py
30
- src/rclone_api/diff_walk.py
31
30
  src/rclone_api/dir.py
32
31
  src/rclone_api/dir_listing.py
33
32
  src/rclone_api/exec.py
@@ -38,6 +37,7 @@ src/rclone_api/process.py
38
37
  src/rclone_api/rclone.py
39
38
  src/rclone_api/remote.py
40
39
  src/rclone_api/rpath.py
40
+ src/rclone_api/scan_missing_folders.py
41
41
  src/rclone_api/types.py
42
42
  src/rclone_api/util.py
43
43
  src/rclone_api/walk.py
@@ -53,7 +53,6 @@ tests/test_cmd_list_files.py
53
53
  tests/test_copy.py
54
54
  tests/test_copy_files.py
55
55
  tests/test_diff.py
56
- tests/test_diff_walk.py
57
56
  tests/test_group_files.py
58
57
  tests/test_is_synced.py
59
58
  tests/test_ls.py
@@ -63,5 +62,6 @@ tests/test_mount_webdav.py
63
62
  tests/test_obscure.py
64
63
  tests/test_remote_control.py
65
64
  tests/test_remotes.py
65
+ tests/test_scan_missing_folders.py
66
66
  tests/test_serve_webdav.py
67
67
  tests/test_walk.py
@@ -7,8 +7,8 @@ import unittest
7
7
 
8
8
  from dotenv import load_dotenv
9
9
 
10
- from rclone_api import Config, DiffOption, Rclone
11
- from rclone_api.diff import DiffItem, DiffType
10
+ from rclone_api import Config, Rclone
11
+ from rclone_api.diff import DiffItem, DiffOption, DiffType
12
12
 
13
13
  load_dotenv()
14
14
 
@@ -8,6 +8,7 @@ import unittest
8
8
  from dotenv import load_dotenv
9
9
 
10
10
  from rclone_api import Config, Dir, Rclone
11
+ from rclone_api.types import Order
11
12
 
12
13
  load_dotenv()
13
14
 
@@ -37,7 +38,7 @@ endpoint = {BUCKET_URL}
37
38
  return out
38
39
 
39
40
 
40
- class RcloneDiffTests(unittest.TestCase):
41
+ class RcloneScanMissingFoldersTests(unittest.TestCase):
41
42
  """Test rclone functionality."""
42
43
 
43
44
  def setUp(self) -> None:
@@ -55,13 +56,16 @@ class RcloneDiffTests(unittest.TestCase):
55
56
  )
56
57
  os.environ["RCLONE_API_VERBOSE"] = "1"
57
58
 
58
- def test_diff_walk(self) -> None:
59
+ def test_scan_missing_folders(self) -> None:
59
60
  """Test copying a single file to remote storage."""
60
61
  rclone = Rclone(_generate_rclone_config())
61
62
  item: Dir
62
63
  all: list[Dir] = []
63
- for item in rclone.diff_walk(
64
- "dst:rclone-api-unit-test", "dst:rclone-api-unit-test"
64
+ for item in rclone.scan_missing_folders(
65
+ src="dst:rclone-api-unit-test",
66
+ dst="dst:rclone-api-unit-test",
67
+ max_depth=-1,
68
+ order=Order.NORMAL,
65
69
  ):
66
70
  all.append(item)
67
71
  self.assertEqual(len(all), 0)
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