rclone-api 1.0.32__py2.py3-none-any.whl → 1.0.35__py2.py3-none-any.whl

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.
@@ -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
rclone_api/diff.py CHANGED
@@ -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}"
rclone_api/rclone.py CHANGED
@@ -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 deletefiles(
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.32
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.deletefiles([file_to_delete])
130
+ rclone.delete_files([file_to_delete])
131
131
  print(f"Deleted {file_to_delete}")
132
132
 
133
133
  # Walk Through a Directory
@@ -2,23 +2,24 @@ rclone_api/__init__.py,sha256=L_ulzYG9WmQqmrVANt-Omi1FJUQVTkXA7SVZx9QH_9M,457
2
2
  rclone_api/cli.py,sha256=dibfAZIh0kXWsBbfp3onKLjyZXo54mTzDjUdzJlDlWo,231
3
3
  rclone_api/config.py,sha256=tP6cU9DnCCEIRc_KP9HPur1jFLLg2QGFSxNwFm6_MVw,118
4
4
  rclone_api/convert.py,sha256=Mx9Qo7zhkOedJd8LdhPvNGHp8znJzOk4f_2KWnoGc78,1012
5
- rclone_api/diff.py,sha256=3WzU_jsIU_Zv-0VslAc--bm8tl7pzFl4fXTwPGeqbwY,4109
5
+ rclone_api/deprecated.py,sha256=qWKpnZdYcBK7YQZKuVoWWXDwi-uqiAtbjgPcci_efow,590
6
+ rclone_api/diff.py,sha256=UqAiWJjAeTTy2ewH6idYKt92Y_JltGAWvrZuE9RNKX8,4159
6
7
  rclone_api/dir.py,sha256=vV-bcI2ESijmwF5rPID5WO2K7soAfZa35wv4KRh_GIo,2154
7
8
  rclone_api/dir_listing.py,sha256=9Qqf2SUswrOEkyqmaH23V51I18X6ePiXb9B1vUwRF5o,1571
8
9
  rclone_api/exec.py,sha256=HWmnU2Jwb-3EttSbAJSaLloYA7YI2mHTzRJ5VEri9aM,941
9
10
  rclone_api/file.py,sha256=D02iHJW1LhfOiM_R_yPHP8_ApnDiYrkuraVcrV8-qkw,1246
10
11
  rclone_api/filelist.py,sha256=xbiusvNgaB_b_kQOZoHMJJxn6TWGtPrWd2J042BI28o,767
11
12
  rclone_api/process.py,sha256=RrMfTe0bndmJ6gBK67ioqNvCstJ8aTC8RlGX1XBLlcw,4191
12
- rclone_api/rclone.py,sha256=jthwnD974eaSBwrgXlQJu_cJpvohxce80BITKhfMYWI,18145
13
+ rclone_api/rclone.py,sha256=0VwATZ8oTmW7wDRt2RsDjzk6nliLSNdxVNH22AvkKMg,18387
13
14
  rclone_api/remote.py,sha256=c9hlRKBCg1BFB9MCINaQIoCg10qyAkeqiS4brl8ce-8,343
14
15
  rclone_api/rpath.py,sha256=8ZA_1wxWtskwcy0I8V2VbjKDmzPkiWd8Q2JQSvh-sYE,2586
15
16
  rclone_api/util.py,sha256=sUjH5NmsawmNbPMY7V6hD8vFJXCwbl44XM1kuij3tA0,3918
16
17
  rclone_api/walk.py,sha256=kca0t1GAnF6FLclN01G8NG__Qe-ggodLtAbQSHyVPng,2968
17
18
  rclone_api/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
18
19
  rclone_api/cmd/list_files.py,sha256=x8FHODEilwKqwdiU1jdkeJbLwOqUkUQuDWPo2u_zpf0,741
19
- rclone_api-1.0.32.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
20
- rclone_api-1.0.32.dist-info/METADATA,sha256=RO4nbx8RblzUV8MYN-CBJArI5Maf4T7NSw2t77aM87A,4488
21
- rclone_api-1.0.32.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
22
- rclone_api-1.0.32.dist-info/entry_points.txt,sha256=XUoTX3m7CWxdj2VAKhEuO0NMOfX2qf-OcEDFwdyk9ZE,72
23
- rclone_api-1.0.32.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
24
- rclone_api-1.0.32.dist-info/RECORD,,
20
+ rclone_api-1.0.35.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
21
+ rclone_api-1.0.35.dist-info/METADATA,sha256=Ubf6cdmIvU6NNFW2IBh7metZC3ZI3h4V2SPyHS6Q_Vg,4489
22
+ rclone_api-1.0.35.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
23
+ rclone_api-1.0.35.dist-info/entry_points.txt,sha256=XUoTX3m7CWxdj2VAKhEuO0NMOfX2qf-OcEDFwdyk9ZE,72
24
+ rclone_api-1.0.35.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
25
+ rclone_api-1.0.35.dist-info/RECORD,,