rich_subproc 1.2.0__tar.gz → 1.2.2__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.4
2
2
  Name: rich-subproc
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Simple python subprocess wrapper to do some pretty printing and error handling.
5
5
  License-Expression: AGPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rich-subproc"
3
- version = "1.2.0"
3
+ version = "1.2.2"
4
4
  description = "Simple python subprocess wrapper to do some pretty printing and error handling."
5
5
  Authors = ["Jesse Hitch <jessebot@linux.com>"]
6
6
  readme = "README.md"
@@ -1,9 +1,10 @@
1
+ #!/usr/bin/env python3
1
2
  """
2
3
  Using Textualize's rich library to pretty print subprocess outputs,
3
4
  so during long running commands, the user isn't wondering what's going on,
4
5
  even if you don't actually output anything from stdout/stderr of the command.
5
6
 
6
- Author: https://jessebot.work
7
+ Author: Jesse Hitch https://jessebot.work
7
8
  License: AGPL
8
9
  """
9
10
  import logging as log
@@ -148,11 +149,11 @@ def run_subprocess(command: str, decode_ascii: bool = False, **kwargs):
148
149
  log.info(res_stderr)
149
150
 
150
151
  # check return code, raise error if failure
151
- if not return_code or return_code != 0:
152
+ if type(return_code) is not int or return_code != 0:
152
153
  # also scan both stdout and stdin for weird errors
153
154
  for output in [res_stdout.lower(), res_stderr.lower()]:
154
155
  if 'error' in output:
155
- err = f'Return code: "{str(return_code)}". Expected code is 0.'
156
+ err = f'Return code: {str(return_code)}. Expected code is 0.'
156
157
  error_msg = f'\033[0;33m{err}\n{output}\033[00m'
157
158
  if error_ok and not quiet:
158
159
  log.error(error_msg)
@@ -196,5 +197,5 @@ def simple_loading_bar(tasks: dict, time_to_wait: int = 120) -> None:
196
197
  progress.update(task1, completed=time_to_wait)
197
198
  sleep(.1)
198
199
  break
199
- print('')
200
+ print()
200
201
  return
File without changes
File without changes