Re: [PATCH yocto-autobuilder-helper v12] Add a banner on the old documentation docs.


Abongwa Amahnui Bonalais <abongwabonalais@...>
 

Hi Quentin

On Tue, May 3, 2022 at 10:51 AM, Quentin Schulz wrote:
+
+
+
+def dunfell_tags(dir):
+ dunfell_banners = []
+ for root, dirs, filenames in os.walk(dir):
+ dunfell_banners = [ name for name in os.listdir(dir) if not name.startswith('3.1') ]
+ for d in dirs:
+ if d in dunfell_banners:
+ dirs.remove(d)
+
+ for filename in filenames:
+ if filename.endswith('.html'):
+ with open(os.path.join(root, filename), 'r', encoding="ISO-8859-1") as f:
+ current_content = f.read()
+ with open(os.path.join(root, filename), 'w') as f:
+ f.write(current_content.replace('<body>', '<body>' + html_content_dunfell))
+ f.write(current_content.replace('</body>', last_div + '</body>'))
+ if filename.endswith('.css'):
+ with open(os.path.join(root, filename), 'r', encoding="ISO-8859-1") as f:
+ css_content = f.read()
+ with open(os.path.join(root, filename), 'w') as f:
+ f.write(css_content.replace(css_content[css_content.find('body {'):css_content.find('}'[0])], 'body {' + css_replacement_content ))
+ print(dunfell_banners)
This is all extremely complex just for using a different variable depending on the name of the directory.
I wish to ask if your'e referring to the last line of code or this entire function, I have actuallly removed the print(dunfell_banners) line

Thanks a lot for reviewing.

Join {yocto@lists.yoctoproject.org to automatically receive all group messages.