"""
This is a setup.py script generated by py2applet

Usage:
    python py2app_setup.py py2app
"""

import py2app
import os

from setuptools import setup

def check_mode() -> str:
    match os.environ:
        case {"CI_MODE": b}:
            if b:
                return "Ci"
        case {"TEST_MODE": b}:
            if b:
                return "Test"
    return ""

MODE = check_mode()

APP = [f"PINPalMac/{MODE}PINPal.py"]
DATA_FILES = [
    "PINPalMac/MainMenu.xib",
    "PINPalMac/PINList.xib",
]
OPTIONS = {
    "plist": {
        "LSUIElement": True,
        "NSRequiresAquaSystemAppearance": False,
        "CFBundleIdentifier": f"im.glyph.and.this.is.{MODE}pinpal",
        "CFBundleName": f"{MODE}PINPal",
    },
    "iconfile": f"{MODE}icon.icns",
    "app": APP,
}

setup(
    data_files=DATA_FILES,
    options={"py2app": OPTIONS},
)
