rclone-api 1.0.42__tar.gz → 1.0.43__tar.gz

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rclone-api might be problematic. Click here for more details.

Files changed (64) hide show
  1. {rclone_api-1.0.42 → rclone_api-1.0.43}/PKG-INFO +1 -1
  2. {rclone_api-1.0.42 → rclone_api-1.0.43}/pyproject.toml +1 -1
  3. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/group_files.py +24 -22
  4. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api.egg-info/PKG-INFO +1 -1
  5. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_group_files.py +20 -0
  6. {rclone_api-1.0.42 → rclone_api-1.0.43}/.aiderignore +0 -0
  7. {rclone_api-1.0.42 → rclone_api-1.0.43}/.github/workflows/lint.yml +0 -0
  8. {rclone_api-1.0.42 → rclone_api-1.0.43}/.github/workflows/push_macos.yml +0 -0
  9. {rclone_api-1.0.42 → rclone_api-1.0.43}/.github/workflows/push_ubuntu.yml +0 -0
  10. {rclone_api-1.0.42 → rclone_api-1.0.43}/.github/workflows/push_win.yml +0 -0
  11. {rclone_api-1.0.42 → rclone_api-1.0.43}/.gitignore +0 -0
  12. {rclone_api-1.0.42 → rclone_api-1.0.43}/.pylintrc +0 -0
  13. {rclone_api-1.0.42 → rclone_api-1.0.43}/.vscode/launch.json +0 -0
  14. {rclone_api-1.0.42 → rclone_api-1.0.43}/.vscode/settings.json +0 -0
  15. {rclone_api-1.0.42 → rclone_api-1.0.43}/.vscode/tasks.json +0 -0
  16. {rclone_api-1.0.42 → rclone_api-1.0.43}/LICENSE +0 -0
  17. {rclone_api-1.0.42 → rclone_api-1.0.43}/MANIFEST.in +0 -0
  18. {rclone_api-1.0.42 → rclone_api-1.0.43}/README.md +0 -0
  19. {rclone_api-1.0.42 → rclone_api-1.0.43}/clean +0 -0
  20. {rclone_api-1.0.42 → rclone_api-1.0.43}/install +0 -0
  21. {rclone_api-1.0.42 → rclone_api-1.0.43}/lint +0 -0
  22. {rclone_api-1.0.42 → rclone_api-1.0.43}/requirements.testing.txt +0 -0
  23. {rclone_api-1.0.42 → rclone_api-1.0.43}/setup.cfg +0 -0
  24. {rclone_api-1.0.42 → rclone_api-1.0.43}/setup.py +0 -0
  25. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/__init__.py +0 -0
  26. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/assets/example.txt +0 -0
  27. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/cli.py +0 -0
  28. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/cmd/list_files.py +0 -0
  29. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/completed_process.py +0 -0
  30. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/config.py +0 -0
  31. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/convert.py +0 -0
  32. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/deprecated.py +0 -0
  33. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/diff.py +0 -0
  34. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/dir.py +0 -0
  35. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/dir_listing.py +0 -0
  36. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/exec.py +0 -0
  37. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/file.py +0 -0
  38. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/filelist.py +0 -0
  39. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/process.py +0 -0
  40. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/rclone.py +0 -0
  41. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/remote.py +0 -0
  42. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/rpath.py +0 -0
  43. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/util.py +0 -0
  44. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api/walk.py +0 -0
  45. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api.egg-info/SOURCES.txt +0 -0
  46. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api.egg-info/dependency_links.txt +0 -0
  47. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api.egg-info/entry_points.txt +0 -0
  48. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api.egg-info/requires.txt +0 -0
  49. {rclone_api-1.0.42 → rclone_api-1.0.43}/src/rclone_api.egg-info/top_level.txt +0 -0
  50. {rclone_api-1.0.42 → rclone_api-1.0.43}/test +0 -0
  51. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_cmd_list_files.py +0 -0
  52. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_copy.py +0 -0
  53. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_diff.py +0 -0
  54. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_is_synced.py +0 -0
  55. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_ls.py +0 -0
  56. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_mount.py +0 -0
  57. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_mount_s3.py +0 -0
  58. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_mount_webdav.py +0 -0
  59. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_obscure.py +0 -0
  60. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_remotes.py +0 -0
  61. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_serve_webdav.py +0 -0
  62. {rclone_api-1.0.42 → rclone_api-1.0.43}/tests/test_walk.py +0 -0
  63. {rclone_api-1.0.42 → rclone_api-1.0.43}/tox.ini +0 -0
  64. {rclone_api-1.0.42 → rclone_api-1.0.43}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.0.42
3
+ Version: 1.0.43
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.42"
18
+ version = "1.0.43"
19
19
 
20
20
  [tool.setuptools]
21
21
  package-dir = {"" = "src"}
@@ -80,14 +80,10 @@ class TreeNode:
80
80
 
81
81
  def _merge(node: TreeNode, parent_path: str, out: dict[str, list[str]]) -> None:
82
82
  parent_path = parent_path + "/" + node.name
83
- this_count = node.count
84
- child_count = 0
85
- children_has_files = False
86
83
  if not node.child_nodes and not node.files:
87
84
  return # done
88
-
89
85
  if node.files:
90
- children_has_files = True
86
+ # we saw files, to don't try to go any deeper.
91
87
  filelist = out.setdefault(parent_path, [])
92
88
  # for file in node.files:
93
89
  # filelist.append(file)
@@ -98,28 +94,28 @@ def _merge(node: TreeNode, parent_path: str, out: dict[str, list[str]]) -> None:
98
94
  out[parent_path] = filelist
99
95
  return
100
96
 
101
- for child in node.child_nodes.values():
102
- child_count += child.count
103
- child_count += len(node.files)
104
- for file in node.files:
105
- child_count += 1
97
+ n_child_nodes = len(node.child_nodes)
106
98
 
107
- if child_count != this_count or children_has_files:
108
- # print(
109
- # f"Cannot merge {node.name} because different counts or has children with files"
110
- # )
111
- filelist = out.setdefault(parent_path, [])
112
- for child in node.child_nodes.values():
113
- subpaths = child.get_child_subpaths()
114
- filelist.extend(subpaths)
115
- out[parent_path] = filelist
116
- else:
99
+ if n_child_nodes < 4:
100
+ # child = list(node.child_nodes.values())[0]
101
+ # _merge(child, parent_path, out)
102
+ # return
117
103
  for child in node.child_nodes.values():
118
104
  _merge(child, parent_path, out)
105
+ return
119
106
 
107
+ filelist = out.setdefault(parent_path, [])
108
+ # for file in node.files:
109
+ # filelist.append(file)
110
+ # out[parent_path] = filelist
111
+ paths = node.get_child_subpaths()
112
+ for path in paths:
113
+ filelist.append(path)
114
+ out[parent_path] = filelist
115
+ return
120
116
 
121
- def group_files(files: list[str]) -> dict[str, list[str]]:
122
- """split between filename and parent directory path"""
117
+
118
+ def _make_tree(files: list[str]) -> dict[str, TreeNode]:
123
119
  tree: dict[str, TreeNode] = {}
124
120
  for file in files:
125
121
  parts = parse_file(file)
@@ -131,6 +127,12 @@ def group_files(files: list[str]) -> dict[str, list[str]]:
131
127
  if is_last:
132
128
  node.files.append(parts.name)
133
129
  node.add_count()
130
+ return tree
131
+
132
+
133
+ def group_files(files: list[str]) -> dict[str, list[str]]:
134
+ """split between filename and parent directory path"""
135
+ tree: dict[str, TreeNode] = _make_tree(files)
134
136
  outpaths: dict[str, list[str]] = {}
135
137
  for _, node in tree.items():
136
138
  _merge(node, "", outpaths)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.0.42
3
+ Version: 1.0.43
4
4
  Summary: rclone api in python
5
5
  Home-page: https://github.com/zackees/rclone-api
6
6
  Maintainer: Zachary Vorhies
@@ -76,6 +76,26 @@ class GroupFilestest(unittest.TestCase):
76
76
  self.assertIn(expected_files[1], groups["dst:Bucket/subdir2"])
77
77
  print("done")
78
78
 
79
+ def test_two_fine_grained(self) -> None:
80
+ files = [
81
+ "dst:TorrentBooks/libgenrs_nonfiction/204000/a2b20b2c89240ce81dec16091e18113e",
82
+ "dst:TorrentBooks/libgenrs_nonfiction/208000/155fe185bc03048b003a8e145ed097c8",
83
+ "dst:TorrentBooks/libgenrs_nonfiction/208001/155fe185bc03048b003a8e145ed097c8",
84
+ "dst:TorrentBooks/libgenrs_nonfiction/208002/155fe185bc03048b003a8e145ed097c8",
85
+ "dst:TorrentBooks/libgenrs_nonfiction/2080054/155fe185bc03048b003a8e145ed097c4",
86
+ ]
87
+ # expect that this all goes under the same parent
88
+ groups: dict[str, list[str]] = group_files(files)
89
+ self.assertEqual(len(groups), 1)
90
+ # dst:/Bucket/subdir should be the key
91
+ self.assertIn("dst:TorrentBooks/libgenrs_nonfiction", groups)
92
+ self.assertEqual(len(groups["dst:TorrentBooks/libgenrs_nonfiction"]), 5)
93
+ expected_files = [
94
+ "204000/a2b20b2c89240ce81dec16091e18113e",
95
+ "208000/155fe185bc03048b003a8e145ed097c8",
96
+ ]
97
+ self.assertIn(expected_files[0], groups["dst:TorrentBooks/libgenrs_nonfiction"])
98
+
79
99
 
80
100
  if __name__ == "__main__":
81
101
  unittest.main()
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