-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
81 lines (70 loc) · 2.54 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from distutils.core import setup
from notecomb import NoteCombFrame
def py2app_options(setup_args):
try:
import py2app
# create py2app options
py2app_plist = {
'CFBundleName': "NoteComb",
'CFBundleShortVersionString': NoteCombFrame.__APP_VERSION__,
'CFBundleGetInfoString': "NoteComb %s" % NoteCombFrame.__APP_VERSION__,
'CFBundleExecutable': "NoteComb",
'CFBundleIdentifier': "com.psychicorigami.notecomb",
'CFBundleDocumentTypes': [ { 'CFBundleTypeExtensions': ["*"], 'CFBundleTypeName': "kUTTypeText", 'CFBundleTypeRole': "Editor", "CFBundleTypeIconFile": "combdoc.icns" } ],
}
setup_args['options']['py2app']={
'argv_emulation': 1,
'iconfile': 'resources/comb.icns',
'resources': ['resources/combdoc.icns'],
'plist': py2app_plist,
}
setup_args['app']=[ 'main.py' ]
# end py2app options
except ImportError:
pass
def py2exe_options(setup_args):
try:
import py2exe
# create py2exe options
py2exe_manifest = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="x86"
name="Controls"
type="win32"
/>
<description>Observertron</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
"""
setup_args['windows']=[{
'script': "main.py",
'name': "NoteComb",
'dest_base': "NoteComb",
'version': NoteCombFrame.__APP_VERSION__,
"other_resources": [(24,1,py2exe_manifest)],
"icon_resources": [(1, "resources/icon.ico")]
}]
setup_args['options']['py2exe']={'bundle_files': 1}
setup_args['zipfile'] = None
# end of py2exe options
except ImportError:
pass
setup_args={'options':{}}
py2app_options(setup_args)
py2exe_options(setup_args)
# now run setup
setup(**setup_args)