rclone-api 1.0.26__py2.py3-none-any.whl → 1.0.27__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
rclone_api/dir_listing.py CHANGED
@@ -1,8 +1,22 @@
1
1
  import json
2
+ import warnings
2
3
 
3
4
  from rclone_api.rpath import RPath
4
5
 
5
6
 
7
+ def _dedupe(items: list[RPath]) -> list[RPath]:
8
+ """Remove duplicate items from a list of RPath objects."""
9
+ seen = set()
10
+ unique_items = []
11
+ for item in items:
12
+ if item not in seen:
13
+ seen.add(item)
14
+ unique_items.append(item)
15
+ else:
16
+ warnings.warn(f"Duplicate item found: {item}, filtered out.")
17
+ return unique_items
18
+
19
+
6
20
  class DirListing:
7
21
  """Remote file dataclass."""
8
22
 
@@ -10,6 +24,8 @@ class DirListing:
10
24
  from rclone_api.dir import Dir
11
25
  from rclone_api.file import File
12
26
 
27
+ dirs_and_files = _dedupe(dirs_and_files)
28
+
13
29
  self.dirs: list[Dir] = [Dir(d) for d in dirs_and_files if d.is_dir]
14
30
  self.files: list[File] = [File(f) for f in dirs_and_files if not f.is_dir]
15
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rclone_api
3
- Version: 1.0.26
3
+ Version: 1.0.27
4
4
  Summary: rclone api in python
5
5
  Home-page: https://github.com/zackees/rclone-api
6
6
  Maintainer: Zachary Vorhies
@@ -22,11 +22,11 @@ Dynamic: maintainer
22
22
  [![Ubuntu_Tests](https://github.com/zackees/rclone-api/actions/workflows/push_ubuntu.yml/badge.svg)](https://github.com/zackees/rclone-api/actions/workflows/push_ubuntu.yml)
23
23
  [![Win_Tests](https://github.com/zackees/rclone-api/actions/workflows/push_win.yml/badge.svg)](https://github.com/zackees/rclone-api/actions/workflows/push_win.yml)
24
24
 
25
- Api version of rclone. It's well tested. It's a pretty low level api without the bells and whistles of other apis, but it will get the job done.
25
+ Api version of rclone. It's a pretty low level api without the bells and whistles of other apis, but it will get the job done. Unit tests up the wazoo. S3 Mounts on windows/linux are heavily optimized.
26
26
 
27
27
  You will need to have rclone installed and on your path.
28
28
 
29
- One of the benefits of this api is that it does not use `shell=True`, which can keep `rclone` running in some instances even when try to kill the process.
29
+ One of the benefits of this api is that it does not use 'shell=True' so therefore ctrl-c will work well in gracefully shutting down
30
30
 
31
31
  # Install
32
32
 
@@ -3,7 +3,7 @@ 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
5
  rclone_api/dir.py,sha256=vV-bcI2ESijmwF5rPID5WO2K7soAfZa35wv4KRh_GIo,2154
6
- rclone_api/dir_listing.py,sha256=8t5Jx9ZVOJPqGKTJbWaES6bjgogUT2bnpbPVWwK1Fcs,1124
6
+ rclone_api/dir_listing.py,sha256=9Qqf2SUswrOEkyqmaH23V51I18X6ePiXb9B1vUwRF5o,1571
7
7
  rclone_api/exec.py,sha256=9qSOpZo8YRYxv3hOvNr57ApnY2KbjxwT1QNr8OgcLM4,883
8
8
  rclone_api/file.py,sha256=D02iHJW1LhfOiM_R_yPHP8_ApnDiYrkuraVcrV8-qkw,1246
9
9
  rclone_api/filelist.py,sha256=xbiusvNgaB_b_kQOZoHMJJxn6TWGtPrWd2J042BI28o,767
@@ -15,9 +15,9 @@ rclone_api/util.py,sha256=AWTImA1liCMw52wtS-Gs8Abz96diQ39x6Tx56mvbrEo,3860
15
15
  rclone_api/walk.py,sha256=kca0t1GAnF6FLclN01G8NG__Qe-ggodLtAbQSHyVPng,2968
16
16
  rclone_api/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
17
17
  rclone_api/cmd/list_files.py,sha256=x8FHODEilwKqwdiU1jdkeJbLwOqUkUQuDWPo2u_zpf0,741
18
- rclone_api-1.0.26.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
19
- rclone_api-1.0.26.dist-info/METADATA,sha256=CgaiMFCFjCPlnagzK7xi1wsLwB6YVl8fsEJii3HQbAM,4454
20
- rclone_api-1.0.26.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
21
- rclone_api-1.0.26.dist-info/entry_points.txt,sha256=XUoTX3m7CWxdj2VAKhEuO0NMOfX2qf-OcEDFwdyk9ZE,72
22
- rclone_api-1.0.26.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
23
- rclone_api-1.0.26.dist-info/RECORD,,
18
+ rclone_api-1.0.27.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
19
+ rclone_api-1.0.27.dist-info/METADATA,sha256=JD7eqEB5R3gXqqd-Moj06-uiXzpa5gOS9aff1x1Mqhc,4488
20
+ rclone_api-1.0.27.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
21
+ rclone_api-1.0.27.dist-info/entry_points.txt,sha256=XUoTX3m7CWxdj2VAKhEuO0NMOfX2qf-OcEDFwdyk9ZE,72
22
+ rclone_api-1.0.27.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
23
+ rclone_api-1.0.27.dist-info/RECORD,,