@@ -83,12 +83,12 @@ def main():
8383 timer .setDaemon (True )
8484 timer .start ()
8585
86- start_time = datetime .now ().strftime ('%Y %m%d_%H%M%S ' )
86+ _start_time = datetime .now ().strftime ('%y %m%d_%H%M' )
8787 success , msg , output_path , output_file , output_extension = check_output_format (output_file_name , format )
8888 if not success :
8989 logger .error (f"Format error. { msg } " )
9090 sys .exit (1 )
91- logger , _result_log = init_log (os .path .join (output_path , "fosslight_src_log_" + start_time + " .txt" ),
91+ logger , _result_log = init_log (os .path .join (output_path , f"fosslight_log_ { _start_time } .txt" ),
9292 True , logging .INFO , logging .DEBUG , _PKG_NAME , path_to_scan )
9393
9494 if os .path .isdir (path_to_scan ):
@@ -107,7 +107,7 @@ def main():
107107 else :
108108 print_help_msg_source ()
109109 sys .exit (1 )
110- create_report_file (start_time , scanned_result , license_list , selected_scanner , print_matched_text ,
110+ create_report_file (_start_time , scanned_result , license_list , selected_scanner , print_matched_text ,
111111 output_path , output_file , output_extension )
112112 try :
113113 logger .info (yaml .safe_dump (_result_log , allow_unicode = True , sort_keys = True ))
@@ -118,7 +118,7 @@ def main():
118118 sys .exit (1 )
119119
120120
121- def create_report_file (start_time , scanned_result , license_list , selected_scanner , need_license = False ,
121+ def create_report_file (_start_time , scanned_result , license_list , selected_scanner , need_license = False ,
122122 output_path = "" , output_file = "" , output_extension = "" ):
123123 """
124124 Create report files for given scanned result.
@@ -131,7 +131,6 @@ def create_report_file(start_time, scanned_result, license_list, selected_scanne
131131 extended_header = {}
132132 sheet_list = {}
133133 _json_ext = ".json"
134- _yaml_ext = ".yaml"
135134
136135 if output_path == "" :
137136 output_path = os .getcwd ()
@@ -140,11 +139,9 @@ def create_report_file(start_time, scanned_result, license_list, selected_scanne
140139
141140 if output_file == "" :
142141 if output_extension == _json_ext :
143- output_file = f"Opossum_input_{ start_time } "
144- if output_extension == _yaml_ext :
145- output_file = f"fosslight-sbom-info_{ start_time } "
142+ output_file = f"fosslight_opossum_{ _start_time } "
146143 else :
147- output_file = f"FOSSLight-Report_ { start_time } "
144+ output_file = f"fosslight_report_ { _start_time } "
148145
149146 if scanned_result :
150147 scanned_result = sorted (scanned_result , key = lambda row : ('' .join (row .licenses )))
0 commit comments