mmar-mapi 1.0.13__py3-none-any.whl → 1.0.15__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.
Potentially problematic release.
This version of mmar-mapi might be problematic. Click here for more details.
- mmar_mapi/file_storage.py +5 -2
- mmar_mapi/utils.py +4 -2
- {mmar_mapi-1.0.13.dist-info → mmar_mapi-1.0.15.dist-info}/METADATA +1 -1
- {mmar_mapi-1.0.13.dist-info → mmar_mapi-1.0.15.dist-info}/RECORD +6 -6
- {mmar_mapi-1.0.13.dist-info → mmar_mapi-1.0.15.dist-info}/WHEEL +1 -1
- {mmar_mapi-1.0.13.dist-info → mmar_mapi-1.0.15.dist-info}/licenses/LICENSE +0 -0
mmar_mapi/file_storage.py
CHANGED
|
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
|
6
6
|
from zipfile import ZipFile, is_zipfile
|
|
7
7
|
|
|
8
8
|
ResourceId = str
|
|
9
|
-
|
|
9
|
+
ASCII_DIGITS_SPECIAL = set(string.ascii_lowercase + string.digits + '-')
|
|
10
10
|
SUFFIX_DIR = ".dir"
|
|
11
11
|
SUFFIX_METADATA = ".metadata"
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ def _validate_exist(files_dir):
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def _validate_dtype(dtype: str):
|
|
21
|
-
if all(map(
|
|
21
|
+
if all(map(ASCII_DIGITS_SPECIAL.__contains__, dtype)):
|
|
22
22
|
return
|
|
23
23
|
raise ValueError(f"Bad dtype: {dtype}")
|
|
24
24
|
|
|
@@ -61,6 +61,9 @@ class FileStorage:
|
|
|
61
61
|
|
|
62
62
|
return str(fpath)
|
|
63
63
|
|
|
64
|
+
def get_metadata_path(self, resource_id: ResourceId) -> ResourceId:
|
|
65
|
+
return Path(resource_id).with_suffix(SUFFIX_METADATA).as_posix()
|
|
66
|
+
|
|
64
67
|
async def upload_async(self, content: bytes | str, fname: str) -> ResourceId:
|
|
65
68
|
return self.upload(content, fname)
|
|
66
69
|
|
mmar_mapi/utils.py
CHANGED
|
@@ -3,8 +3,10 @@ from collections.abc import Iterable
|
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def make_session_id() -> str:
|
|
7
|
-
|
|
6
|
+
def make_session_id(with_millis=False) -> str:
|
|
7
|
+
dt = datetime.now()
|
|
8
|
+
fmt = "%Y-%m-%d--%H-%M-%S-%f" if with_millis else "%Y-%m-%d--%H-%M-%S"
|
|
9
|
+
return datetime.now().strftime(fmt)
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
def chunked(items: Iterable, n) -> list:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
mmar_mapi/__init__.py,sha256=Q2WFyNje0mDzP3eK7k-900W4Uty82BlulKv9-FmkcZs,1177
|
|
2
2
|
mmar_mapi/api.py,sha256=C9Sr8dISvf51xfEznPjccI_odaG4coQE3HI_0jVpjMQ,1677
|
|
3
|
-
mmar_mapi/file_storage.py,sha256=
|
|
3
|
+
mmar_mapi/file_storage.py,sha256=J3l3wZxfcvbxW02AqHsmEqo_frDAn8u3gQeAjfcJEE0,4577
|
|
4
4
|
mmar_mapi/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
mmar_mapi/models/base.py,sha256=mKtXV2x51XVj7W-et9tjGcPMDUUUMelW-BywMgFc2p0,411
|
|
6
6
|
mmar_mapi/models/chat.py,sha256=_M1Uy4QNyPkPLvu0vvufa9fs-3oqT59CtjEqWaOgNAM,13765
|
|
@@ -9,10 +9,10 @@ mmar_mapi/models/enums.py,sha256=J-GNpql9MCnKnWiV9aJRQGI-pAybvV86923RZs99grA,100
|
|
|
9
9
|
mmar_mapi/models/tracks.py,sha256=HKDp-BX1p7AlDfSEKfOKCu0TRSK9cD4Dmq1vJt8oRjw,307
|
|
10
10
|
mmar_mapi/models/widget.py,sha256=ue5o4AkN8SG09aA8eQLOOxbwah-mkZir0ZGL6OA8S9Q,1355
|
|
11
11
|
mmar_mapi/type_union.py,sha256=diwmzcnbqkpGFckPHNw9o8zyQ955mOGNvhTlcBJ0RMI,1905
|
|
12
|
-
mmar_mapi/utils.py,sha256=
|
|
12
|
+
mmar_mapi/utils.py,sha256=y4rLTdao9pr4lRLbMAVD4uDDPdxrDrDrhoAFDp1TkWk,500
|
|
13
13
|
mmar_mapi/utils_import.py,sha256=GRCkiH0pIrl-xWo4rdxngcfuPzjfTIXA1rvDVxEZ3lI,1683
|
|
14
14
|
mmar_mapi/xml_parser.py,sha256=VvLIX_XCZao9i0qqpTVx8nx0vbFXSe8pEbdJdXnj97g,568
|
|
15
|
-
mmar_mapi-1.0.
|
|
16
|
-
mmar_mapi-1.0.
|
|
17
|
-
mmar_mapi-1.0.
|
|
18
|
-
mmar_mapi-1.0.
|
|
15
|
+
mmar_mapi-1.0.15.dist-info/licenses/LICENSE,sha256=2A90w8WjhOgQXnFuUijKJYazaqZ4_NTokYb9Po4y-9k,1061
|
|
16
|
+
mmar_mapi-1.0.15.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
|
|
17
|
+
mmar_mapi-1.0.15.dist-info/METADATA,sha256=B9lfiOcJAr-g4evKTotChDydMpFDVjRd3wXsyW0qo9Q,944
|
|
18
|
+
mmar_mapi-1.0.15.dist-info/RECORD,,
|
|
File without changes
|