Skip to content

Commit

Permalink
fix: progress no longer depends on tj
Browse files Browse the repository at this point in the history
  • Loading branch information
Apfelholz committed Nov 8, 2024
1 parent df2cb87 commit eafdc31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ptop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.")

0 comments on commit eafdc31

Please sign in to comment.