Skip to content

Commit 1ac65fd

Browse files
author
Ethan Lee
committed
Fix the notice screen
Signed-off-by: Ethan Lee <[email protected]>
1 parent 5c45003 commit 1ac65fd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/fosslight_binary/cli.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@
1414
_PKG_NAME = "fosslight_binary"
1515

1616

17+
def get_terminal_size():
18+
size = shutil.get_terminal_size()
19+
return size.lines
20+
21+
22+
def paginate_file(file_path): #, lines_per_page=25):
23+
lines_per_page = get_terminal_size() - 1
24+
with open(file_path, 'r') as file:
25+
lines = file.readlines()
26+
27+
for i in range(0, len(lines), lines_per_page):
28+
os.system('clear' if os.name == 'posix' else 'cls')
29+
print(''.join(lines[i: i + lines_per_page]))
30+
if i + lines_per_page < len(lines):
31+
input("Press Enter to see the next page...")
32+
33+
1734
def main():
1835
global windows
1936
path_to_find_bin = ""

0 commit comments

Comments
 (0)