rclone-api 1.0.5__tar.gz → 1.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rclone_api-1.0.5/src/rclone_api.egg-info → rclone_api-1.0.6}/PKG-INFO +1 -1
- {rclone_api-1.0.5 → rclone_api-1.0.6}/pyproject.toml +1 -1
- rclone_api-1.0.6/src/rclone_api/dir.py +17 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6/src/rclone_api.egg-info}/PKG-INFO +1 -1
- rclone_api-1.0.5/src/rclone_api/dir.py +0 -27
- {rclone_api-1.0.5 → rclone_api-1.0.6}/.gitignore +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/.pylintrc +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/.vscode/launch.json +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/.vscode/settings.json +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/.vscode/tasks.json +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/LICENSE +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/MANIFEST.in +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/README.md +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/clean +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/install +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/lint +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/requirements.testing.txt +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/setup.cfg +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/setup.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/__init__.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/assets/example.txt +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/cli.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/config.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/dir_listing.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/file.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/rclone.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/remote.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/rpath.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/types.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api/util.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api.egg-info/SOURCES.txt +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api.egg-info/dependency_links.txt +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/src/rclone_api.egg-info/top_level.txt +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/test +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/tests/test_simple.py +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/tox.ini +0 -0
- {rclone_api-1.0.5 → rclone_api-1.0.6}/upload_package.sh +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
from rclone_api.dir_listing import DirListing
|
2
|
+
from rclone_api.rpath import RPath
|
3
|
+
|
4
|
+
|
5
|
+
class Dir:
|
6
|
+
"""Remote file dataclass."""
|
7
|
+
|
8
|
+
def __init__(self, path: RPath) -> None:
|
9
|
+
self.path = path
|
10
|
+
|
11
|
+
def ls(self) -> DirListing:
|
12
|
+
"""List files and directories in the given path."""
|
13
|
+
assert self.path.rclone is not None
|
14
|
+
return self.path.rclone.ls(self.path.path)
|
15
|
+
|
16
|
+
def __str__(self) -> str:
|
17
|
+
return str(self.path)
|
@@ -1,27 +0,0 @@
|
|
1
|
-
from rclone_api.file import File
|
2
|
-
from rclone_api.rpath import RPath
|
3
|
-
|
4
|
-
|
5
|
-
class Dir:
|
6
|
-
"""Remote file dataclass."""
|
7
|
-
|
8
|
-
def __init__(self, path: RPath) -> None:
|
9
|
-
self.path = path
|
10
|
-
|
11
|
-
def ls(self) -> tuple[list["Dir"], list[File]]:
|
12
|
-
"""List files and directories in the given path."""
|
13
|
-
cmd = ["lsjson", "--files-only", "--dirs-only", "--json", str(self.path)]
|
14
|
-
assert self.path.rclone is not None
|
15
|
-
cp = self.path.rclone._run(cmd)
|
16
|
-
text = cp.stdout
|
17
|
-
tmp: list[RPath] = RPath.from_json_str(text)
|
18
|
-
for t in tmp:
|
19
|
-
t.set_rclone(self.path.rclone)
|
20
|
-
# dirs = [o for o in out if o.is_dir]
|
21
|
-
# files = [o for o in out if not o.is_dir]
|
22
|
-
dirs = [Dir(p) for p in tmp if p.is_dir]
|
23
|
-
files = [File(p) for p in tmp if not p.is_dir]
|
24
|
-
return dirs, files
|
25
|
-
|
26
|
-
def __str__(self) -> str:
|
27
|
-
return str(self.path)
|
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
|