from distutils.core import setup
import py2app

py2app_options = dict(
    argv_emulation=True,
    argv_inject='--applet',
    includes=[
        "XmlRpcUriHandler",
        "debugWrapper",
    ],
#    excludes=["Foundation"],
    iconfile='TTBcomponents/ttb.icns',
    archs='ppc,i386',
)

plist = dict(
    CFBundleDocumentTypes=[
        dict(
            CFBundleTypeExtensions=["tbx"],
            CFBundleTypeName="Tinderbox document",
            CFBundleTypeRole="Editor",
            CFBundleTypeOSTypes=["Cere"],
        ),
        dict(
            CFBundleTypeExtensions=["xsl","xslt"],
            CFBundleTypeName="XSL Transform document",
            CFBundleTypeRole="Viewer",
            CFBundleTypeMIMETypes=["application/xml"],
        ),
    ],
)

setup(
    data_files = [
        "TinderToolBoxCli.py",
        "revertTbFile.app",
    ],
    app=[
        dict(script="TinderToolBox.py", plist=plist),
    ],
    options=dict(
        py2app=py2app_options,
    )
)

