rclone-api 1.0.32__tar.gz → 1.0.35__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {rclone_api-1.0.32 → rclone_api-1.0.35}/PKG-INFO +2 -2
- {rclone_api-1.0.32 → rclone_api-1.0.35}/README.md +1 -1
- {rclone_api-1.0.32 → rclone_api-1.0.35}/pyproject.toml +1 -1
- rclone_api-1.0.35/src/rclone_api/deprecated.py +24 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/diff.py +4 -1
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/rclone.py +8 -1
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api.egg-info/PKG-INFO +2 -2
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api.egg-info/SOURCES.txt +1 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_copy.py +2 -2
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_mount.py +1 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.aiderignore +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.github/workflows/lint.yml +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.github/workflows/push_macos.yml +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.github/workflows/push_ubuntu.yml +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.github/workflows/push_win.yml +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.gitignore +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.pylintrc +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.vscode/launch.json +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.vscode/settings.json +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/.vscode/tasks.json +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/LICENSE +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/MANIFEST.in +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/clean +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/install +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/lint +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/requirements.testing.txt +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/setup.cfg +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/setup.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/__init__.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/assets/example.txt +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/cli.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/cmd/list_files.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/config.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/convert.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/dir.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/dir_listing.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/exec.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/file.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/filelist.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/process.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/remote.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/rpath.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/util.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api/walk.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api.egg-info/dependency_links.txt +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api.egg-info/entry_points.txt +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api.egg-info/requires.txt +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/src/rclone_api.egg-info/top_level.txt +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/test +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_cmd_list_files.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_diff.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_is_synced.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_ls.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_mount_s3.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_mount_webdav.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_obscure.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_remotes.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_serve_webdav.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tests/test_walk.py +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/tox.ini +0 -0
- {rclone_api-1.0.32 → rclone_api-1.0.35}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: rclone_api
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.35
|
4
4
|
Summary: rclone api in python
|
5
5
|
Home-page: https://github.com/zackees/rclone-api
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -127,7 +127,7 @@ if listing.files:
|
|
127
127
|
# Delete a File
|
128
128
|
print("\n=== Deleting a File ===")
|
129
129
|
file_to_delete = f"dst:{BUCKET_NAME}/zachs_video/sample.png_copy"
|
130
|
-
rclone.
|
130
|
+
rclone.delete_files([file_to_delete])
|
131
131
|
print(f"Deleted {file_to_delete}")
|
132
132
|
|
133
133
|
# Walk Through a Directory
|
@@ -110,7 +110,7 @@ if listing.files:
|
|
110
110
|
# Delete a File
|
111
111
|
print("\n=== Deleting a File ===")
|
112
112
|
file_to_delete = f"dst:{BUCKET_NAME}/zachs_video/sample.png_copy"
|
113
|
-
rclone.
|
113
|
+
rclone.delete_files([file_to_delete])
|
114
114
|
print(f"Deleted {file_to_delete}")
|
115
115
|
|
116
116
|
# Walk Through a Directory
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import functools
|
2
|
+
import warnings
|
3
|
+
|
4
|
+
|
5
|
+
def deprecated(new_func_name: str):
|
6
|
+
"""Decorator to mark functions as deprecated.
|
7
|
+
|
8
|
+
Args:
|
9
|
+
new_func_name: The name of the function that should be used instead.
|
10
|
+
"""
|
11
|
+
|
12
|
+
def decorator(func):
|
13
|
+
@functools.wraps(func)
|
14
|
+
def wrapper(*args, **kwargs):
|
15
|
+
warnings.warn(
|
16
|
+
f"{func.__name__}() is deprecated; use {new_func_name}() instead.",
|
17
|
+
DeprecationWarning,
|
18
|
+
stacklevel=2,
|
19
|
+
)
|
20
|
+
return func(*args, **kwargs)
|
21
|
+
|
22
|
+
return wrapper
|
23
|
+
|
24
|
+
return decorator
|
@@ -71,6 +71,7 @@ def _async_diff_stream_from_running_process(
|
|
71
71
|
) -> None:
|
72
72
|
count = 0
|
73
73
|
first_few_lines: list[str] = []
|
74
|
+
check = True
|
74
75
|
try:
|
75
76
|
assert running_process.stdout is not None
|
76
77
|
n_max = 10
|
@@ -97,10 +98,12 @@ def _async_diff_stream_from_running_process(
|
|
97
98
|
except KeyboardInterrupt:
|
98
99
|
import _thread
|
99
100
|
|
101
|
+
check = False
|
102
|
+
|
100
103
|
print("KeyboardInterrupt")
|
101
104
|
output.put(None)
|
102
105
|
_thread.interrupt_main()
|
103
|
-
if count == 0:
|
106
|
+
if count == 0 and check:
|
104
107
|
first_lines_str = "\n".join(first_few_lines)
|
105
108
|
raise ValueError(
|
106
109
|
f"No output from rclone check, first few lines: {first_lines_str}"
|
@@ -15,6 +15,7 @@ from typing import Generator
|
|
15
15
|
from rclone_api import Dir
|
16
16
|
from rclone_api.config import Config
|
17
17
|
from rclone_api.convert import convert_to_filestr_list, convert_to_str
|
18
|
+
from rclone_api.deprecated import deprecated
|
18
19
|
from rclone_api.diff import DiffItem, diff_stream_from_running_process
|
19
20
|
from rclone_api.dir_listing import DirListing
|
20
21
|
from rclone_api.exec import RcloneExec
|
@@ -224,7 +225,7 @@ class Rclone:
|
|
224
225
|
cmd_list: list[str] = ["purge", str(path)]
|
225
226
|
return self._run(cmd_list)
|
226
227
|
|
227
|
-
def
|
228
|
+
def delete_files(
|
228
229
|
self, files: str | File | list[str] | list[File]
|
229
230
|
) -> subprocess.CompletedProcess:
|
230
231
|
"""Delete a directory"""
|
@@ -276,6 +277,12 @@ class Rclone:
|
|
276
277
|
assert out is not None
|
277
278
|
return out
|
278
279
|
|
280
|
+
@deprecated("delete_files")
|
281
|
+
def deletefiles(
|
282
|
+
self, files: str | File | list[str] | list[File]
|
283
|
+
) -> subprocess.CompletedProcess:
|
284
|
+
return self.delete_files(files)
|
285
|
+
|
279
286
|
def exists(self, path: Dir | Remote | str | File) -> bool:
|
280
287
|
"""Check if a file or directory exists."""
|
281
288
|
arg: str = convert_to_str(path)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: rclone_api
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.35
|
4
4
|
Summary: rclone api in python
|
5
5
|
Home-page: https://github.com/zackees/rclone-api
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -127,7 +127,7 @@ if listing.files:
|
|
127
127
|
# Delete a File
|
128
128
|
print("\n=== Deleting a File ===")
|
129
129
|
file_to_delete = f"dst:{BUCKET_NAME}/zachs_video/sample.png_copy"
|
130
|
-
rclone.
|
130
|
+
rclone.delete_files([file_to_delete])
|
131
131
|
print(f"Deleted {file_to_delete}")
|
132
132
|
|
133
133
|
# Walk Through a Directory
|
@@ -71,7 +71,7 @@ class RcloneCopyTests(unittest.TestCase):
|
|
71
71
|
listing = rclone.ls(f"dst:{BUCKET_NAME}/zachs_video/", glob=f"*{new_name}")
|
72
72
|
self.assertEqual(len(listing.files), 1)
|
73
73
|
self.assertEqual(listing.dirs, [])
|
74
|
-
rclone.
|
74
|
+
rclone.delete_files([new_path])
|
75
75
|
print("done")
|
76
76
|
|
77
77
|
def test_copyfiles(self) -> None:
|
@@ -98,7 +98,7 @@ class RcloneCopyTests(unittest.TestCase):
|
|
98
98
|
exists = rclone.exists(dest_file)
|
99
99
|
self.assertTrue(exists)
|
100
100
|
|
101
|
-
rclone.
|
101
|
+
rclone.delete_files(delete_list)
|
102
102
|
print("done")
|
103
103
|
|
104
104
|
|
@@ -60,6 +60,7 @@ class RcloneMountTests(unittest.TestCase):
|
|
60
60
|
os.environ["RCLONE_API_VERBOSE"] = "1"
|
61
61
|
self.rclone = Rclone(_generate_rclone_config())
|
62
62
|
|
63
|
+
@unittest.skip("Skipping test_mount")
|
63
64
|
def test_mount(self) -> None:
|
64
65
|
"""Test mounting a remote bucket."""
|
65
66
|
remote_path = f"dst:{self.bucket_name}"
|
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
|