@@ -26,20 +26,19 @@ def find_report_file(path_to_find):
2626 file_with_path = os .path .join (path_to_find , file )
2727 if os .path .isfile (file_with_path ):
2828 return file
29- for p , d , f in os .walk (path_to_find ):
30- for file in f :
29+ for root , dirs , files in os .walk (path_to_find ):
30+ for file in files :
3131 file_name = file .lower ()
3232 if (file_name .startswith ("oss-report" ) or file_name .startswith ("fosslight-report" )) \
3333 and file_name .endswith (".xlsx" ):
34- return os .path .join (d , file )
35- except Exception :
36- pass
34+ return os .path .join (root , file )
35+ except Exception as error :
36+ logger . debug ( "Find report:" + str ( error ))
3737 return ""
3838
3939
4040def convert_report (base_path , files , output_name ):
4141 oss_pkg_files = ["oss-pkg-info.yml" , "oss-pkg-info.yaml" ]
42- base_path = ""
4342 file_option_on = False
4443 convert_yml_mode = False
4544 convert_excel_mode = False
@@ -79,9 +78,9 @@ def convert_report(base_path, files, output_name):
7978 if is_window :
8079 convert_yml_mode = True
8180 base_path = os .getcwd ()
82- convert_excel_mode = True
83- if report_to_read = = "" :
84- report_to_read = find_report_file ( base_path )
81+ report_to_read = find_report_file ( base_path )
82+ if report_to_read ! = "" :
83+ convert_excel_mode = True
8584 else :
8685 print_help_msg ()
8786
0 commit comments