@@ -66,7 +66,7 @@ def run_dependency(path_to_analyze, output_file_with_path, params=""):
6666 elif param == "-t" :
6767 github_token = value
6868 except Exception as ex :
69- logger .warning ("Set dependency Param:" + str ( ex ) )
69+ logger .warning (f "Set dependency Param: { ex } " )
7070
7171 try :
7272 success , result = call_analysis_api (path_to_analyze , "Dependency Analysis" ,
@@ -80,7 +80,7 @@ def run_dependency(path_to_analyze, output_file_with_path, params=""):
8080 if success :
8181 result_list = result .get ('SRC_FL_Dependency' )
8282 except Exception as ex :
83- logger .warning ("Run dependency:" + str ( ex ) )
83+ logger .warning (f "Run dependency: { ex } " )
8484
8585 if not result_list :
8686 result_list = []
@@ -135,7 +135,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
135135 sheet_list ["SRC_FL_Source" ] = [scan_item .get_row_to_print () for scan_item in result [2 ]]
136136 create_report_file (0 , result [2 ], result [3 ], 'all' , True , _output_dir , output_files ["SRC" ], "" )
137137 except Exception as ex :
138- logger .warning (f"Failed to run source analysis:{ ex } " )
138+ logger .warning (f"Failed to run source analysis: { ex } " )
139139
140140 if run_bin :
141141 success , _ = call_analysis_api (src_path , "Binary Analysis" ,
@@ -152,7 +152,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
152152 return
153153
154154 except Exception as ex :
155- logger .error (f"Scanning:{ ex } " )
155+ logger .error (f"Scanning: { ex } " )
156156
157157 try :
158158 output_file_without_ext = os .path .join (final_excel_dir , output_file )
@@ -162,12 +162,12 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
162162 if success and output_files :
163163 result_log ["Output File" ] = output_files .split ("," )
164164 else :
165- logger .error (f"Fail to generate a result file. :{ output_files } " )
165+ logger .error (f"Fail to generate a result file. : { output_files } " )
166166
167167 _str_final_result_log = yaml .safe_dump (result_log , allow_unicode = True , sort_keys = True )
168168 logger .info (_str_final_result_log )
169169 except Exception as ex :
170- logger .warning (f"Error to write final report:{ ex } " )
170+ logger .warning (f"Error to write final report: { ex } " )
171171
172172 try :
173173 if not keep_raw_data :
@@ -189,18 +189,18 @@ def download_source(link, out_dir):
189189 temp_src_dir = os .path .join (
190190 _output_dir , SRC_DIR_FROM_LINK_PREFIX + start_time )
191191
192- logger .info (f"Link to download : { link } " )
192+ logger .info (f"Link to download: { link } " )
193193 success , msg = cli_download_and_extract (
194194 link , temp_src_dir , _output_dir )
195195
196196 if success :
197- logger .info (f"Downloaded Dir:{ temp_src_dir } " )
197+ logger .info (f"Downloaded Dir: { temp_src_dir } " )
198198 else :
199199 temp_src_dir = ""
200- logger .error (f"Download failed:{ msg } " )
200+ logger .error (f"Download failed: { msg } " )
201201 except Exception as ex :
202202 success = False
203- logger .error (f"Failed to analyze from link:{ ex } " )
203+ logger .error (f"Failed to analyze from link: { ex } " )
204204 return success , temp_src_dir
205205
206206
@@ -222,7 +222,7 @@ def init(output_path=""):
222222 _output_dir = os .path .abspath (_output_dir )
223223
224224 log_dir = os .path .join (output_root_dir , "fosslight_log" )
225- logger , result_log = init_log (os .path .join (log_dir , _log_file + _start_time + " .txt" ),
225+ logger , result_log = init_log (os .path .join (log_dir , f" { _log_file } { _start_time } .txt" ),
226226 True , logging .INFO , logging .DEBUG , PKG_NAME )
227227
228228 return os .path .isdir (_output_dir ), output_root_dir , result_log
0 commit comments