We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c45003 commit 1ac65fdCopy full SHA for 1ac65fd
src/fosslight_binary/cli.py
@@ -14,6 +14,23 @@
14
_PKG_NAME = "fosslight_binary"
15
16
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
34
def main():
35
global windows
36
path_to_find_bin = ""
0 commit comments