statusline 0.1.0__py3-none-any.whl → 0.1.1__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.
- statusline/__init__.py +7 -1
- statusline/core.py +3 -8
- {statusline-0.1.0.dist-info → statusline-0.1.1.dist-info}/METADATA +23 -38
- statusline-0.1.1.dist-info/RECORD +7 -0
- statusline-0.1.0.dist-info/RECORD +0 -7
- {statusline-0.1.0.dist-info → statusline-0.1.1.dist-info}/WHEEL +0 -0
- {statusline-0.1.0.dist-info → statusline-0.1.1.dist-info}/licenses/LICENSE +0 -0
- {statusline-0.1.0.dist-info → statusline-0.1.1.dist-info}/top_level.txt +0 -0
statusline/__init__.py
CHANGED
statusline/core.py
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
class StatusLine:
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"""Single-line progress/status logger for CLI scripts."""
|
|
3
|
+
def __init__(self, checking_prefix="[CHECKING]"):
|
|
4
4
|
self.prev_len = 0
|
|
5
5
|
self.checking_prefix = checking_prefix
|
|
6
6
|
|
|
7
7
|
def update_log(self, msg: str):
|
|
8
|
-
if not self.enabled:
|
|
9
|
-
return
|
|
10
8
|
width = max(self.prev_len, len(msg))
|
|
11
9
|
print(f"\r{msg:<{width}}", end="", flush=True)
|
|
12
10
|
self.prev_len = width
|
|
13
11
|
|
|
14
12
|
def result_log(self, msg: str):
|
|
15
|
-
if not self.enabled:
|
|
16
|
-
print(msg)
|
|
17
|
-
return
|
|
18
13
|
width = max(self.prev_len, len(msg))
|
|
19
14
|
print(f"\r{msg:<{width}}")
|
|
20
15
|
self.prev_len = 0
|
|
@@ -23,4 +18,4 @@ class StatusLine:
|
|
|
23
18
|
if msg.startswith(self.checking_prefix):
|
|
24
19
|
self.update_log(msg)
|
|
25
20
|
else:
|
|
26
|
-
self.result_log(msg)
|
|
21
|
+
self.result_log(msg)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: statusline
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Tiny single-line status updater for CLI
|
|
5
5
|
Author-email: Hunhee Choi <hunhee9982@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -53,10 +53,18 @@ Made because I got tired of spamming `print()` in brute-force / crawling / long
|
|
|
53
53
|
- If the message starts with `[CHECKING]` (or your custom prefix), it **updates in-place** on a single line (loading-bar vibe).
|
|
54
54
|
- Otherwise, it prints a **persistent result line** (won’t be overwritten).
|
|
55
55
|
|
|
56
|
+
## Install (PyPI)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
python -m pip install statusline
|
|
60
|
+
```
|
|
61
|
+
|
|
56
62
|
## Install (editable / dev)
|
|
57
63
|
|
|
58
64
|
```bash
|
|
59
|
-
|
|
65
|
+
git clone https://github.com/hunhee99/statusline.git
|
|
66
|
+
cd statusline
|
|
67
|
+
python -m pip install -e .
|
|
60
68
|
```
|
|
61
69
|
|
|
62
70
|
Tip: If you're using a specific interpreter/venv, always install with that same Python:
|
|
@@ -65,6 +73,19 @@ Tip: If you're using a specific interpreter/venv, always install with that same
|
|
|
65
73
|
python -m pip install -e .
|
|
66
74
|
```
|
|
67
75
|
|
|
76
|
+
## Versioning / Release Notes
|
|
77
|
+
|
|
78
|
+
- PyPI publishes versioned releases. Install a specific version like:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
python -m pip install statusline==X.Y.Z
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
- Git tags match released versions. Check tags or release notes on GitHub if you need
|
|
85
|
+
changelogs or want to pin a specific release.
|
|
86
|
+
|
|
87
|
+
- Note: `0.1.1` removes the `enabled` argument from `StatusLine` to simplify behavior.
|
|
88
|
+
|
|
68
89
|
## Usage
|
|
69
90
|
|
|
70
91
|
```python
|
|
@@ -85,39 +106,3 @@ your language server is probably using a different interpreter. Select the same
|
|
|
85
106
|
you used to install this package and restart the language server.
|
|
86
107
|
|
|
87
108
|
---
|
|
88
|
-
|
|
89
|
-
## statusline (한국어)
|
|
90
|
-
|
|
91
|
-
CLI에서 로그 찍는 게 귀찮아서 만든 초경량(의존성 없음) 상태 출력 유틸.
|
|
92
|
-
브루트포스/크롤링/긴 반복문 돌릴 때 `print()` 난사하기 싫어서 만들었음.
|
|
93
|
-
|
|
94
|
-
### 기능
|
|
95
|
-
|
|
96
|
-
emit() 하나로 자동 분기됨:
|
|
97
|
-
- 메시지가 [CHECKING](또는 커스텀 prefix)로 시작하면 한 줄에서 계속 갱신됨(로딩바 느낌)
|
|
98
|
-
- 그 외 메시지는 결과 로그로 확정 출력되어 절대 안 지워짐
|
|
99
|
-
|
|
100
|
-
### 설치 (editable / 개발용)
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
pip install -e .
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
팁: 인터프리터/venv를 쓰고 있다면, 항상 같은 파이썬으로 설치해야 함:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
python -m pip install -e .
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### 사용법
|
|
113
|
-
|
|
114
|
-
```python
|
|
115
|
-
from statusline import StatusLine
|
|
116
|
-
|
|
117
|
-
st = StatusLine() # StatusLine(checking_prefix="[PROGRESS]") 처럼 prefix 변경도 가능
|
|
118
|
-
|
|
119
|
-
st.emit("[CHECKING] 뭐시기...") # 같은 줄에서 계속 갱신됨
|
|
120
|
-
st.emit("[CHECKING] 더 뭐시기...")
|
|
121
|
-
|
|
122
|
-
st.emit("지워지지 말거라!") # 결과는 개행으로 확정 출력(안 사라짐)
|
|
123
|
-
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
statusline/__init__.py,sha256=p0cErLr_LtO10mn04YEububLA4dHGFOttnj-T0BS4jM,216
|
|
2
|
+
statusline/core.py,sha256=cVWzTSf83UghXIA0pN89uiDGW53F63ioJswVY_U7gww,689
|
|
3
|
+
statusline-0.1.1.dist-info/licenses/LICENSE,sha256=wEoJYyBH9q10xn-Hr3LbkKq7I2ChrIrI3PuHBsR2Lck,1067
|
|
4
|
+
statusline-0.1.1.dist-info/METADATA,sha256=1uP5Fufri0PiWP2fdBnLr6piKJesuXtH5TygHhZYDYw,3866
|
|
5
|
+
statusline-0.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
+
statusline-0.1.1.dist-info/top_level.txt,sha256=MSV3ejcgDGA_we3OHehB71V4vdlxE_fGHVoMQMtF5KE,11
|
|
7
|
+
statusline-0.1.1.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
statusline/__init__.py,sha256=xuHwg0OmSg0VjxZlCJI9YFllo1Y7MKNNogHEzC2zo_M,54
|
|
2
|
-
statusline/core.py,sha256=IjuOnxIaTAl1YzLIsyi9CS0Zs63HP7rCBHgPRlmqs5E,790
|
|
3
|
-
statusline-0.1.0.dist-info/licenses/LICENSE,sha256=wEoJYyBH9q10xn-Hr3LbkKq7I2ChrIrI3PuHBsR2Lck,1067
|
|
4
|
-
statusline-0.1.0.dist-info/METADATA,sha256=7MbkC9yzb_v1uLV5Iavx_O4HiOJxj-F68QFBr9PRrss,4389
|
|
5
|
-
statusline-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
6
|
-
statusline-0.1.0.dist-info/top_level.txt,sha256=MSV3ejcgDGA_we3OHehB71V4vdlxE_fGHVoMQMtF5KE,11
|
|
7
|
-
statusline-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|