Skip to content

Commit 542d6bd

Browse files
committed
Fix the version of psycopg2-binary
Signed-off-by: jiyeong.seok <[email protected]>
1 parent da28cfd commit 542d6bd

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ binaryornot
22
numpy
33
pandas
44
parmap
5-
psycopg2-binary
5+
psycopg2-binary==2.9.9
66
python-dateutil
77
py-tlsh
88
pytz

src/fosslight_binary/cli.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import argparse
66
import sys
77
import os
8+
import shutil
89
from fosslight_util.help import print_package_version
910
from fosslight_binary._help import print_help_msg
1011
from fosslight_binary.binary_analysis import find_binaries
@@ -13,6 +14,23 @@
1314
_PKG_NAME = "fosslight_binary"
1415

1516

17+
def get_terminal_size():
18+
size = shutil.get_terminal_size()
19+
return size.lines
20+
21+
22+
def paginate_file(file_path):
23+
lines_per_page = get_terminal_size() - 1
24+
with open(file_path, 'r', encoding='utf8') 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+
1634
def main():
1735
global windows
1836
path_to_find_bin = ""
@@ -85,8 +103,10 @@ def main():
85103
data_path = os.path.join(base_path, 'LICENSES')
86104
print(f"*** {_PKG_NAME} open source license notice ***")
87105
for ff in os.listdir(data_path):
88-
f = open(os.path.join(data_path, ff), 'r', encoding='utf8')
89-
print(f.read())
106+
source_file = os.path.join(data_path, ff)
107+
destination_file = os.path.join(base_path, ff)
108+
paginate_file(source_file)
109+
shutil.copyfile(source_file, destination_file)
90110
sys.exit(0)
91111

92112
timer = TimerThread()

0 commit comments

Comments
 (0)