From eafdc31844f8f18373fc11adc52d1d28d465e470 Mon Sep 17 00:00:00 2001 From: Apfelholz <149402866+Apfelholz@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:59:31 +0100 Subject: [PATCH] fix: progress no longer depends on tj --- ptop.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ptop.py b/ptop.py index 3cdc0dc..a051635 100644 --- a/ptop.py +++ b/ptop.py @@ -38,8 +38,8 @@ def parse(input_line: str) -> dict: return parsed -def progress(lines, total_jops): - return (len(lines) / tj) * 100 if tj else 0 +def progress(lines, total_jobs): + return (len(lines) / total_jobs) * 100 if total_jobs else 0 def ascii_progress_bar(percentage, bar_length=50): @@ -125,4 +125,4 @@ def ascii_progress_bar(percentage, bar_length=50): except IOError as e: print(f"Error reading the file '{args.logfile}': {e}") except ZeroDivisionError: - print("Error: Total jobs parameter must be a positive integer.") + print("Error: Total jobs parameter must be a positive integer.") \ No newline at end of file