|
14 | 14 | from bs4 import BeautifulSoup |
15 | 15 | import fosslight_util.constant as constant |
16 | 16 | from fosslight_util.compare_yaml import compare_yaml |
17 | | -from fosslight_util.convert_excel_to_yaml import convert_excel_to_yaml |
| 17 | +from fosslight_util.read_excel import read_oss_report |
| 18 | +from fosslight_util.parsing_yaml import parsing_yml |
18 | 19 |
|
19 | 20 | logger = logging.getLogger(constant.LOGGER_NAME) |
20 | 21 | ADD = "add" |
@@ -255,10 +256,18 @@ def run_compare(before_f, after_f, output_path, output_file, file_ext, _start_ti |
255 | 256 |
|
256 | 257 | result_file = get_comparison_result_filename(output_path, output_file, file_ext, _start_time) |
257 | 258 |
|
258 | | - if before_ext == XLSX_EXT: |
259 | | - convert_excel_to_yaml(before_f, before_yaml) |
260 | | - convert_excel_to_yaml(after_f, after_yaml) |
261 | | - compared_result = compare_yaml(before_yaml, after_yaml) |
| 259 | + before_basepath = os.path.dirname(before_f) |
| 260 | + after_basepath = os.path.dirname(after_f) |
| 261 | + if XLSX_EXT == before_ext: |
| 262 | + before_fileitems = read_oss_report(before_f, "", before_basepath) |
| 263 | + elif YAML_EXT == before_ext: |
| 264 | + before_fileitems, _, _ = parsing_yml(before_yaml, before_basepath) |
| 265 | + if XLSX_EXT == after_ext: |
| 266 | + after_fileitems = read_oss_report(after_f, after_basepath) |
| 267 | + elif YAML_EXT == after_ext: |
| 268 | + after_fileitems, _, _ = parsing_yml(after_yaml, after_basepath) |
| 269 | + |
| 270 | + compared_result = compare_yaml(before_fileitems, after_fileitems) |
262 | 271 | if compared_result != '': |
263 | 272 | count_compared_result(compared_result) |
264 | 273 | ret, result_file = write_compared_result(result_file, compared_result, file_ext, before_yaml, after_yaml) |
|
0 commit comments