commit-maker 0.2.1__py3-none-any.whl → 0.3.0__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.
- commit_maker/colored.py +59 -0
- commit_maker/custom_int_prompt.py +6 -0
- commit_maker/cut_think_part.py +6 -0
- commit_maker/main.py +485 -573
- commit_maker/mistral.py +68 -0
- commit_maker/ollama.py +65 -0
- commit_maker/rich_custom_formatter.py +11 -0
- commit_maker-0.3.0.dist-info/METADATA +127 -0
- commit_maker-0.3.0.dist-info/RECORD +14 -0
- {commit_maker-0.2.1.dist-info → commit_maker-0.3.0.dist-info}/WHEEL +1 -1
- {commit_maker-0.2.1.dist-info → commit_maker-0.3.0.dist-info/licenses}/LICENSE +21 -21
- commit_maker-0.2.1.dist-info/METADATA +0 -119
- commit_maker-0.2.1.dist-info/RECORD +0 -8
- {commit_maker-0.2.1.dist-info → commit_maker-0.3.0.dist-info}/entry_points.txt +0 -0
- {commit_maker-0.2.1.dist-info → commit_maker-0.3.0.dist-info}/top_level.txt +0 -0
commit_maker/colored.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Функции для цветного вывода/ввода
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Deprecated
|
|
5
|
+
def bold(text: str) -> str:
|
|
6
|
+
"""Возвращает жирный текст
|
|
7
|
+
|
|
8
|
+
Args:
|
|
9
|
+
text (str): Текст
|
|
10
|
+
|
|
11
|
+
Returns:
|
|
12
|
+
str: Жирный текст
|
|
13
|
+
"""
|
|
14
|
+
bold_start = "\033[1m"
|
|
15
|
+
bold_end = "\033[0m"
|
|
16
|
+
return f"{bold_start}{text}{bold_end}"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def colored(
|
|
20
|
+
string: str,
|
|
21
|
+
color: str,
|
|
22
|
+
text_bold: bool = True,
|
|
23
|
+
) -> str:
|
|
24
|
+
"""Функция для 'окраски' строк для красивого вывода
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
string (str): Строка, которую нужно покрасить
|
|
28
|
+
color (str): Цвет покраски ['red', 'yellow', 'green', 'magenta',\
|
|
29
|
+
'blue', 'cyan', 'reset']
|
|
30
|
+
text_bold (bool, optional): Жирный текст или нет. Defaults to True.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
str: Покрашенная строка
|
|
34
|
+
|
|
35
|
+
Example:
|
|
36
|
+
`print(colored(string='Success!', color='green'))` # Выводит 'Success!'
|
|
37
|
+
зеленого цвета
|
|
38
|
+
"""
|
|
39
|
+
COLOR_RED = "\033[31m"
|
|
40
|
+
COLOR_GREEN = "\033[32m"
|
|
41
|
+
COLOR_YELLOW = "\033[33m"
|
|
42
|
+
COLOR_BLUE = "\033[94m"
|
|
43
|
+
COLOR_MAGENTA = "\033[95m"
|
|
44
|
+
COLOR_CYAN = "\033[96m"
|
|
45
|
+
COLOR_RESET = "\033[0m"
|
|
46
|
+
COLORS_DICT = {
|
|
47
|
+
"red": COLOR_RED,
|
|
48
|
+
"green": COLOR_GREEN,
|
|
49
|
+
"yellow": COLOR_YELLOW,
|
|
50
|
+
"blue": COLOR_BLUE,
|
|
51
|
+
"magenta": COLOR_MAGENTA,
|
|
52
|
+
"cyan": COLOR_CYAN,
|
|
53
|
+
"reset": COLOR_RESET,
|
|
54
|
+
}
|
|
55
|
+
return (
|
|
56
|
+
bold(f"{COLORS_DICT[color]}{string}{COLORS_DICT['reset']}")
|
|
57
|
+
if text_bold
|
|
58
|
+
else f"{COLORS_DICT[color]}{string}{COLORS_DICT['reset']}"
|
|
59
|
+
)
|