@@ -96,22 +96,26 @@ def find_files_by_extension(path):
9696 return files
9797
9898
99- def read_notice_file (notice_file_path ):
100- final_notice_file = {}
99+ def read_notice_file (notice_file_path , notice_html_file ):
100+ final_notice_file = {}
101+ # NOTICE.html need to be skipped the errors related to decode
101102 encodings = ["latin-1" , "utf-8" , "utf-16" ]
102- notice_files = []
103+ notice_files = []
104+
105+ if notice_html_file != "" :
106+ notice_files = notice_html_file .split ("," )
107+ else :
108+ if os .path .isfile (notice_file_path ):
109+ notice_files .append (notice_file_path )
110+ if notice_file_path .endswith (".html" ) or notice_file_path .endswith (".xml" ) or notice_file_path .endswith (".txt" ):
111+ notice_file_path = os .path .dirname (notice_file_path )
112+
113+ if os .path .isdir (notice_file_path ):
114+ additional_notice_files = find_files_by_extension (notice_file_path )
115+ if len (additional_notice_files ) > 0 :
116+ notice_files .extend (additional_notice_files )
117+ notice_files = list (set (notice_files ))
103118
104- if os .path .isfile (notice_file_path ):
105- notice_files .append (notice_file_path )
106- if notice_file_path .endswith (".html" ) or notice_file_path .endswith (".xml" ) or notice_file_path .endswith (".txt" ):
107- notice_file_path = os .path .dirname (notice_file_path )
108-
109- if os .path .isdir (notice_file_path ):
110- additional_notice_files = find_files_by_extension (notice_file_path )
111- if len (additional_notice_files ) > 0 :
112- notice_files .extend (additional_notice_files )
113- notice_files = list (set (notice_files ))
114-
115119 for file_name in notice_files :
116120 file_list = {}
117121 file_content = ""
0 commit comments