From bec83a3ea7414b07b49724439b68f33a585f3e8a Mon Sep 17 00:00:00 2001 From: Jaekwon Bang Date: Wed, 20 Mar 2024 13:53:16 +0900 Subject: [PATCH] Add TLSH, Checksum column at report --- requirements.txt | 2 +- src/fosslight_android/_common.py | 2 +- src/fosslight_android/_write_excel.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0db958b..05907f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -fosslight_util>=1.4.25 +fosslight_util>=1.4.37 fosslight_source>=1.6.16 fosslight_binary>=4.1.3 beautifulsoup4 diff --git a/src/fosslight_android/_common.py b/src/fosslight_android/_common.py index d1f93b4..d5c5f63 100644 --- a/src/fosslight_android/_common.py +++ b/src/fosslight_android/_common.py @@ -143,7 +143,7 @@ def get_print_items(self): f"\t{need_check}\t{comment}\t{self.tlsh}\t{self.checksum}") excel_item = [self.bin_name, source_path, self.notice] excel_item.extend(item.split('\t')) - excel_item.extend(['', '', '', '', '', comment, need_check]) + excel_item.extend(['', '', '', '', '', comment, need_check, self.tlsh, self.checksum]) print_items_excel.append(excel_item) return print_items_txt, print_items_excel diff --git a/src/fosslight_android/_write_excel.py b/src/fosslight_android/_write_excel.py index adfd2d3..a3067a5 100644 --- a/src/fosslight_android/_write_excel.py +++ b/src/fosslight_android/_write_excel.py @@ -7,8 +7,10 @@ import logging from fosslight_util.write_txt import write_txt_file from fosslight_util.constant import LOGGER_NAME +from fosslight_util.write_excel import hide_column logger = logging.getLogger(LOGGER_NAME) +HIDDEN_HEADER = ['TLSH', 'Checksum'] def write_result_to_excel(out_file_name, row_list): @@ -16,11 +18,13 @@ def write_result_to_excel(out_file_name, row_list): 'Download Location', 'Homepage', 'Copyright Text', 'License Text', 'Exclude', 'Comment', 'Need Check'] + header_row.extend(HIDDEN_HEADER) sheet_name = "BIN (Android)" try: workbook = xlsxwriter.Workbook(out_file_name) worksheet = create_worksheet(workbook, sheet_name, header_row) write_result_to_sheet(worksheet, row_list) + hide_column(worksheet, header_row, HIDDEN_HEADER) workbook.close() except Exception as ex: print('* Error :' + str(ex))