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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyallel
3
- Version: 0.18.1
3
+ Version: 0.18.3
4
4
  Summary: Run and handle the output of multiple executables in pyallel (as in parallel)
5
5
  Home-page: https://github.com/Danthewaann/pyallel
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyallel"
3
- version = "0.18.1"
3
+ version = "0.18.3"
4
4
  description = "Run and handle the output of multiple executables in pyallel (as in parallel)"
5
5
  authors = ["Daniel Black <danielcrblack@gmail.com>"]
6
6
  license = "MIT"
@@ -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 % columns + 1 if length > columns else 1)
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