rclone-api 1.5.33__py3-none-any.whl → 1.5.34__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/fs.py +15 -2
- {rclone_api-1.5.33.dist-info → rclone_api-1.5.34.dist-info}/METADATA +1 -1
- {rclone_api-1.5.33.dist-info → rclone_api-1.5.34.dist-info}/RECORD +7 -7
- {rclone_api-1.5.33.dist-info → rclone_api-1.5.34.dist-info}/WHEEL +0 -0
- {rclone_api-1.5.33.dist-info → rclone_api-1.5.34.dist-info}/entry_points.txt +0 -0
- {rclone_api-1.5.33.dist-info → rclone_api-1.5.34.dist-info}/licenses/LICENSE +0 -0
- {rclone_api-1.5.33.dist-info → rclone_api-1.5.34.dist-info}/top_level.txt +0 -0
rclone_api/fs.py
CHANGED
@@ -103,6 +103,7 @@ class RemoteFS(FS):
|
|
103
103
|
super().__init__()
|
104
104
|
self.src = src
|
105
105
|
self.shutdown = False
|
106
|
+
self.server: HttpServer | None = None
|
106
107
|
if rclone_conf is None:
|
107
108
|
from rclone_api.config import find_conf_file
|
108
109
|
|
@@ -111,7 +112,7 @@ class RemoteFS(FS):
|
|
111
112
|
raise FileNotFoundError("rclone.conf not found")
|
112
113
|
self.rclone_conf = rclone_conf
|
113
114
|
self.rclone: Rclone = Rclone(rclone_conf)
|
114
|
-
self.server
|
115
|
+
self.server = self.rclone.serve_http(src=src)
|
115
116
|
|
116
117
|
def root(self) -> "FSPath":
|
117
118
|
return FSPath(self, self.src)
|
@@ -144,6 +145,9 @@ class RemoteFS(FS):
|
|
144
145
|
self.rclone.write_bytes(data, path)
|
145
146
|
|
146
147
|
def exists(self, path: Path | str) -> bool:
|
148
|
+
from rclone_api.http_server import HttpServer
|
149
|
+
|
150
|
+
assert isinstance(self.server, HttpServer)
|
147
151
|
path = self._to_str(path)
|
148
152
|
dst_rel = self._to_remote_path(path)
|
149
153
|
return self.server.exists(dst_rel)
|
@@ -156,17 +160,26 @@ class RemoteFS(FS):
|
|
156
160
|
return None
|
157
161
|
|
158
162
|
def is_dir(self, path: Path | str) -> bool:
|
163
|
+
from rclone_api.http_server import HttpServer
|
164
|
+
|
165
|
+
assert isinstance(self.server, HttpServer)
|
159
166
|
path = self._to_remote_path(path)
|
160
167
|
err = self.server.list(path)
|
161
168
|
return isinstance(err, list)
|
162
169
|
|
163
170
|
def is_file(self, path: Path | str) -> bool:
|
171
|
+
from rclone_api.http_server import HttpServer
|
172
|
+
|
173
|
+
assert isinstance(self.server, HttpServer)
|
164
174
|
path = self._to_remote_path(path)
|
165
175
|
err = self.server.list(path)
|
166
176
|
# Make faster.
|
167
177
|
return isinstance(err, Exception) and self.exists(path)
|
168
178
|
|
169
179
|
def ls(self, path: Path | str) -> list[str]:
|
180
|
+
from rclone_api.http_server import HttpServer
|
181
|
+
|
182
|
+
assert isinstance(self.server, HttpServer)
|
170
183
|
path = self._to_remote_path(path)
|
171
184
|
err = self.server.list(path)
|
172
185
|
if isinstance(err, Exception):
|
@@ -177,7 +190,7 @@ class RemoteFS(FS):
|
|
177
190
|
return FSPath(self, path)
|
178
191
|
|
179
192
|
def dispose(self) -> None:
|
180
|
-
if self.shutdown:
|
193
|
+
if self.shutdown or not self.server:
|
181
194
|
return
|
182
195
|
self.shutdown = True
|
183
196
|
self.server.shutdown()
|
@@ -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=eCiY6Jw8tVC1Kcfr0334Mj29BpeBNF7OtebAPLZdY-0,8386
|
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.34.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
58
|
+
rclone_api-1.5.34.dist-info/METADATA,sha256=CgPOSQeAWNybARnd2flKwrVFYK8ibYhr909NaXUJXbw,37155
|
59
|
+
rclone_api-1.5.34.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
60
|
+
rclone_api-1.5.34.dist-info/entry_points.txt,sha256=fJteOlYVwgX3UbNuL9jJ0zUTuX2O79JFAeNgK7Sw7EQ,255
|
61
|
+
rclone_api-1.5.34.dist-info/top_level.txt,sha256=EvZ7uuruUpe9RiUyEp25d1Keq7PWYNT0O_-mr8FCG5g,11
|
62
|
+
rclone_api-1.5.34.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|