#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-3.0-or-later """Refresh bundled credits/art from repository sources; needs librsvg for PDFs.""" from pathlib import Path import re import shutil import subprocess ROOT = Path(__file__).resolve().parents[3] OUT = ROOT / 'platforms/macos/Resources/About' OUT.mkdir(exist_ok=True) for name in ['dezota', 'dezota-dark', 'founder']: subprocess.run(['rsvg-convert', '-f', 'pdf', '-o', str(OUT / (name + '.pdf')), str(ROOT / 'docs/media/about' / (name + '.svg'))], check=True) source = (ROOT / 'platforms/windows/Vcc.rc').read_text() section = source[source.index('IDD_ABOUTBOX DIALOGEX'):source.index('IDD_FUNCTION_KEYS DIALOGEX')] paragraphs = re.findall(r'LTEXT\s+"([^"]+)"', section) (OUT / 'WindowsAbout.txt').write_text('\n\n'.join(p.rstrip() for p in paragraphs[2:]) + '\n') for source, target in [('COPYING', 'GPL.txt'), ('platforms/windows/resources/vcc.bmp', 'windows-vcc.bmp'), ('platforms/windows/resources/3guys.bmp', 'windows-founders.bmp')]: shutil.copyfile(ROOT / source, OUT / target) # The approved CopyrightNotice, ArtworkNotice, ROMNotice and concise # ThirdPartyNotices are authored resources, not generated from design history.