BlueRainHelper 1.1.1__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.
- bluerainhelper-1.1.1/BlueRainHelper/__init__.py +2 -0
- bluerainhelper-1.1.1/BlueRainHelper/aider_QOL.py +63 -0
- bluerainhelper-1.1.1/BlueRainHelper/aider_menuBuilder.py +66 -0
- bluerainhelper-1.1.1/BlueRainHelper/tempCodeRunnerFile.py +4 -0
- bluerainhelper-1.1.1/BlueRainHelper.egg-info/PKG-INFO +11 -0
- bluerainhelper-1.1.1/BlueRainHelper.egg-info/SOURCES.txt +11 -0
- bluerainhelper-1.1.1/BlueRainHelper.egg-info/dependency_links.txt +1 -0
- bluerainhelper-1.1.1/BlueRainHelper.egg-info/top_level.txt +1 -0
- bluerainhelper-1.1.1/LICENSE.txt +0 -0
- bluerainhelper-1.1.1/PKG-INFO +11 -0
- bluerainhelper-1.1.1/README.md +0 -0
- bluerainhelper-1.1.1/pyproject.toml +19 -0
- bluerainhelper-1.1.1/setup.cfg +4 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
def pause(msg = "Press Enter To Continue..."):
|
|
4
|
+
"""Pause the terminal until user press 'Enter'."""
|
|
5
|
+
input("\n" + msg)
|
|
6
|
+
|
|
7
|
+
def makingSure(msg = "Are You Sure? (y/n) : " ):
|
|
8
|
+
"""Let user making sure of their choice."""
|
|
9
|
+
confirmation = input("\n" + msg)
|
|
10
|
+
if confirmation.strip().lower() in ["y", "yes"]:
|
|
11
|
+
return True
|
|
12
|
+
else:
|
|
13
|
+
return False
|
|
14
|
+
|
|
15
|
+
def wipeScreen():
|
|
16
|
+
"""Clear terminal Screen."""
|
|
17
|
+
if os.name == "nt":
|
|
18
|
+
cmd = "cls"
|
|
19
|
+
else:
|
|
20
|
+
cmd = "clear"
|
|
21
|
+
os.system(cmd)
|
|
22
|
+
|
|
23
|
+
def successText(msg = "success"):
|
|
24
|
+
"""Print text, color = green"""
|
|
25
|
+
print(f"\033[0;32m{msg}\033[0m")
|
|
26
|
+
|
|
27
|
+
def dangerText(msg = "danger"):
|
|
28
|
+
"""Print text, color = red"""
|
|
29
|
+
print(f"\033[0;31m{msg}\033[0m")
|
|
30
|
+
|
|
31
|
+
def warningText(msg = "warning"):
|
|
32
|
+
"""Print text, color = red"""
|
|
33
|
+
print(f"\033[0;33m{msg}\033[0m")
|
|
34
|
+
|
|
35
|
+
def customText(msg = "custom", fg = 0, bg = 0, italic = 0, underline = 0):
|
|
36
|
+
fgList = [
|
|
37
|
+
"\033[1;37m", "\033[0;30m", "\033[0;31m", "\033[0;32m",
|
|
38
|
+
"\033[0;33m", "\033[0;34m", "\033[0;35m", "\033[0;36m",
|
|
39
|
+
"\033[1;30m", "\033[1;31m", "\033[1;33m"]
|
|
40
|
+
|
|
41
|
+
bgList = [
|
|
42
|
+
"\033[40m", "\033[47m", "\033[41m", "\033[42m",
|
|
43
|
+
"\033[43m", "\033[44m", "\033[45m", "\033[46m",
|
|
44
|
+
"\033[100m", "\033[101m", "\033[102m"
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
if 0 <= fg <= 10 and 0 <= bg <= 10:
|
|
49
|
+
if italic == 1:
|
|
50
|
+
print("\033[3m", end="")
|
|
51
|
+
if underline == 1:
|
|
52
|
+
print("\033[4m", end="")
|
|
53
|
+
print ( fgList[fg] + bgList[bg] + msg + "\033[0m")
|
|
54
|
+
else :
|
|
55
|
+
print ("fg and bg must be 0 - 10")
|
|
56
|
+
except:
|
|
57
|
+
print("fg and bg must be int between 0 - 10")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
class createMenu:
|
|
2
|
+
|
|
3
|
+
def __init__(self, menuTitle = "menu"):
|
|
4
|
+
"""create new menu"""
|
|
5
|
+
self.title = menuTitle
|
|
6
|
+
self.optionMenu = []
|
|
7
|
+
self.longestText = len(self.title)
|
|
8
|
+
self.isCentered = False
|
|
9
|
+
self.marginLeftPos = 0
|
|
10
|
+
|
|
11
|
+
def addOption(self, newOption = "option"):
|
|
12
|
+
"""add new option"""
|
|
13
|
+
curLength = 0
|
|
14
|
+
self.optionMenu.append(newOption)
|
|
15
|
+
curLength = len(newOption) + len(str(len(self.optionMenu))) + 1
|
|
16
|
+
if curLength > self.longestText:
|
|
17
|
+
if len(newOption) % 2 != 0:
|
|
18
|
+
self.longestText = curLength + 1
|
|
19
|
+
else:
|
|
20
|
+
self.longestText = curLength
|
|
21
|
+
return self
|
|
22
|
+
|
|
23
|
+
def viewMenu(self, padding = 4):
|
|
24
|
+
"""view menu"""
|
|
25
|
+
lineBorder = self.longestText + padding * 2
|
|
26
|
+
spaceAvail = lineBorder - len(self.title)
|
|
27
|
+
spaceRight = int(spaceAvail / 2 )
|
|
28
|
+
spaceLeft = int(spaceAvail - spaceRight)
|
|
29
|
+
print(" " * self.marginLeftPos + "+" + "-" * lineBorder + "+")
|
|
30
|
+
print(" " * self.marginLeftPos + "|" + " " * spaceRight + self.title + " " * spaceLeft + "|")
|
|
31
|
+
print(" " * self.marginLeftPos + "+" + "-" * lineBorder + "+")
|
|
32
|
+
for index, option in enumerate(self.optionMenu, start = 1):
|
|
33
|
+
if self.isCentered == True:
|
|
34
|
+
spaceAvail = self.longestText + 2* padding - len(str(index) + "." + option)
|
|
35
|
+
spaceRight = int(spaceAvail / 2 )
|
|
36
|
+
spaceLeft = int(spaceAvail - spaceRight)
|
|
37
|
+
print(" " * self.marginLeftPos + "|"+" " * spaceLeft + str(index) + "." + option + " " * spaceRight + "|")
|
|
38
|
+
else:
|
|
39
|
+
spaceAvail = self.longestText + padding - len(str(index) + "." + option)
|
|
40
|
+
print(" " * self.marginLeftPos + "|"+" " * padding + str(index) + "." + option + " " * spaceAvail + "|")
|
|
41
|
+
print(" " * self.marginLeftPos + "+" + "-" * lineBorder + "+")
|
|
42
|
+
return self
|
|
43
|
+
|
|
44
|
+
def setTextCenter(self):
|
|
45
|
+
"""set text option to center"""
|
|
46
|
+
self.isCentered = True
|
|
47
|
+
return self
|
|
48
|
+
|
|
49
|
+
def setTextNormal(self):
|
|
50
|
+
"""set text option to center"""
|
|
51
|
+
self.isCentered = False
|
|
52
|
+
return self
|
|
53
|
+
|
|
54
|
+
def clears(self):
|
|
55
|
+
"""clear menu option"""
|
|
56
|
+
self.optionMenu.clear()
|
|
57
|
+
self.longestText = 10
|
|
58
|
+
return self
|
|
59
|
+
|
|
60
|
+
def marginLeft(self, margin = 0 ):
|
|
61
|
+
"""add margin to the left"""
|
|
62
|
+
self.marginLeftPos = margin
|
|
63
|
+
return self
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: BlueRainHelper
|
|
3
|
+
Version: 1.1.1
|
|
4
|
+
Summary: A simple CLI menu builder with method chaining
|
|
5
|
+
Author-email: Asda1-max <rakhathrd1314@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/asda1-max
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Dynamic: license-file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE.txt
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
BlueRainHelper/__init__.py
|
|
5
|
+
BlueRainHelper/aider_QOL.py
|
|
6
|
+
BlueRainHelper/aider_menuBuilder.py
|
|
7
|
+
BlueRainHelper/tempCodeRunnerFile.py
|
|
8
|
+
BlueRainHelper.egg-info/PKG-INFO
|
|
9
|
+
BlueRainHelper.egg-info/SOURCES.txt
|
|
10
|
+
BlueRainHelper.egg-info/dependency_links.txt
|
|
11
|
+
BlueRainHelper.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BlueRainHelper
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: BlueRainHelper
|
|
3
|
+
Version: 1.1.1
|
|
4
|
+
Summary: A simple CLI menu builder with method chaining
|
|
5
|
+
Author-email: Asda1-max <rakhathrd1314@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/asda1-max
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Dynamic: license-file
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "BlueRainHelper"
|
|
7
|
+
version = "1.1.1"
|
|
8
|
+
description = "A simple CLI menu builder with method chaining"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Asda1-max", email = "rakhathrd1314@gmail.com" }
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
license = { text = "MIT" }
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
requires-python = ">=3.8"
|
|
16
|
+
dependencies = []
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Homepage = "https://github.com/asda1-max"
|