rclone-api 1.5.30__py3-none-any.whl → 1.5.32__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.
- rclone_api/__init__.py +7 -0
- rclone_api/config.py +8 -2
- rclone_api/fs.py +7 -7
- {rclone_api-1.5.30.dist-info → rclone_api-1.5.32.dist-info}/METADATA +1 -1
- {rclone_api-1.5.30.dist-info → rclone_api-1.5.32.dist-info}/RECORD +9 -9
- {rclone_api-1.5.30.dist-info → rclone_api-1.5.32.dist-info}/WHEEL +0 -0
- {rclone_api-1.5.30.dist-info → rclone_api-1.5.32.dist-info}/entry_points.txt +0 -0
- {rclone_api-1.5.30.dist-info → rclone_api-1.5.32.dist-info}/licenses/LICENSE +0 -0
- {rclone_api-1.5.30.dist-info → rclone_api-1.5.32.dist-info}/top_level.txt +0 -0
rclone_api/__init__.py
CHANGED
@@ -92,6 +92,13 @@ class Rclone:
|
|
92
92
|
|
93
93
|
return upgrade_rclone()
|
94
94
|
|
95
|
+
@staticmethod
|
96
|
+
def find_rclone_conf() -> Path | None:
|
97
|
+
"""Find the rclone configuration file from the environment or default locations."""
|
98
|
+
from rclone_api.config import find_conf_file
|
99
|
+
|
100
|
+
return find_conf_file()
|
101
|
+
|
95
102
|
def __init__(
|
96
103
|
self, rclone_conf: Path | Config | None, rclone_exe: Path | None = None
|
97
104
|
) -> None:
|
rclone_api/config.py
CHANGED
@@ -58,6 +58,7 @@ class Config:
|
|
58
58
|
|
59
59
|
|
60
60
|
def find_conf_file(rclone: Any | None = None) -> Path | None:
|
61
|
+
from rclone_api import Rclone
|
61
62
|
from rclone_api.rclone_impl import RcloneImpl
|
62
63
|
|
63
64
|
# if os.environ.get("RCLONE_CONFIG"):
|
@@ -70,8 +71,13 @@ def find_conf_file(rclone: Any | None = None) -> Path | None:
|
|
70
71
|
if (conf := Path.cwd() / "rclone.conf").exists():
|
71
72
|
return conf
|
72
73
|
if rclone is not None:
|
73
|
-
|
74
|
-
|
74
|
+
if isinstance(rclone, Rclone):
|
75
|
+
rclone = rclone.impl
|
76
|
+
else:
|
77
|
+
assert isinstance(rclone, RcloneImpl)
|
78
|
+
rclone_impl: RcloneImpl = rclone
|
79
|
+
assert isinstance(rclone_impl, RcloneImpl)
|
80
|
+
paths_or_err = rclone_impl.config_paths()
|
75
81
|
if isinstance(paths_or_err, Exception):
|
76
82
|
return None
|
77
83
|
paths = paths_or_err
|
rclone_api/fs.py
CHANGED
@@ -95,19 +95,19 @@ class RemoteFS(FS):
|
|
95
95
|
) -> "RemoteFS":
|
96
96
|
if isinstance(rclone_conf, str):
|
97
97
|
rclone_conf = Config(text=rclone_conf)
|
98
|
-
if rclone_conf is None:
|
99
|
-
curr_dir = Path.cwd() / "rclone.conf"
|
100
|
-
if curr_dir.exists():
|
101
|
-
rclone_conf = curr_dir
|
102
|
-
else:
|
103
|
-
raise ValueError("rclone_conf not found")
|
104
98
|
return RemoteFS(rclone_conf, src)
|
105
99
|
|
106
|
-
def __init__(self, rclone_conf: Path | Config, src: str) -> None:
|
100
|
+
def __init__(self, rclone_conf: Path | Config | None, src: str) -> None:
|
107
101
|
from rclone_api import HttpServer, Rclone
|
108
102
|
|
109
103
|
super().__init__()
|
110
104
|
self.src = src
|
105
|
+
if rclone_conf is None:
|
106
|
+
from rclone_api.config import find_conf_file
|
107
|
+
|
108
|
+
rclone_conf = find_conf_file()
|
109
|
+
if rclone_conf is None:
|
110
|
+
raise FileNotFoundError("rclone.conf not found")
|
111
111
|
self.rclone_conf = rclone_conf
|
112
112
|
self.rclone: Rclone = Rclone(rclone_conf)
|
113
113
|
self.server: HttpServer = self.rclone.serve_http(src=src)
|
@@ -1,7 +1,7 @@
|
|
1
|
-
rclone_api/__init__.py,sha256=
|
1
|
+
rclone_api/__init__.py,sha256=KxOU2UGnoqw1EDHwugFTHHgccfhq22trGiRDwX5Dsng,34086
|
2
2
|
rclone_api/cli.py,sha256=dibfAZIh0kXWsBbfp3onKLjyZXo54mTzDjUdzJlDlWo,231
|
3
3
|
rclone_api/completed_process.py,sha256=_IZ8IWK7DM1_tsbDEkH6wPZ-bbcrgf7A7smls854pmg,1775
|
4
|
-
rclone_api/config.py,sha256=
|
4
|
+
rclone_api/config.py,sha256=uOf2d-T_Df-ELCA74hdBMO-DbmshuTw3gL_d4nP7bLY,3610
|
5
5
|
rclone_api/convert.py,sha256=Mx9Qo7zhkOedJd8LdhPvNGHp8znJzOk4f_2KWnoGc78,1012
|
6
6
|
rclone_api/deprecated.py,sha256=qWKpnZdYcBK7YQZKuVoWWXDwi-uqiAtbjgPcci_efow,590
|
7
7
|
rclone_api/diff.py,sha256=tMoJMAGmLSE6Q_7QhPf6PnCzb840djxMZtDmhc2GlGQ,5227
|
@@ -13,7 +13,7 @@ rclone_api/file_item.py,sha256=cH-AQYsxedhNPp4c8NHY1ad4Z7St4yf_VGbmiGD59no,1770
|
|
13
13
|
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
|
-
rclone_api/fs.py,sha256=
|
16
|
+
rclone_api/fs.py,sha256=h8FO_WwTyEGqcNb-ox_KSEyCyk47gu2UPkRW2X3miHs,7909
|
17
17
|
rclone_api/group_files.py,sha256=H92xPW9lQnbNw5KbtZCl00bD6iRh9yRbCuxku4j_3dg,8036
|
18
18
|
rclone_api/http_server.py,sha256=ZdL-rGaq0zIjcaIiRIbPBQ4OIWZ7dCu71aq0nRlKtY4,11686
|
19
19
|
rclone_api/install.py,sha256=Xb1BRn8rQcSpSd4dzmvIOELP2zM2DytUeIZ6jzv738A,2893
|
@@ -54,9 +54,9 @@ rclone_api/s3/multipart/upload_parts_inline.py,sha256=V7syKjFyVIe4U9Ahl5XgqVTzt9
|
|
54
54
|
rclone_api/s3/multipart/upload_parts_resumable.py,sha256=6-nlMclS8jyVvMvFbQDcZOX9MY1WbCcKA_s9bwuYxnk,9793
|
55
55
|
rclone_api/s3/multipart/upload_parts_server_side_merge.py,sha256=Fp2pdrs5dONQI9LkfNolgAGj1-Z2V1SsRd0r0sreuXI,18040
|
56
56
|
rclone_api/s3/multipart/upload_state.py,sha256=f-Aq2NqtAaMUMhYitlICSNIxCKurWAl2gDEUVizLIqw,6019
|
57
|
-
rclone_api-1.5.
|
58
|
-
rclone_api-1.5.
|
59
|
-
rclone_api-1.5.
|
60
|
-
rclone_api-1.5.
|
61
|
-
rclone_api-1.5.
|
62
|
-
rclone_api-1.5.
|
57
|
+
rclone_api-1.5.32.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
58
|
+
rclone_api-1.5.32.dist-info/METADATA,sha256=WXGjSGhkhL-1T8OTfND6vuFdssvx2iPQ9e-s9gzxtuo,37155
|
59
|
+
rclone_api-1.5.32.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
60
|
+
rclone_api-1.5.32.dist-info/entry_points.txt,sha256=fJteOlYVwgX3UbNuL9jJ0zUTuX2O79JFAeNgK7Sw7EQ,255
|
61
|
+
rclone_api-1.5.32.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
|
62
|
+
rclone_api-1.5.32.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|