loopstring 0.0.4__tar.gz → 0.1.0__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.
- {loopstring-0.0.4 → loopstring-0.1.0}/PKG-INFO +3 -3
- {loopstring-0.0.4 → loopstring-0.1.0}/README.md +2 -2
- loopstring-0.1.0/loopstring/__init__.py +3 -0
- {loopstring-0.0.4 → loopstring-0.1.0}/loopstring/loopstring.py +48 -18
- {loopstring-0.0.4 → loopstring-0.1.0}/loopstring.egg-info/PKG-INFO +3 -3
- {loopstring-0.0.4 → loopstring-0.1.0}/pyproject.toml +1 -1
- loopstring-0.0.4/loopstring/__init__.py +0 -7
- {loopstring-0.0.4 → loopstring-0.1.0}/loopstring.egg-info/SOURCES.txt +0 -0
- {loopstring-0.0.4 → loopstring-0.1.0}/loopstring.egg-info/dependency_links.txt +0 -0
- {loopstring-0.0.4 → loopstring-0.1.0}/loopstring.egg-info/top_level.txt +0 -0
- {loopstring-0.0.4 → loopstring-0.1.0}/setup.cfg +0 -0
- {loopstring-0.0.4 → loopstring-0.1.0}/setup.py +0 -0
|
@@ -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
|
|
@@ -23,8 +23,8 @@ pip install loopstring
|
|
|
23
23
|
```python
|
|
24
24
|
from loopstring import BOXES
|
|
25
25
|
|
|
26
|
-
# Draw a clean rounded box
|
|
27
|
-
print(BOXES.
|
|
26
|
+
# Draw a clean rounded box using the style parameter
|
|
27
|
+
print(BOXES.draw_box("System Online", style="rounded"))
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### 2. Styling Terminal Text
|
|
@@ -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
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# loopstring/__init__.py
|
|
2
|
-
|
|
3
|
-
# Explicitly pull the classes from your main code file into the package front door
|
|
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']
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|