pypomes-core 3.2.2__tar.gz → 3.2.3__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.
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/PKG-INFO +1 -1
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/pyproject.toml +1 -1
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/__init__.py +3 -3
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/enum_pomes.py +2 -5
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/env_pomes.py +4 -4
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/.gitignore +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/LICENSE +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/README.md +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/.ruff.toml +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/datetime_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/dict_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/email_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/encoding_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/file_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/func_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/list_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/obj_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/str_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/validation_msgs.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/validation_pomes.py +0 -0
- {pypomes_core-3.2.2 → pypomes_core-3.2.3}/src/pypomes_core/xml_pomes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pypomes_core
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.3
|
|
4
4
|
Summary: A collection of Python pomes, penyeach (core modules)
|
|
5
5
|
Project-URL: Homepage, https://github.com/TheWiseCoder/PyPomes-Core
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/TheWiseCoder/PyPomes-Core/issues
|
|
@@ -20,7 +20,7 @@ from .encoding_pomes import (
|
|
|
20
20
|
encode_ascii_hex, decode_ascii_hex
|
|
21
21
|
)
|
|
22
22
|
from .enum_pomes import (
|
|
23
|
-
IntStrEnum,
|
|
23
|
+
IntStrEnum, EnumUseName, EnumAny,
|
|
24
24
|
IntEnumDesc, IntEnumAny, IntEnumDescAny,
|
|
25
25
|
StrEnumDesc, StrEnumAny, StrEnumDescAny
|
|
26
26
|
)
|
|
@@ -98,7 +98,7 @@ __all__ = [
|
|
|
98
98
|
# encoding_pomes
|
|
99
99
|
"encode_ascii_hex", "decode_ascii_hex",
|
|
100
100
|
# enum_pomes
|
|
101
|
-
"IntStrEnum", "
|
|
101
|
+
"IntStrEnum", "EnumUseName", "EnumAny",
|
|
102
102
|
"IntEnumAny", "IntEnumDesc", "IntEnumDescAny",
|
|
103
103
|
"StrEnumAny", "StrEnumDesc", "StrEnumDescAny",
|
|
104
104
|
# env_pomes
|
|
@@ -123,7 +123,7 @@ __all__ = [
|
|
|
123
123
|
"list_prune_duplicates", "list_prune_in", "list_prune_not_in",
|
|
124
124
|
"list_jsonify", "list_hexify", "list_hierarchize", "list_stringify",
|
|
125
125
|
# obj_pomes
|
|
126
|
-
"
|
|
126
|
+
"EnumUseName", "IntEnumDesc", "StrEnumDesc",
|
|
127
127
|
"obj_is_serializable", "obj_to_dict", "obj_positional", "exc_format",
|
|
128
128
|
# str_pomes
|
|
129
129
|
"DIACRITICS_LOWER", "DIACRITICS_UPPER", "REGEX_METACHARS",
|
|
@@ -5,14 +5,11 @@ from typing import Any, Self, TypeVar
|
|
|
5
5
|
IntStrEnum = TypeVar("IntStrEnum", bound=IntEnum | StrEnum)
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class
|
|
8
|
+
class EnumUseName(IntEnum):
|
|
9
9
|
"""
|
|
10
10
|
A marker indicating that the attribute *name* should be used in lieu of *value*, when locating an
|
|
11
11
|
instance of this class by looking for a *str* having its name. The usual procedure would be to look
|
|
12
|
-
for an *
|
|
13
|
-
|
|
14
|
-
Examples of such usage may be found in the *env_pomes* module. Note that this is the only situation
|
|
15
|
-
justifying the use of this marker.
|
|
12
|
+
for an occurrence of the enum's *value*. Examples of such usage may be found in the *env_pomes* module.
|
|
16
13
|
"""
|
|
17
14
|
|
|
18
15
|
|
|
@@ -201,12 +201,12 @@ def env_get_enum(key: str,
|
|
|
201
201
|
:param def_value: the value to return, if obtaining the value for *key* fails (defaults to *None*)
|
|
202
202
|
:return: the value associated with the key, or *def_value* if error
|
|
203
203
|
"""
|
|
204
|
-
from .enum_pomes import
|
|
204
|
+
from .enum_pomes import EnumUseName
|
|
205
205
|
|
|
206
206
|
# initialize the return variable
|
|
207
207
|
result: Any = None
|
|
208
208
|
|
|
209
|
-
if issubclass(enum_class,
|
|
209
|
+
if issubclass(enum_class, EnumUseName):
|
|
210
210
|
# noinspection PyUnresolvedReferences
|
|
211
211
|
name: str = env_get_str(key=key,
|
|
212
212
|
values=[e.name for e in (values or enum_class)],
|
|
@@ -247,7 +247,7 @@ def env_get_enums(key: str,
|
|
|
247
247
|
:param enum_class: the *enum* class to consider (must be a subclass of *IntEnum* or *StrEnum*)
|
|
248
248
|
:return: the values associated with the key, or *None* if error or no values found
|
|
249
249
|
"""
|
|
250
|
-
from .enum_pomes import
|
|
250
|
+
from .enum_pomes import EnumUseName
|
|
251
251
|
|
|
252
252
|
# initialize the return variable
|
|
253
253
|
result: list | None = None
|
|
@@ -259,7 +259,7 @@ def env_get_enums(key: str,
|
|
|
259
259
|
names: list[str] = values.split(",")
|
|
260
260
|
for name in names:
|
|
261
261
|
found = False
|
|
262
|
-
if issubclass(enum_class,
|
|
262
|
+
if issubclass(enum_class, EnumUseName):
|
|
263
263
|
for e in enum_class:
|
|
264
264
|
if e.name.lower() == name.lower():
|
|
265
265
|
enums.append(e)
|
|
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
|