printyful 1.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.
printyful/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from printyful.motors import FullMotor
printyful/motors.py ADDED
@@ -0,0 +1,98 @@
1
+ from typing import List
2
+ import time, os
3
+
4
+ class ColorMotor:
5
+ def red_text(self, text: str) -> str:
6
+ return f'\033[31m{text}\033[m'
7
+
8
+ def blue_text(self, text: str) -> str:
9
+ return f'\033[34m{text}\033[m'
10
+
11
+ def green_text(self, text: str) -> str:
12
+ return f'\033[32m{text}\033[m'
13
+
14
+ def yellow_text(self, text: str) -> str:
15
+ return f'\033[33m{text}\033[m'
16
+
17
+ class BackgroudColorMotor(ColorMotor):
18
+ def red_background(self, text: str) -> str:
19
+ return f'\033[41m {text} \033[0m'
20
+
21
+ def blue_background(self, text: str) -> str:
22
+ return f'\033[44m {text} \033[0m'
23
+
24
+ def green_background(self, text: str) -> str:
25
+ return f'\033[42m {text} \033[0m'
26
+
27
+ def yellow_text(self, text: str) -> str:
28
+ return f'\033[43m {text} \033[0m'
29
+
30
+ class StylesMotor(BackgroudColorMotor):
31
+ def bold_text(self, text: str) -> str:
32
+ return f'\033[1m {text} \033[0m'
33
+
34
+ def sublime_text(self, text: str) -> str:
35
+ return f'\033[4m {text} \033[0m'
36
+
37
+ def invert_text(self, text: str) -> str:
38
+ return f'\033[7m {text} \033[0m'
39
+
40
+ class PanelMotor(StylesMotor):
41
+ def __init__(self, title_color: str = '0'):
42
+ self.title_color = title_color
43
+
44
+ def panel_title(self, title: str) -> str:
45
+ if len(title) < 7:
46
+ raise ValueError('Insert 8 or more caracters on arg title!')
47
+
48
+ return f"""\033[{self.title_color}m
49
+ {'-'*((len(title)*2)+2)}
50
+ |{' '*(len(title)*2)}|
51
+ |{' '*(len(title)*2)}|
52
+ |{' '*(len(title)//2)}{title.strip()}{' '*(len(title)//2)}|
53
+ |{' '*(len(title)*2)}|
54
+ |{' '*(len(title)*2)}|
55
+ {'-'*((len(title)*2)+2)}
56
+ \033[{self.title_color if self.title_color != '0' else ''}m
57
+ """
58
+
59
+ def panel_list_options_enumerated(self, options: List[str]) -> str:
60
+ text = ''
61
+ for _, option in enumerate(options):
62
+ text += f' {_}. {option.upper()}\n'
63
+
64
+ return text
65
+
66
+ def panel_list_options(self, options: List[tuple]) -> str:
67
+ text = ''
68
+ for option in options:
69
+ identifier, char = option
70
+ text += f' {identifier}. {char}\n'
71
+
72
+ return text
73
+
74
+ class LoadingMotor(PanelMotor):
75
+ def loading_text(self, text: str = 'Loading', multiplier: int = 3, sleeptime: float = 0.8, await_confirm: bool = False) -> None:
76
+ for i in range(0, multiplier+1):
77
+ print(f'{text}' + f'{'.'*i}')
78
+ time.sleep(sleeptime)
79
+ os.system('clear')
80
+
81
+ if await_confirm:
82
+ input('Sucessful! Press ENTER to continue.')
83
+
84
+ def loading_bar(self, multiplier: int = 100, sleeptime: float = 0.8, colors: List[str] = ['31', '33', '32'], await_confirm: bool = False, final_text: str = '', message: str = '') -> None:
85
+ for i in range(0, multiplier+1):
86
+ if message:
87
+ print(message)
88
+
89
+ print(f'{i}% | {f'\033[{colors[0]}m=\033[0m'*i if i < 50 else f'\033[{colors[1]}m=\033[0m'*i if i < 80 else f'\033[{colors[2]}m=\033[0m'*i} {' '*(multiplier-i)}| {final_text}')
90
+ time.sleep(sleeptime)
91
+ os.system('clear')
92
+
93
+ if await_confirm:
94
+ input('Sucessful! Press ENTER to continue.')
95
+
96
+ class FullMotor(LoadingMotor):
97
+ def __init__(self, title_color = '0'):
98
+ super().__init__(title_color)
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: printyful
3
+ Version: 1.0
@@ -0,0 +1,6 @@
1
+ printyful/__init__.py,sha256=uW550N3K1R4MJfL7HWLcf8drk1AlKTS2vpSfV1K3rdI,38
2
+ printyful/motors.py,sha256=V_y3g21CB_ms9rchpkTd0LtmQWcKX5CNRdD67Q2d7uI,3279
3
+ printyful-1.0.dist-info/METADATA,sha256=yAnO3ixL_s615lGId3vwsx05MdKRAYpNrp6xP27cl-w,51
4
+ printyful-1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
5
+ printyful-1.0.dist-info/top_level.txt,sha256=n9PMSnG5xi5sTq77SiIk-02qfYdOwbw67YCQfZPwE_Y,10
6
+ printyful-1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ printyful