loopstring 0.0.4__py3-none-any.whl → 0.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.
- loopstring/__init__.py +2 -6
- loopstring/loopstring.py +48 -18
- {loopstring-0.0.4.dist-info → loopstring-0.1.0.dist-info}/METADATA +3 -3
- loopstring-0.1.0.dist-info/RECORD +6 -0
- loopstring-0.0.4.dist-info/RECORD +0 -6
- {loopstring-0.0.4.dist-info → loopstring-0.1.0.dist-info}/WHEEL +0 -0
- {loopstring-0.0.4.dist-info → loopstring-0.1.0.dist-info}/top_level.txt +0 -0
loopstring/__init__.py
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
from .loopstring import FG, BG, FORMAT, BOXES, SYMBOLS
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
from .loopstring import FG, BG, FORMAT, BOXES
|
|
5
|
-
|
|
6
|
-
# Expose them for when people use "from loopstring import *"
|
|
7
|
-
__all__ = ['FG', 'BG', 'FORMAT', 'BOXES']
|
|
3
|
+
__all__ = ['FG', 'BG', 'FORMAT', 'BOXES', 'SYMBOLS']
|
loopstring/loopstring.py
CHANGED
|
@@ -38,40 +38,53 @@ class BOXES:
|
|
|
38
38
|
|
|
39
39
|
Supported styles: 'light', 'heavy', 'double', 'rounded', 'dashed'
|
|
40
40
|
"""
|
|
41
|
-
#
|
|
41
|
+
# ... keep all your existing draw_box code exactly the same ...
|
|
42
42
|
glyphs = {
|
|
43
43
|
'light': {'h': '─', 'v': '│', 'tl': '┌', 'tr': '┐', 'bl': '└', 'br': '┘'},
|
|
44
44
|
'heavy': {'h': '━', 'v': '┃', 'tl': '┏', 'tr': '┓', 'bl': '┗', 'br': '┛'},
|
|
45
45
|
'double': {'h': '═', 'v': '║', 'tl': '╔', 'tr': '╗', 'bl': '╚', 'br': '╝'},
|
|
46
46
|
'rounded': {'h': '─', 'v': '│', 'tl': '╭', 'tr': '╮', 'bl': '╰', 'br': '╯'},
|
|
47
|
-
# Using a triple-dash pattern for the dashed style
|
|
48
47
|
'dashed': {'h': '┄', 'v': '┆', 'tl': '┌', 'tr': '┐', 'bl': '└', 'br': '┘'}
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
# Fallback to light style if an invalid style is passed
|
|
52
49
|
g = glyphs.get(style.lower(), glyphs['light'])
|
|
53
|
-
|
|
54
|
-
# Split text into lines and find the longest line to set box width
|
|
55
50
|
lines = text.split('\n')
|
|
56
51
|
max_width = max(len(line) for line in lines) if lines else 0
|
|
57
|
-
|
|
58
|
-
# Construct the box layers
|
|
59
52
|
box = []
|
|
60
53
|
box.append(f"{g['tl']}{g['h'] * (max_width + 2)}{g['tr']}")
|
|
61
|
-
|
|
62
54
|
for line in lines:
|
|
63
55
|
box.append(f"{g['v']} {line.ljust(max_width)} {g['v']}")
|
|
64
|
-
|
|
65
56
|
box.append(f"{g['bl']}{g['h'] * (max_width + 2)}{g['br']}")
|
|
66
|
-
|
|
67
57
|
return '\n'.join(box)
|
|
58
|
+
|
|
59
|
+
# 🚀 NEW SHORTCUTS FOR VERSION 0.0.5 🚀
|
|
60
|
+
@staticmethod
|
|
61
|
+
def rounded(text: str) -> str:
|
|
62
|
+
"""Shortcut to draw a rounded box."""
|
|
63
|
+
return BOXES.draw_box(text, style='rounded')
|
|
64
|
+
|
|
65
|
+
@staticmethod
|
|
66
|
+
def heavy(text: str) -> str:
|
|
67
|
+
"""Shortcut to draw a heavy box."""
|
|
68
|
+
return BOXES.draw_box(text, style='heavy')
|
|
69
|
+
|
|
70
|
+
@staticmethod
|
|
71
|
+
def double(text: str) -> str:
|
|
72
|
+
"""Shortcut to draw a double box."""
|
|
73
|
+
return BOXES.draw_box(text, style='double')
|
|
74
|
+
|
|
75
|
+
@staticmethod
|
|
76
|
+
def dashed(text: str) -> str:
|
|
77
|
+
"""Shortcut to draw a dashed box."""
|
|
78
|
+
return BOXES.draw_box(text, style='dashed')
|
|
79
|
+
|
|
68
80
|
|
|
69
81
|
class SYMBOLS:
|
|
70
|
-
"""Cool symbols!"""
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
"""Cool symbols for layouts, dashboards, and loading bars!"""
|
|
83
|
+
# Original Symbols
|
|
84
|
+
HEXAGON = '⬢'
|
|
85
|
+
PENTAGON = '⬟'
|
|
86
|
+
STAR = '⭑'
|
|
87
|
+
DOWNLOAD = '⤓'
|
|
75
88
|
LIGHTSHADE = '░'
|
|
76
89
|
MEDIUMSHADE = '▒'
|
|
77
90
|
DARKSHADE = '▓'
|
|
@@ -87,5 +100,22 @@ class SYMBOLS:
|
|
|
87
100
|
RIGHTTRIANGLE = '▷'
|
|
88
101
|
ASTROIDSTAR = '✦'
|
|
89
102
|
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
MONITOR = '🖵' # U+1F5B5 - Physical monitor screen layout
|
|
104
|
+
CLEAR_SCREEN = '⎚' # U+239A - Classic wipe/clear screen icon
|
|
105
|
+
PROMPT = '❯' # U+276F - Modern CLI input hook
|
|
106
|
+
NETWORK = '🛜︎' # U+1F6DC - Wi-Fi/Network status indicator
|
|
107
|
+
|
|
108
|
+
FILL_1_8 = '▏' # U+258F - Left 1/8 block fill
|
|
109
|
+
FILL_1_4 = '▎' # U+258E - Left 1/4 block fill
|
|
110
|
+
FILL_HALF = '▌' # U+258C - Left half block fill
|
|
111
|
+
FILL_3_4 = '▊' # U+258A - Left 3/4 block fill
|
|
112
|
+
|
|
113
|
+
FOLDER_CLOSED = '🗀' # U+1F5C0 - Closed directory item
|
|
114
|
+
FOLDER_OPEN = '🗁' # U+1F5C1 - Expanded directory folder
|
|
115
|
+
DOCUMENT = '🖹' # U+1F5B9 - Log/Text file symbol
|
|
116
|
+
TRASH = '🗑︎' # U+1F5D1 - Delete/Erase storage indicator
|
|
117
|
+
|
|
118
|
+
LOOP_INFINITY = '∞' # U+221E - Infinity track loop
|
|
119
|
+
LOOP_SINGLE = '➰︎' # U+27B0 - Light curly loop curl
|
|
120
|
+
LOOP_DOUBLE = '➿︎' # U+27BF - Double curly loop hook
|
|
121
|
+
LOOP_REFRESH = '⥁' # U+2941 - Circular reload sequence
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: loopstring
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: Terminal utilities
|
|
5
5
|
Requires-Python: >=3.7
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -30,8 +30,8 @@ pip install loopstring
|
|
|
30
30
|
```python
|
|
31
31
|
from loopstring import BOXES
|
|
32
32
|
|
|
33
|
-
# Draw a clean rounded box
|
|
34
|
-
print(BOXES.
|
|
33
|
+
# Draw a clean rounded box using the style parameter
|
|
34
|
+
print(BOXES.draw_box("System Online", style="rounded"))
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### 2. Styling Terminal Text
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
loopstring/__init__.py,sha256=JwlaxgSNMrKB5FLZZf9R3p38hHjeJ8JlqhZmrYUHmeA,109
|
|
2
|
+
loopstring/loopstring.py,sha256=67fOYFq2tKHB7J5l9FlqZixyeXfzDdwBoGPsj_M-Pdc,4275
|
|
3
|
+
loopstring-0.1.0.dist-info/METADATA,sha256=hRQ_oB2kHU55In7fYIf7P6wIZ38xCsGiwnKE304p5w8,1493
|
|
4
|
+
loopstring-0.1.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
5
|
+
loopstring-0.1.0.dist-info/top_level.txt,sha256=2ydcZBVjxIoTy9e7zFiQFH3LMMAGVBh6iPbdCfKdtqo,11
|
|
6
|
+
loopstring-0.1.0.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
loopstring/__init__.py,sha256=cdk1q8_fBDEDQER9hr3fCBc6dGHVxjkbJgwlH7ttAEM,259
|
|
2
|
-
loopstring/loopstring.py,sha256=q_xWUGWmb6XK3DubpiLF6_fwyxNGf6zjv8FiFiERJlA,2824
|
|
3
|
-
loopstring-0.0.4.dist-info/METADATA,sha256=u60XDk8xSVlXpO0TyGDmgaCz4dR0OCLhoOC23pKiB5o,1466
|
|
4
|
-
loopstring-0.0.4.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
5
|
-
loopstring-0.0.4.dist-info/top_level.txt,sha256=2ydcZBVjxIoTy9e7zFiQFH3LMMAGVBh6iPbdCfKdtqo,11
|
|
6
|
-
loopstring-0.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|