From 12bca1c4f6674bf9d8dec9241eb9dfe704f0d6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 30 Nov 2022 13:28:48 +0100 Subject: [PATCH] close files before writing --- Documentation/doc/scripts/html_output_post_processing.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/doc/scripts/html_output_post_processing.py b/Documentation/doc/scripts/html_output_post_processing.py index 44d15aa6d70..772a98b7424 100755 --- a/Documentation/doc/scripts/html_output_post_processing.py +++ b/Documentation/doc/scripts/html_output_post_processing.py @@ -236,6 +236,7 @@ def automagically_number_figures(): d = pq(file_content.read(), parser="html") d('a.el').each( lambda i: update_figure_ref(i,global_anchor_map) ) d('a.elRef').each( lambda i: update_figure_ref(i,global_anchor_map) ) + file_content.close() write_out_html(d, fname) ############################################################################### @@ -278,6 +279,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') tr_tags.each(lambda i: rearrange_img(i, dir_name)) span_tags = d('table.directory tr span') span_tags.each(lambda i: rearrange_icon(i, dir_name)) + file_content.close() write_out_html(d,fn) class_files=list(package_glob('./*/class*.html')) class_files.extend(package_glob('./*/struct*.html')) @@ -293,6 +295,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') ident = d('#nav-path .navelem').eq(0).children().eq(0) if ident and ident.attr('href') == 'namespaceCGAL.html': ident.attr('href', '../Manual/namespaceCGAL.html') + file_content.close() write_out_html(d, fn) namespace_files=package_glob('./*/namespace*.html') @@ -303,6 +306,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') if ident.size() == 1: conceptify_ns(d); d.remove("#CGALConceptNS") + file_content.close() write_out_html(d, fn) # in a group we only need to change the nested-classes @@ -311,6 +315,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') file_content = codecs.open(fn, 'r', encoding='utf-8') d = pq(file_content.read(), parser="html") conceptify_nested_classes(d) + file_content.close() write_out_html(d, fn) # fix up Files @@ -323,6 +328,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') if row_id != None: # figure out the rowid and then drop everything from the table that matches table("tr").filter(lambda i: re.match(row_id + '*', pq(this).attr('id'))).remove() + file_content.close() write_out_html(d, fn) #Rewrite the code for index trees images @@ -355,6 +361,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') # in hasModels.html, generalizes.html and refines.html, it is always Class. If this changes in # future versions of doxygen, the regular expression will be ready dts.each(lambda i: pq(this).html(re.sub("((Class )|(Struct ))", "Concept ", pq(this).html()))) + file_content.close() write_out_html(d, fn) # throw out nav-sync @@ -364,6 +371,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') d = pq(file_content.read(), parser="html") d('#nav-sync').hide() # TODO count figures + file_content.close() write_out_html(d, fn) # remove %CGAL in navtree: this should be a fix in doxygen but for now it does not worth it @@ -390,6 +398,7 @@ removes some unneeded files, and performs minor repair on some glitches.''') text = pq(el).text() if text[0:9]=="template<" and text.find('=')==-1: pq(el).remove() + file_content.close() write_out_html(d, fn) #add a canonical link to all pages