@@ -125,47 +125,47 @@ def get_print_items(self):
125125 source_path = self .source_code_path
126126 item_license = self .license
127127
128- need_check , comment = get_comment ( self . comment , item_license , oss_name , self . notice , source_path )
129- print_items_txt . append (
130- self . bin_name + ' \t ' + source_path + ' \t ' + self . notice +
131- ' \t ' + oss_name + ' \t ' + self . oss_version + ' \t ' +
132- self .license + ' \t ' + need_check + ' \t ' + comment +
133- ' \t ' + self .tlsh + ' \t ' + self .checksum )
128+ empty_columns , license_to_notice = check_empty_column ( item_license , oss_name , source_path )
129+ comment = get_comment ( self . comment , license_to_notice , self . notice , empty_columns )
130+ if comment != "" :
131+ need_check = "O"
132+ print_items_txt . append ( f" { self .bin_name } \t { source_path } \t { self . notice } \t "
133+ f" { oss_name } \t { self .oss_version } \t { self . license } \t { need_check } \t { comment } \t { self . tlsh } \t { self .checksum } " )
134134 repo_link = self .download_location if self .is_new_bin else ""
135135 print_items_excel .append ([self .bin_name , source_path , self .notice , oss_name ,
136136 self .oss_version , self .license , repo_link , repo_link , '' , '' , '' , comment , need_check ])
137137
138138 if self .additional_oss_items is not None :
139139 for item in self .additional_oss_items :
140- print_items_txt .append (
141- self .bin_name + '\t ' + source_path + '\t ' + self .notice +
142- '\t ' + item + '\t ' + need_check + '\t ' + comment +
143- '\t ' + self .tlsh + '\t ' + self .checksum )
140+ print_items_txt .append (f"{ self .bin_name } \t { source_path } \t { self .notice } \t { item } "
141+ f"\t { need_check } \t { comment } \t { self .tlsh } \t { self .checksum } " )
144142 excel_item = [self .bin_name , source_path , self .notice ]
145143 excel_item .extend (item .split ('\t ' ))
146144 excel_item .extend (['' , '' , '' , '' , '' , comment , need_check ])
147145 print_items_excel .append (excel_item )
148146 return print_items_txt , print_items_excel
149147
150148
151- def get_comment (default_comment , license , oss_name , notice_value , directory ):
152- need_check = ""
153- comment = ""
149+ def check_empty_column (license , oss_name , directory ):
154150 empty_columns = []
155151 license_to_notice = True
156152
157- if license == CONST_NULL :
158- empty_columns .append ('License' )
159- else :
153+ if license != CONST_NULL :
160154 for license_item in license .split (',' ):
161155 if license_item in skip_license :
162156 license_to_notice = False
163157 break
164-
158+ else :
159+ empty_columns .append ('License' )
165160 if oss_name == CONST_NULL and license_to_notice :
166161 empty_columns .append ('OSS Name' )
167162 if directory == CONST_NULL :
168163 empty_columns .append ('Source Code Path' )
164+ return empty_columns , license_to_notice
165+
166+
167+ def get_comment (default_comment , license_to_notice , notice_value , empty_columns ):
168+ comment = ""
169169
170170 if empty_columns is not None and len (empty_columns ) > 0 :
171171 comment = "Fill in " + "," .join (empty_columns ) + "."
@@ -180,12 +180,9 @@ def get_comment(default_comment, license, oss_name, notice_value, directory):
180180 comment += "/"
181181 comment += "Add NOTICE to proper path."
182182
183- if comment != "" :
184- need_check = "O"
185-
186183 comment = default_comment + comment # Paste Auto ID comment in front.
187184
188- return need_check , comment
185+ return comment
189186
190187
191188def set_value_switch (bin , key , value ):
0 commit comments