miniopy-async 1.19__tar.gz → 1.20__tar.gz
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.
- {miniopy-async-1.19 → miniopy_async-1.20}/PKG-INFO +1 -1
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/__init__.py +1 -1
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/api.py +26 -20
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/datatypes.py +73 -3
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async.egg-info/PKG-INFO +1 -1
- {miniopy-async-1.19 → miniopy_async-1.20}/LICENSE +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/README.md +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/commonconfig.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/credentials/__init__.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/credentials/credentials.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/credentials/providers.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/deleteobjects.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/error.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/helpers.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/legalhold.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/lifecycleconfig.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/minioadmin.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/notificationconfig.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/objectlockconfig.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/progress.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/replicationconfig.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/retention.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/select.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/signer.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/sse.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/sseconfig.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/tagging.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/time.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/versioningconfig.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async/xml.py +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async.egg-info/SOURCES.txt +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async.egg-info/dependency_links.txt +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async.egg-info/requires.txt +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/miniopy_async.egg-info/top_level.txt +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/setup.cfg +0 -0
- {miniopy-async-1.19 → miniopy_async-1.20}/setup.py +0 -0
|
@@ -60,6 +60,7 @@ from .datatypes import (
|
|
|
60
60
|
PostPolicy,
|
|
61
61
|
parse_copy_object,
|
|
62
62
|
parse_list_objects,
|
|
63
|
+
ListObjects,
|
|
63
64
|
)
|
|
64
65
|
from .deleteobjects import DeleteError, DeleteRequest, DeleteResult
|
|
65
66
|
from .error import InvalidResponseError, S3Error, ServerError
|
|
@@ -264,11 +265,7 @@ class Minio: # pylint: disable=too-many-public-methods
|
|
|
264
265
|
session = aiohttp.ClientSession()
|
|
265
266
|
|
|
266
267
|
response = await session.request(
|
|
267
|
-
method,
|
|
268
|
-
urlunsplit(url),
|
|
269
|
-
data=body,
|
|
270
|
-
headers=headers,
|
|
271
|
-
ssl=self._ssl
|
|
268
|
+
method, urlunsplit(url), data=body, headers=headers, ssl=self._ssl
|
|
272
269
|
)
|
|
273
270
|
|
|
274
271
|
if response.status in [200, 204, 206]:
|
|
@@ -317,18 +314,22 @@ class Minio: # pylint: disable=too-many-public-methods
|
|
|
317
314
|
404: lambda: (
|
|
318
315
|
("NoSuchKey", "Object does not exist")
|
|
319
316
|
if object_name
|
|
320
|
-
else (
|
|
321
|
-
|
|
322
|
-
|
|
317
|
+
else (
|
|
318
|
+
("NoSuchBucket", "Bucket does not exist")
|
|
319
|
+
if bucket_name
|
|
320
|
+
else ("ResourceNotFound", "Request resource not found")
|
|
321
|
+
)
|
|
323
322
|
),
|
|
324
323
|
405: lambda: (
|
|
325
324
|
"MethodNotAllowed",
|
|
326
325
|
"The specified method is not allowed against this resource",
|
|
327
326
|
),
|
|
328
327
|
409: lambda: (
|
|
329
|
-
(
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
(
|
|
329
|
+
("NoSuchBucket", "Bucket does not exist")
|
|
330
|
+
if bucket_name
|
|
331
|
+
else ("ResourceConflict", "Request resource conflicts")
|
|
332
|
+
),
|
|
332
333
|
),
|
|
333
334
|
501: lambda: (
|
|
334
335
|
"MethodNotAllowed",
|
|
@@ -2414,7 +2415,7 @@ class Minio: # pylint: disable=too-many-public-methods
|
|
|
2414
2415
|
)
|
|
2415
2416
|
raise exc
|
|
2416
2417
|
|
|
2417
|
-
|
|
2418
|
+
def list_objects(
|
|
2418
2419
|
self,
|
|
2419
2420
|
bucket_name,
|
|
2420
2421
|
prefix=None,
|
|
@@ -2459,6 +2460,9 @@ class Minio: # pylint: disable=too-many-public-methods
|
|
|
2459
2460
|
for obj in objects:
|
|
2460
2461
|
print('obj:',obj)
|
|
2461
2462
|
|
|
2463
|
+
async for obj in client.list_objects("my-bucket"):
|
|
2464
|
+
print('obj:',obj)
|
|
2465
|
+
|
|
2462
2466
|
# List objects information whose names starts with "my/prefix/".
|
|
2463
2467
|
print('example two')
|
|
2464
2468
|
objects = await client.list_objects("my-bucket",
|
|
@@ -2495,15 +2499,16 @@ class Minio: # pylint: disable=too-many-public-methods
|
|
|
2495
2499
|
loop.run_until_complete(main())
|
|
2496
2500
|
loop.close()
|
|
2497
2501
|
"""
|
|
2498
|
-
return
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
include_user_meta=include_user_meta,
|
|
2502
|
+
return ListObjects(
|
|
2503
|
+
client=self,
|
|
2504
|
+
bucket_name=bucket_name,
|
|
2502
2505
|
prefix=prefix,
|
|
2506
|
+
recursive=recursive,
|
|
2503
2507
|
start_after=start_after,
|
|
2504
|
-
|
|
2508
|
+
include_user_meta=include_user_meta,
|
|
2505
2509
|
include_version=include_version,
|
|
2506
|
-
|
|
2510
|
+
use_api_v1=use_api_v1,
|
|
2511
|
+
use_url_encoding_type=use_url_encoding_type,
|
|
2507
2512
|
)
|
|
2508
2513
|
|
|
2509
2514
|
async def stat_object(
|
|
@@ -4173,6 +4178,7 @@ class Minio: # pylint: disable=too-many-public-methods
|
|
|
4173
4178
|
include_version = True
|
|
4174
4179
|
|
|
4175
4180
|
is_truncated = True
|
|
4181
|
+
|
|
4176
4182
|
while is_truncated:
|
|
4177
4183
|
query = {}
|
|
4178
4184
|
if include_version:
|
|
@@ -4214,13 +4220,13 @@ class Minio: # pylint: disable=too-many-public-methods
|
|
|
4214
4220
|
version_id_marker,
|
|
4215
4221
|
) = await parse_list_objects(response)
|
|
4216
4222
|
|
|
4223
|
+
yield objects
|
|
4224
|
+
|
|
4217
4225
|
if not include_version:
|
|
4218
4226
|
version_id_marker = None
|
|
4219
4227
|
if not use_api_v1:
|
|
4220
4228
|
continuation_token = start_after
|
|
4221
4229
|
|
|
4222
|
-
return objects
|
|
4223
|
-
|
|
4224
4230
|
async def _list_multipart_uploads(
|
|
4225
4231
|
self,
|
|
4226
4232
|
bucket_name,
|
|
@@ -276,9 +276,11 @@ async def parse_list_objects(response, bucket_name=None):
|
|
|
276
276
|
objects += [
|
|
277
277
|
Object(
|
|
278
278
|
bucket_name,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
(
|
|
280
|
+
unquote_plus(findtext(tag, "Prefix", True))
|
|
281
|
+
if encoding_type == "url"
|
|
282
|
+
else findtext(tag, "Prefix", True)
|
|
283
|
+
),
|
|
282
284
|
)
|
|
283
285
|
for tag in elements
|
|
284
286
|
]
|
|
@@ -849,3 +851,71 @@ class AsyncEventIterable:
|
|
|
849
851
|
|
|
850
852
|
async def __aexit__(self, exc_type, value, traceback):
|
|
851
853
|
self._response.close()
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
class ListObjects:
|
|
857
|
+
def __init__(
|
|
858
|
+
self,
|
|
859
|
+
client,
|
|
860
|
+
bucket_name,
|
|
861
|
+
prefix=None,
|
|
862
|
+
recursive=False,
|
|
863
|
+
start_after=None,
|
|
864
|
+
include_user_meta=False,
|
|
865
|
+
include_version=False,
|
|
866
|
+
use_api_v1=False,
|
|
867
|
+
use_url_encoding_type=True,
|
|
868
|
+
):
|
|
869
|
+
self.client = client
|
|
870
|
+
self.bucket_name = bucket_name
|
|
871
|
+
self.prefix = prefix
|
|
872
|
+
self.recursive = recursive
|
|
873
|
+
self.start_after = start_after
|
|
874
|
+
self.include_user_meta = include_user_meta
|
|
875
|
+
self.include_version = include_version
|
|
876
|
+
self.use_api_v1 = use_api_v1
|
|
877
|
+
self.use_url_encoding_type = use_url_encoding_type
|
|
878
|
+
self.objects = []
|
|
879
|
+
self.buffer = []
|
|
880
|
+
self.iterator = None
|
|
881
|
+
self.is_awaited = False
|
|
882
|
+
|
|
883
|
+
def gen_iterator(self):
|
|
884
|
+
return self.client._list_objects(
|
|
885
|
+
self.bucket_name,
|
|
886
|
+
delimiter=None if self.recursive else "/",
|
|
887
|
+
include_user_meta=self.include_user_meta,
|
|
888
|
+
prefix=self.prefix,
|
|
889
|
+
start_after=self.start_after,
|
|
890
|
+
use_api_v1=self.use_api_v1,
|
|
891
|
+
include_version=self.include_version,
|
|
892
|
+
encoding_type="url" if self.use_url_encoding_type else None,
|
|
893
|
+
)
|
|
894
|
+
|
|
895
|
+
def __aiter__(self):
|
|
896
|
+
self.iterator = self.gen_iterator()
|
|
897
|
+
return self
|
|
898
|
+
|
|
899
|
+
async def __anext__(self):
|
|
900
|
+
if self.iterator is None:
|
|
901
|
+
self.gen_iterator()
|
|
902
|
+
|
|
903
|
+
if not self.buffer:
|
|
904
|
+
try:
|
|
905
|
+
self.buffer = await self.iterator.__anext__()
|
|
906
|
+
self.objects.extend(self.buffer)
|
|
907
|
+
except StopAsyncIteration:
|
|
908
|
+
raise StopAsyncIteration
|
|
909
|
+
|
|
910
|
+
return self.buffer.pop(0)
|
|
911
|
+
|
|
912
|
+
def __await__(self):
|
|
913
|
+
return self._collect_objects().__await__()
|
|
914
|
+
|
|
915
|
+
async def _collect_objects(self):
|
|
916
|
+
if self.iterator is None:
|
|
917
|
+
self.gen_iterator()
|
|
918
|
+
|
|
919
|
+
async for partial_objects in self:
|
|
920
|
+
pass
|
|
921
|
+
return self.objects
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|