pyallel 1.2.7__tar.gz → 1.2.8__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: 1.2.7
3
+ Version: 1.2.8
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 = "1.2.7"
3
+ version = "1.2.8"
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"
@@ -23,9 +23,12 @@ class Printer:
23
23
  end: str = "\n",
24
24
  truncate: bool = False,
25
25
  ) -> None:
26
+ truncate_num = 0
26
27
  prefix = self._prefix if include_prefix else ""
28
+ if prefix:
29
+ truncate_num = 6
27
30
  if truncate:
28
- columns = constants.COLUMNS() - len(prefix)
31
+ columns = constants.COLUMNS() - truncate_num
29
32
  if get_num_lines(line, columns) > 1:
30
33
  line = truncate_line(line, columns)
31
34
  print(f"{prefix}{line}", end=end, flush=True)
@@ -79,8 +82,7 @@ class Printer:
79
82
  lines = output.data.splitlines(keepends=True)
80
83
 
81
84
  if tail_output:
82
- status_lines = get_num_lines(status)
83
- output_lines = output.lines - status_lines
85
+ output_lines = output.lines - 1
84
86
  lines = lines[-output_lines:]
85
87
 
86
88
  for line in lines:
@@ -136,14 +138,23 @@ class Printer:
136
138
  if not icon:
137
139
  msg += "..."
138
140
 
139
- out = f"{self._colours.white_bold}[{self._colours.reset_colour}{self._colours.blue_bold}{output.process.command}{self._colours.reset_colour}{self._colours.white_bold}]{self._colours.reset_colour}{colour} {msg} {icon}{self._colours.reset_colour}"
140
-
141
+ timer = ""
141
142
  if include_timer:
142
143
  end = output.process.end
143
144
  if not output.process.end:
144
145
  end = time.perf_counter()
145
146
  elapsed = end - output.process.start
146
- out += f" {self._colours.dim_on}({format_time_taken(elapsed)}){self._colours.dim_off}"
147
+ timer = f"({format_time_taken(elapsed)})"
148
+
149
+ command = output.process.command
150
+ if get_num_lines(output.process.command) > 1:
151
+ columns = constants.COLUMNS() - (len(msg) + len(timer) + 9)
152
+ command = truncate_line(command, columns)
153
+
154
+ out = f"{self._colours.white_bold}[{self._colours.reset_colour}{self._colours.blue_bold}{command}{self._colours.reset_colour}{self._colours.white_bold}]{self._colours.reset_colour}{colour} {msg} {icon}{self._colours.reset_colour}"
155
+
156
+ if timer:
157
+ out += f" {self._colours.dim_on}{timer}{self._colours.dim_off}"
147
158
 
148
159
  return out
149
160
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes