kopitools 0.1.1__py2.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 kopitools might be problematic. Click here for more details.
- kopitools/colors/__init__.py +1 -0
- kopitools/colors/paint.py +74 -0
- kopitools/tests/test.py +12 -0
- kopitools/utils/__init__.py +1 -0
- kopitools/utils/clear.py +6 -0
- kopitools-0.1.1.dist-info/METADATA +4 -0
- kopitools-0.1.1.dist-info/RECORD +8 -0
- kopitools-0.1.1.dist-info/WHEEL +5 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .paint import paint
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
class Paint:
|
|
4
|
+
RED = "\033[31m"
|
|
5
|
+
GREEN = "\033[32m"
|
|
6
|
+
YELLOW = "\033[33m"
|
|
7
|
+
BLUE = "\033[34m"
|
|
8
|
+
PURPLE = "\033[35m"
|
|
9
|
+
CYAN = "\033[36m"
|
|
10
|
+
LIGHT_GRAY = "\033[37m"
|
|
11
|
+
|
|
12
|
+
RESET = "\033[0m"
|
|
13
|
+
BOLD = "\033[1m"
|
|
14
|
+
ITALIC = "\033[3m"
|
|
15
|
+
UNDERLINE = "\033[4m"
|
|
16
|
+
|
|
17
|
+
def __init__(self, texts, sep, end):
|
|
18
|
+
self.texts = texts
|
|
19
|
+
self.codes = []
|
|
20
|
+
self.sep = sep
|
|
21
|
+
self.end = end
|
|
22
|
+
|
|
23
|
+
def show(self):
|
|
24
|
+
print(self, end = self.end)
|
|
25
|
+
|
|
26
|
+
def red(self):
|
|
27
|
+
self.codes.append(Paint.RED)
|
|
28
|
+
return self
|
|
29
|
+
|
|
30
|
+
def green(self):
|
|
31
|
+
self.codes.append(Paint.GREEN)
|
|
32
|
+
return self
|
|
33
|
+
|
|
34
|
+
def yellow(self):
|
|
35
|
+
self.codes.append(Paint.YELLOW)
|
|
36
|
+
return self
|
|
37
|
+
|
|
38
|
+
def blue(self):
|
|
39
|
+
self.codes.append(Paint.BLUE)
|
|
40
|
+
return self
|
|
41
|
+
|
|
42
|
+
def purple(self):
|
|
43
|
+
self.codes.append(Paint.PURPLE)
|
|
44
|
+
return self
|
|
45
|
+
|
|
46
|
+
def cyan(self):
|
|
47
|
+
self.codes.append(Paint.CYAN)
|
|
48
|
+
return self
|
|
49
|
+
|
|
50
|
+
def gray(self):
|
|
51
|
+
self.codes.append(Paint.LIGHT_GRAY)
|
|
52
|
+
return self
|
|
53
|
+
|
|
54
|
+
def bold(self):
|
|
55
|
+
self.codes.append(Paint.BOLD)
|
|
56
|
+
return self
|
|
57
|
+
|
|
58
|
+
def italic(self):
|
|
59
|
+
self.codes.append(Paint.ITALIC)
|
|
60
|
+
return self
|
|
61
|
+
|
|
62
|
+
def underline(self):
|
|
63
|
+
self.codes.append(Paint.UNDERLINE)
|
|
64
|
+
return self
|
|
65
|
+
|
|
66
|
+
def __str__(self):
|
|
67
|
+
COLORS = "".join(self.codes)
|
|
68
|
+
STRING = self.sep.join(str(text) for text in self.texts)
|
|
69
|
+
RESET = Paint.RESET
|
|
70
|
+
|
|
71
|
+
return f"{COLORS}{STRING}{RESET}"
|
|
72
|
+
|
|
73
|
+
def paint(*texts: Any, sep = "", end = "\n") -> Paint:
|
|
74
|
+
return Paint(texts, sep, end)
|
kopitools/tests/test.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .clear import clear
|
kopitools/utils/clear.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
kopitools/colors/__init__.py,sha256=rTvtN9ZgqX4xqvhsGtumottZCf5kbnKv4HN66k-A5L4,25
|
|
2
|
+
kopitools/colors/paint.py,sha256=okn6AWR9eV-yIZaOnnOybNEeVzQjQ_7sSRuJUzzce-o,1595
|
|
3
|
+
kopitools/tests/test.py,sha256=6TANpEvMcMgKLH1ECpQsMjwhgeCdf55F2Cnw_FnZB8k,208
|
|
4
|
+
kopitools/utils/__init__.py,sha256=kFQaL0X9924YXGt_sJxCAS2hotQUUD9RIhhtDVVhTe0,25
|
|
5
|
+
kopitools/utils/clear.py,sha256=1aGZ7zkQBZQkcOdzT4R2IpGdD8KJcGbVdPxHLcOEV3I,135
|
|
6
|
+
kopitools-0.1.1.dist-info/METADATA,sha256=hRGdlZD0ZVabqGHDhhk98MHDnsGUwL_GZSXLL2Q1iZ0,104
|
|
7
|
+
kopitools-0.1.1.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
|
|
8
|
+
kopitools-0.1.1.dist-info/RECORD,,
|