Skip to content

Commit

Permalink
Fix the flake8 error
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Lee <seojethan.lee@lge.com>
  • Loading branch information
Ethan Lee committed Nov 11, 2024
1 parent 0fac3e5 commit 6e7f9e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/fosslight_binary/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@
_PKG_NAME = "fosslight_binary"


def get_terminal_size():

def get_terminal_size():
size = shutil.get_terminal_size()
return size.lines

def paginate_file(file_path):
def paginate_file(file_path):
lines_per_page = get_terminal_size() - 1
with open(file_path, 'r') as file:
lines = file.readlines()

for i in range(0, len(lines), lines_per_page):
os.system('clear' if os.name == 'posix' else 'cls')
print(''.join(lines[i:i+lines_per_page]))
print(''.join(lines[i : i + lines_per_page]))
if i + lines_per_page < len(lines):
input("Press Enter to see the next page...")

Expand Down

0 comments on commit 6e7f9e1

Please sign in to comment.