mm-std 0.1.14__py3-none-any.whl → 0.1.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.
mm_std/config.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import io
|
2
2
|
import sys
|
3
3
|
from pathlib import Path
|
4
|
+
from typing import NoReturn
|
4
5
|
|
5
6
|
import yaml
|
6
7
|
from pydantic import BaseModel, ConfigDict, ValidationError
|
7
8
|
|
8
|
-
from .print_ import print_plain
|
9
|
+
from .print_ import print_json, print_plain
|
9
10
|
from .result import Err, Ok, Result
|
10
11
|
from .str import str_to_list
|
11
12
|
from .zip import read_text_from_zip_archive
|
@@ -14,6 +15,10 @@ from .zip import read_text_from_zip_archive
|
|
14
15
|
class BaseConfig(BaseModel):
|
15
16
|
model_config = ConfigDict(extra="forbid")
|
16
17
|
|
18
|
+
def print_and_exit(self, exclude: set[str] | None = None) -> NoReturn:
|
19
|
+
print_json(self.model_dump(exclude=exclude))
|
20
|
+
sys.exit(0)
|
21
|
+
|
17
22
|
@classmethod
|
18
23
|
def to_list_str_validator(
|
19
24
|
cls,
|
mm_std/print_.py
CHANGED
@@ -22,7 +22,7 @@ def fatal(message: str, code: int = 1) -> NoReturn:
|
|
22
22
|
sys.exit(code)
|
23
23
|
|
24
24
|
|
25
|
-
def print_console(*messages: object, print_json: bool = False, default: Callable[[object], str] | None =
|
25
|
+
def print_console(*messages: object, print_json: bool = False, default: Callable[[object], str] | None = str) -> None:
|
26
26
|
if len(messages) == 1:
|
27
27
|
message = messages[0]
|
28
28
|
if isinstance(message, str):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
mm_std/__init__.py,sha256=dtYnmQP_HkWxIJvuCJGpex3RHvG2V0Ekh7oYstRQoco,2291
|
2
2
|
mm_std/command.py,sha256=ze286wjUjg0QSTgIu-2WZks53_Vclg69UaYYgPpQvCU,1283
|
3
3
|
mm_std/concurrency.py,sha256=4kKLhde6YQYsjJJjH6K5eMQj6FtegEz55Mo5TmhQMM0,5242
|
4
|
-
mm_std/config.py,sha256=
|
4
|
+
mm_std/config.py,sha256=kbJuNlPfMu5gpQ3SWtMlJAwz-KpE_tiAsm9kb1lOAaA,3254
|
5
5
|
mm_std/crypto.py,sha256=jdk0_TCmeU0pPXMyz9xH6kQHSjjZ9GcGClBwQps5vBo,340
|
6
6
|
mm_std/date.py,sha256=976eEkSONuNqHQBgSRu8hrtH23tJqztbmHFHLdbP2TY,1879
|
7
7
|
mm_std/dict.py,sha256=kJBPVG9vEqHiSgKKoji8gVGL1yEBbxAmFNn0zz17AUg,180
|
@@ -11,13 +11,13 @@ mm_std/http_.py,sha256=QaPPXVb-rOS0BpoKdYQ0ABm_-mcR5dNa7Uqn-SeW_kE,4119
|
|
11
11
|
mm_std/json_.py,sha256=jAL-JrSMPIwxu3y87xNoTcwhOOEHGHrTpX1BTj44Uhw,1091
|
12
12
|
mm_std/log.py,sha256=6ux6njNKc_ZCQlvWn1FZR6vcSY2Cem-mQzmNXvsg5IE,913
|
13
13
|
mm_std/net.py,sha256=qdRCBIDneip6FaPNe5mx31UtYVmzqam_AoUF7ydEyjA,590
|
14
|
-
mm_std/print_.py,sha256=
|
14
|
+
mm_std/print_.py,sha256=sf_Dq8BaYETyyHl6qXMDkrVZtAq0X6vcfj6lxNtYByA,1690
|
15
15
|
mm_std/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
mm_std/random_.py,sha256=OuUX4VJeSd13NZBya4qrGpR2TfN7_87tfebOY6DBUnI,1113
|
17
17
|
mm_std/result.py,sha256=KtYZbVJMkwwCPcV-Tnt0TkTNyDgiALvQB1DtIEp1prc,7405
|
18
18
|
mm_std/str.py,sha256=jS7VAI7i_a3iqnfaW4Iw2LZRTv0Tml4kmMbP2S2IUF4,3067
|
19
19
|
mm_std/types_.py,sha256=hvZlnvBWyB8CL_MeEWWD0Y0nN677plibYn3yD-5g7xs,99
|
20
20
|
mm_std/zip.py,sha256=2EXcae4HO5U4kObj2Lj8jl5F2OUpT-WRlJybTyFzt6I,370
|
21
|
-
mm_std-0.1.
|
22
|
-
mm_std-0.1.
|
23
|
-
mm_std-0.1.
|
21
|
+
mm_std-0.1.15.dist-info/METADATA,sha256=PijQfHjs_xKg4Bcn9qj2oRKcpRBMbhMwz8BGbKsJlUI,307
|
22
|
+
mm_std-0.1.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
23
|
+
mm_std-0.1.15.dist-info/RECORD,,
|
File without changes
|