"""Keep the optional sections the user chose in dashboard.html, and delete the rest. Usage: python sections.py [checkpoints] [admin] [login] Each section sits between marker lines, in HTML, CSS and script: /* OPTIONAL:admin BEGIN */ // OPTIONAL:admin BEGIN ... ... ... /* OPTIONAL:admin END */ // OPTIONAL:admin END Chosen sections lose only their marker lines. Unchosen ones lose everything. The file is rewritten in place. Name no sections to remove all of them. """ import re import sys from pathlib import Path SECTIONS = ("checkpoints", "admin", "login") BLOCK = re.compile(r"^[ \t]*(?: