INNER CODE UNIT · Python

parse_args

mtkennerly/ludusavi · scripts/generate-macos-icon.py:17

def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("input", type=Path, help="source SVG file")
    parser.add_argument("output", type=Path, help="output ICNS file")
    return parser.parse_args()


def main() -> None:
    args = parse_args()

    if shutil.which("rsvg-convert") is None:
        sys.exit("rsvg-convert is required; install librsvg before generating the macOS icon")

    try:
        from PIL import Image
    except ImportError:
        sys.exit("Pillow is required; install it with: python3 -m pip install pillow")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…