@@ -83,12 +83,12 @@ def main():
83
83
timer .setDaemon (True )
84
84
timer .start ()
85
85
86
- start_time = datetime .now ().strftime ('%Y %m%d_%H%M%S ' )
86
+ _start_time = datetime .now ().strftime ('%y %m%d_%H%M' )
87
87
success , msg , output_path , output_file , output_extension = check_output_format (output_file_name , format )
88
88
if not success :
89
89
logger .error (f"Format error. { msg } " )
90
90
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" ),
92
92
True , logging .INFO , logging .DEBUG , _PKG_NAME , path_to_scan )
93
93
94
94
if os .path .isdir (path_to_scan ):
@@ -107,7 +107,7 @@ def main():
107
107
else :
108
108
print_help_msg_source ()
109
109
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 ,
111
111
output_path , output_file , output_extension )
112
112
try :
113
113
logger .info (yaml .safe_dump (_result_log , allow_unicode = True , sort_keys = True ))
@@ -118,7 +118,7 @@ def main():
118
118
sys .exit (1 )
119
119
120
120
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 ,
122
122
output_path = "" , output_file = "" , output_extension = "" ):
123
123
"""
124
124
Create report files for given scanned result.
@@ -131,7 +131,6 @@ def create_report_file(start_time, scanned_result, license_list, selected_scanne
131
131
extended_header = {}
132
132
sheet_list = {}
133
133
_json_ext = ".json"
134
- _yaml_ext = ".yaml"
135
134
136
135
if output_path == "" :
137
136
output_path = os .getcwd ()
@@ -140,11 +139,9 @@ def create_report_file(start_time, scanned_result, license_list, selected_scanne
140
139
141
140
if output_file == "" :
142
141
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 } "
146
143
else :
147
- output_file = f"FOSSLight-Report_ { start_time } "
144
+ output_file = f"fosslight_report_ { _start_time } "
148
145
149
146
if scanned_result :
150
147
scanned_result = sorted (scanned_result , key = lambda row : ('' .join (row .licenses )))
0 commit comments