dublib 0.28.2__tar.gz → 0.28.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.
- {dublib-0.28.2/src/dublib.egg-info → dublib-0.28.3}/PKG-INFO +1 -1
- {dublib-0.28.2 → dublib-0.28.3}/pyproject.toml +1 -1
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/Templates/Bus.py +19 -13
- {dublib-0.28.2 → dublib-0.28.3/src/dublib.egg-info}/PKG-INFO +1 -1
- {dublib-0.28.2 → dublib-0.28.3}/LICENSE +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/README.md +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/setup.cfg +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/Templates/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/Terminalyzer/Command/Definition.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/Terminalyzer/Command/Parser.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/Terminalyzer/Helper.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/Terminalyzer/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/TextStyler/Codes.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/TextStyler/Escapes.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/TextStyler/FastStyler.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/TextStyler/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/Validators.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/CLI/readline.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Core.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Engine/Bus.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Engine/Configurator.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Engine/GetText.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Engine/Patcher.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/CLI/Terminalyzer.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/CLI/Validators.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/CLI/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/Engine/Bus.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/Engine/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/TelebotUtils.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/WebRequestor.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Exceptions/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Methods/Data.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Methods/Decorators.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Methods/Filesystem.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Methods/System.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Polyglot/HTML.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Polyglot/Markdown.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/Polyglot/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/TelebotUtils/Cache.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/TelebotUtils/Master/Decorators.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/TelebotUtils/Master/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/TelebotUtils/Users.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/WebRequestor.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/__init__.py +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib/py.typed +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib.egg-info/SOURCES.txt +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib.egg-info/dependency_links.txt +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib.egg-info/requires.txt +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/src/dublib.egg-info/top_level.txt +0 -0
- {dublib-0.28.2 → dublib-0.28.3}/tests/test_Polyglot.py +0 -0
|
@@ -19,7 +19,7 @@ class MessagesTypes(enum.Enum):
|
|
|
19
19
|
# >>>>> ФУНКЦИИ ГЕНЕРАЦИИ И ВЫВОДА СООБЩЕНИЙ <<<<< #
|
|
20
20
|
#==========================================================================================#
|
|
21
21
|
|
|
22
|
-
def GenerateMessage(text: str, type: MessagesTypes | None = None, origin: str | None = None) -> str:
|
|
22
|
+
def GenerateMessage(text: str, type: MessagesTypes | None = None, origin: str | None = None, colorize: bool = True) -> str:
|
|
23
23
|
"""
|
|
24
24
|
Генерирует сообщение на основе переданных параметров.
|
|
25
25
|
|
|
@@ -35,10 +35,24 @@ def GenerateMessage(text: str, type: MessagesTypes | None = None, origin: str |
|
|
|
35
35
|
|
|
36
36
|
OriginPart = ""
|
|
37
37
|
TypePart = ""
|
|
38
|
-
if origin:
|
|
39
|
-
|
|
38
|
+
if origin:
|
|
39
|
+
OriginPart = f"{origin}:"
|
|
40
|
+
if type:
|
|
41
|
+
TypePart = f"[{OriginPart}{type.name.upper()}] "
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
Message = f"{TypePart}{text}"
|
|
44
|
+
|
|
45
|
+
if colorize:
|
|
46
|
+
ColorsDict: dict[MessagesTypes | None, Codes.Colors | None] = {
|
|
47
|
+
MessagesTypes.Info: Codes.Colors.White,
|
|
48
|
+
MessagesTypes.Error: Codes.Colors.Red,
|
|
49
|
+
MessagesTypes.Warning: Codes.Colors.Yellow,
|
|
50
|
+
MessagesTypes.Critical: Codes.Colors.Red,
|
|
51
|
+
None: None
|
|
52
|
+
}
|
|
53
|
+
Message = TextStyler(text_color = ColorsDict[type]).get_styled_text(Message)
|
|
54
|
+
|
|
55
|
+
return Message
|
|
42
56
|
|
|
43
57
|
def PrintMessage(text: str, type: MessagesTypes | None = None, origin: str | None = None):
|
|
44
58
|
"""
|
|
@@ -52,15 +66,7 @@ def PrintMessage(text: str, type: MessagesTypes | None = None, origin: str | Non
|
|
|
52
66
|
:type origin: str | None
|
|
53
67
|
"""
|
|
54
68
|
|
|
55
|
-
|
|
56
|
-
MessagesTypes.Info: Codes.Colors.White,
|
|
57
|
-
MessagesTypes.Error: Codes.Colors.Red,
|
|
58
|
-
MessagesTypes.Warning: Codes.Colors.Yellow,
|
|
59
|
-
MessagesTypes.Critical: Codes.Colors.Red,
|
|
60
|
-
None: None
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
print(TextStyler(text_color = ColorsDict[type]).get_styled_text(GenerateMessage(text, type, origin)))
|
|
69
|
+
print(GenerateMessage(text, type, origin))
|
|
64
70
|
|
|
65
71
|
#==========================================================================================#
|
|
66
72
|
# >>>>> ШАБЛОНЫ ТИПОВ СООБЩЕНИЙ <<<<< #
|
|
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
|
|
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
|