rclone-api 1.0.78__tar.gz → 1.0.79__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {rclone_api-1.0.78 → rclone_api-1.0.79}/PKG-INFO +1 -1
- {rclone_api-1.0.78 → rclone_api-1.0.79}/pyproject.toml +1 -1
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/rclone.py +32 -38
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api.egg-info/PKG-INFO +1 -1
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.aiderignore +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.github/workflows/lint.yml +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.github/workflows/push_macos.yml +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.github/workflows/push_ubuntu.yml +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.github/workflows/push_win.yml +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.gitignore +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.pylintrc +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.vscode/launch.json +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.vscode/settings.json +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/.vscode/tasks.json +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/LICENSE +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/MANIFEST.in +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/README.md +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/clean +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/install +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/lint +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/requirements.testing.txt +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/setup.cfg +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/setup.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/__init__.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/assets/example.txt +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/cli.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/cmd/list_files.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/completed_process.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/config.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/convert.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/deprecated.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/diff.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/dir.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/dir_listing.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/exec.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/file.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/filelist.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/group_files.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/process.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/remote.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/rpath.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/scan_missing_folders.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/types.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/util.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api/walk.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api.egg-info/SOURCES.txt +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api.egg-info/dependency_links.txt +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api.egg-info/entry_points.txt +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api.egg-info/requires.txt +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/src/rclone_api.egg-info/top_level.txt +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/test +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_cmd_list_files.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_copy.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_copy_files.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_diff.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_group_files.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_is_synced.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_ls.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_mount.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_mount_s3.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_mount_webdav.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_obscure.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_remote_control.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_remotes.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_scan_missing_folders.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_serve_webdav.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_size_files.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tests/test_walk.py +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/tox.ini +0 -0
- {rclone_api-1.0.78 → rclone_api-1.0.79}/upload_package.sh +0 -0
@@ -24,7 +24,6 @@ from rclone_api.exec import RcloneExec
|
|
24
24
|
from rclone_api.file import File
|
25
25
|
from rclone_api.group_files import (
|
26
26
|
group_files,
|
27
|
-
group_under_remote_bucket,
|
28
27
|
)
|
29
28
|
from rclone_api.process import Process
|
30
29
|
from rclone_api.remote import Remote
|
@@ -849,44 +848,39 @@ class Rclone:
|
|
849
848
|
verbose = get_verbose(verbose)
|
850
849
|
check = get_check(check)
|
851
850
|
files = list(files)
|
852
|
-
prefix = src if src.endswith(":") else f"{src}/"
|
853
|
-
if src:
|
854
|
-
files = [f"{prefix}{f}" for f in files]
|
855
|
-
file_list: dict[str, list[str]]
|
856
|
-
file_list = group_under_remote_bucket(files)
|
857
851
|
all_files: list[File] = []
|
858
|
-
for src_path, files in file_list.items():
|
859
|
-
cmd = ["lsjson", src_path, "--files-only", "-R"]
|
860
|
-
with TemporaryDirectory() as tmpdir:
|
861
|
-
# print("files: " + ",".join(files))
|
862
|
-
include_files_txt = Path(tmpdir) / "include_files.txt"
|
863
|
-
include_files_txt.write_text("\n".join(files), encoding="utf-8")
|
864
|
-
cmd += ["--files-from", str(include_files_txt)]
|
865
|
-
if fast_list:
|
866
|
-
cmd.append("--fast-list")
|
867
|
-
if other_args:
|
868
|
-
cmd += other_args
|
869
|
-
cp = self._run(cmd, check=check)
|
870
852
|
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
853
|
+
cmd = ["lsjson", src, "--files-only", "-R"]
|
854
|
+
with TemporaryDirectory() as tmpdir:
|
855
|
+
# print("files: " + ",".join(files))
|
856
|
+
include_files_txt = Path(tmpdir) / "include_files.txt"
|
857
|
+
include_files_txt.write_text("\n".join(files), encoding="utf-8")
|
858
|
+
cmd += ["--files-from", str(include_files_txt)]
|
859
|
+
if fast_list:
|
860
|
+
cmd.append("--fast-list")
|
861
|
+
if other_args:
|
862
|
+
cmd += other_args
|
863
|
+
cp = self._run(cmd, check=check)
|
864
|
+
|
865
|
+
if cp.returncode != 0:
|
866
|
+
if check:
|
867
|
+
raise ValueError(f"Error getting file sizes: {cp.stderr}")
|
882
868
|
else:
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
869
|
+
warnings.warn(f"Error getting file sizes: {cp.stderr}")
|
870
|
+
stdout = cp.stdout
|
871
|
+
pieces = src.split(":", 1)
|
872
|
+
remote_name = pieces[0]
|
873
|
+
parent_path: str | None
|
874
|
+
if len(pieces) > 1:
|
875
|
+
parent_path = pieces[1]
|
876
|
+
else:
|
877
|
+
parent_path = None
|
878
|
+
remote = Remote(name=remote_name, rclone=self)
|
879
|
+
paths: list[RPath] = RPath.from_json_str(
|
880
|
+
stdout, remote, parent_path=parent_path
|
881
|
+
)
|
882
|
+
# print(paths)
|
883
|
+
all_files += [File(p) for p in paths]
|
890
884
|
file_sizes: dict[str, int] = {}
|
891
885
|
f: File
|
892
886
|
for f in all_files:
|
@@ -903,9 +897,9 @@ class Rclone:
|
|
903
897
|
for path, size in file_sizes.items():
|
904
898
|
# remove the prefix
|
905
899
|
path_path = Path(path)
|
906
|
-
path_str = path_path.relative_to(
|
900
|
+
path_str = path_path.relative_to(src).as_posix()
|
907
901
|
file_sizes_path_corrected[path_str] = size
|
908
902
|
out: SizeResult = SizeResult(
|
909
|
-
prefix=
|
903
|
+
prefix=src, total_size=total_size, file_sizes=file_sizes_path_corrected
|
910
904
|
)
|
911
905
|
return out
|
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
|
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
|