pyallel 0.18.1__tar.gz → 0.18.3__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.
- {pyallel-0.18.1 → pyallel-0.18.3}/PKG-INFO +1 -1
- {pyallel-0.18.1 → pyallel-0.18.3}/pyproject.toml +1 -1
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/constants.py +4 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/process.py +2 -1
- {pyallel-0.18.1 → pyallel-0.18.3}/LICENSE +0 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/README.md +0 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/__init__.py +0 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/colours.py +0 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/errors.py +0 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/main.py +0 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/parser.py +0 -0
- {pyallel-0.18.1 → pyallel-0.18.3}/src/pyallel/py.typed +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import re
|
|
2
3
|
import sys
|
|
3
4
|
|
|
4
5
|
IN_TTY = sys.stdout.isatty()
|
|
5
6
|
CLEAR_LINE = "\033[2K"
|
|
6
7
|
UP_LINE = "\033[1F"
|
|
8
|
+
ANSI_ESCAPE = re.compile(r"(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]")
|
|
7
9
|
|
|
8
10
|
if IN_TTY:
|
|
9
11
|
|
|
@@ -23,6 +25,8 @@ else:
|
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
ICONS = ("/", "-", "\\", "|")
|
|
28
|
+
# ICONS = ("⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏")
|
|
29
|
+
|
|
26
30
|
# Unicode character bytes to render different symbols in the terminal
|
|
27
31
|
TICK = "\u2713"
|
|
28
32
|
X = "\u2717"
|
|
@@ -21,8 +21,9 @@ def get_num_lines(output: str, columns: int | None = None) -> int:
|
|
|
21
21
|
lines = 0
|
|
22
22
|
columns = columns or constants.COLUMNS()
|
|
23
23
|
for line in output.splitlines():
|
|
24
|
+
line = constants.ANSI_ESCAPE.sub("", line)
|
|
24
25
|
length = len(line)
|
|
25
|
-
lines += 1 * (length
|
|
26
|
+
lines += 1 * (length // columns + 1 if length > columns else 1)
|
|
26
27
|
return lines
|
|
27
28
|
|
|
28
29
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|