rclone-api 1.5.58__py3-none-any.whl → 1.5.60__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.
@@ -325,6 +325,10 @@ class FSPath:
325
325
  def with_suffix(self, suffix: str) -> "FSPath":
326
326
  return FSPath(self.fs, Path(self.path).with_suffix(suffix).as_posix())
327
327
 
328
+ @property
329
+ def suffix(self) -> str:
330
+ return Path(self.path).suffix
331
+
328
332
  @property
329
333
  def name(self) -> str:
330
334
  return Path(self.path).name
rclone_api/http_server.py CHANGED
@@ -2,6 +2,7 @@
2
2
  Unit test file for testing rclone mount functionality.
3
3
  """
4
4
 
5
+ import logging
5
6
  import tempfile
6
7
  import time
7
8
  import warnings
@@ -21,6 +22,7 @@ from rclone_api.types import Range, SizeSuffix, get_chunk_tmpdir
21
22
  _TIMEOUT = 10 * 60 # 10 minutes
22
23
  _PUT_WARNED = False
23
24
 
25
+ logger = logging.getLogger(__name__)
24
26
 
25
27
  _range = range
26
28
 
@@ -84,7 +86,6 @@ class HttpServer:
84
86
  """Check if the file exists on the server."""
85
87
  try:
86
88
  assert self.process is not None
87
- # response = httpx.head(f"{self.url}/{path}")
88
89
  url = self._get_file_url(path)
89
90
  response = httpx.head(url)
90
91
  return response.status_code == 200
@@ -96,7 +97,6 @@ class HttpServer:
96
97
  """Get size of the file from the server."""
97
98
  try:
98
99
  assert self.process is not None
99
- # response = httpx.head(f"{self.url}/{path}")
100
100
  url = self._get_file_url(path)
101
101
  response = httpx.head(url)
102
102
  response.raise_for_status()
@@ -117,7 +117,7 @@ class HttpServer:
117
117
  url = self._get_file_url(path)
118
118
  headers = {"Content-Type": "application/octet-stream"}
119
119
  response = httpx.post(url, content=data, timeout=_TIMEOUT, headers=headers)
120
- print("Allowed methods:", response.headers.get("Allow"))
120
+ logger.info(f"Allowed methods: {response.headers.get('Allow')}")
121
121
  response.raise_for_status()
122
122
  return None
123
123
  except Exception as e:
@@ -179,15 +179,14 @@ class HttpServer:
179
179
  file.write(chunk)
180
180
  else:
181
181
  assert response.is_closed
182
- # print(f"Downloaded bytes {start}-{end} to {dst}")
183
182
  if range:
184
183
  length = range.end - range.start
185
- print(
184
+ logger.info(
186
185
  f"Downloaded bytes starting at {range.start} with size {length} to {dst}"
187
186
  )
188
187
  else:
189
188
  size = dst.stat().st_size
190
- print(f"Downloaded {size} bytes to {dst}")
189
+ logger.info(f"Downloaded {size} bytes to {dst}")
191
190
  return dst
192
191
  except Exception as e:
193
192
  warnings.warn(f"Failed to download {url} to {dst}: {e}")
@@ -263,7 +262,7 @@ class HttpServer:
263
262
  count = 0
264
263
  with open(dst_path, "wb") as file:
265
264
  for f in finished:
266
- print(f"Appending {f} to {dst_path}")
265
+ logger.info(f"Appending {f} to {dst_path}")
267
266
  with open(f, "rb") as part:
268
267
  # chunk = part.read(8192 * 4)
269
268
  while chunk := part.read(8192 * 4):
@@ -271,9 +270,8 @@ class HttpServer:
271
270
  break
272
271
  count += len(chunk)
273
272
  file.write(chunk)
274
- print(f"Removing {f}")
273
+ logger.info(f"Removing {f}")
275
274
  f.unlink()
276
- # print(f"Downloaded {count} bytes to {dst_path}")
277
275
  return dst_path
278
276
  except Exception as e:
279
277
  warnings.warn(f"Failed to copy chunked: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rclone_api
3
- Version: 1.5.58
3
+ Version: 1.5.60
4
4
  Summary: rclone api in python
5
5
  Home-page: https://github.com/zackees/rclone-api
6
6
  License: BSD 3-Clause License
@@ -14,7 +14,7 @@ rclone_api/file_part.py,sha256=i6ByS5_sae8Eba-4imBVTxd-xKC8ExWy7NR8QGr0ors,6155
14
14
  rclone_api/file_stream.py,sha256=_W3qnwCuigqA0hzXl2q5pAxSZDRaUSwet4BkT0lpnzs,1431
15
15
  rclone_api/filelist.py,sha256=xbiusvNgaB_b_kQOZoHMJJxn6TWGtPrWd2J042BI28o,767
16
16
  rclone_api/group_files.py,sha256=H92xPW9lQnbNw5KbtZCl00bD6iRh9yRbCuxku4j_3dg,8036
17
- rclone_api/http_server.py,sha256=P-LT2GqCEM9tGbyzzr-CrSOc3FyCw1qXUSQ5bY2KBHU,12113
17
+ rclone_api/http_server.py,sha256=ZzDVfuRtHBihxdVLUIHNvIZMixyYPm6N2iPHkfWx5eE,11942
18
18
  rclone_api/install.py,sha256=ZDG8QNj1JciS_DSqYnMTECwhJksUPAoqZQxtX804TDk,5679
19
19
  rclone_api/log.py,sha256=VZHM7pNSXip2ZLBKMP7M1u-rp_F7zoafFDuR8CPUoKI,1271
20
20
  rclone_api/mount.py,sha256=LZqEhuKZunbWVqmsOIqkkCotaxWJpdFRS1InXveoU5E,1428
@@ -40,7 +40,7 @@ rclone_api/detail/copy_file_parts_resumable.py,sha256=RoUWV2eBWEvuuTfsvrz5BhtvX3
40
40
  rclone_api/detail/walk.py,sha256=-54NVE8EJcCstwDoaC_UtHm73R2HrZwVwQmsnv55xNU,3369
41
41
  rclone_api/experimental/flags.py,sha256=qCVD--fSTmzlk9hloRLr0q9elzAOFzPsvVpKM3aB1Mk,2739
42
42
  rclone_api/experimental/flags_base.py,sha256=ajU_czkTcAxXYU-SlmiCfHY7aCQGHvpCLqJ-Z8uZLk0,2102
43
- rclone_api/fs/filesystem.py,sha256=DmqYXWTihdo6hFmyBBhsblBz4VmgmbreoLScFtBY5Gc,11119
43
+ rclone_api/fs/filesystem.py,sha256=ItFR2tw9LFbxy8BM9MZv650GHFNgikhQdDskzKQ-oNE,11205
44
44
  rclone_api/fs/walk.py,sha256=Yqn_SS25gTL0ANWSQxnAdN-ELBO1PMZfYYnyxoGafWA,875
45
45
  rclone_api/fs/walk_threaded.py,sha256=zlbooQ7WbteUK1cCjm1Yj66VpDzS8Qm3DcHBSz1Gbjk,1591
46
46
  rclone_api/fs/walk_threaded_walker.py,sha256=xi0QkmmzI35NcaA08FLjGe7ox9tLZcgXtOZCT8nMuWU,718
@@ -58,9 +58,9 @@ rclone_api/s3/multipart/upload_parts_inline.py,sha256=V7syKjFyVIe4U9Ahl5XgqVTzt9
58
58
  rclone_api/s3/multipart/upload_parts_resumable.py,sha256=6-nlMclS8jyVvMvFbQDcZOX9MY1WbCcKA_s9bwuYxnk,9793
59
59
  rclone_api/s3/multipart/upload_parts_server_side_merge.py,sha256=Fp2pdrs5dONQI9LkfNolgAGj1-Z2V1SsRd0r0sreuXI,18040
60
60
  rclone_api/s3/multipart/upload_state.py,sha256=f-Aq2NqtAaMUMhYitlICSNIxCKurWAl2gDEUVizLIqw,6019
61
- rclone_api-1.5.58.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
62
- rclone_api-1.5.58.dist-info/METADATA,sha256=Wf15UYrtE1dqOgJ1OOLt8YKjK5sqrxcwHPdbbE8eaWg,37305
63
- rclone_api-1.5.58.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
64
- rclone_api-1.5.58.dist-info/entry_points.txt,sha256=ognh2e11HTjn73_KL5MWI67pBKS2jekBi-QTiRXySXA,316
65
- rclone_api-1.5.58.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
66
- rclone_api-1.5.58.dist-info/RECORD,,
61
+ rclone_api-1.5.60.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
62
+ rclone_api-1.5.60.dist-info/METADATA,sha256=E3Sau2-Amjlg3WU7-0QcWjvVJzHpgBb34oYJqe0WoD8,37305
63
+ rclone_api-1.5.60.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
64
+ rclone_api-1.5.60.dist-info/entry_points.txt,sha256=ognh2e11HTjn73_KL5MWI67pBKS2jekBi-QTiRXySXA,316
65
+ rclone_api-1.5.60.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
66
+ rclone_api-1.5.60.dist-info/RECORD,,