-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
91 lines (82 loc) · 2.39 KB
/
setup.py
File metadata and controls
91 lines (82 loc) · 2.39 KB
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
82
83
84
85
86
87
88
89
90
91
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
import sys
import os
import glob
import dabo
import dabo.icons
APP = ['main.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True}
plat = sys.platform
daboDir = os.path.split(dabo.__file__)[0]
# Find the location of the dabo icons:
iconDir = os.path.split(dabo.icons.__file__)[0]
iconSubDirs = []
def getIconSubDir(arg, dirname, fnames):
if os.path.split(dirname)[1] in (".svn", "cards"):
return
icons = glob.glob(os.path.join(dirname, "*.png"))
if icons:
subdir = (os.path.join("resources", dirname[len(arg)+1:]), icons)
iconSubDirs.append(subdir)
os.path.walk(iconDir, getIconSubDir, iconDir)
DATA_FILES.extend(iconSubDirs)
# locales:
localeDir = os.path.join(daboDir, "locale")
locales = []
def getLocales(arg, dirname, fnames):
if os.path.split(dirname)[1] in (".svn", ):
return
mo_files = tuple(glob.glob(os.path.join(dirname, "*.mo")))
if mo_files:
subdir = os.path.join("locale", dirname[len(arg)+1:])
locales.append((subdir, mo_files))
os.path.walk(localeDir, getLocales, localeDir)
DATA_FILES.extend(locales)
# Application files. Include all but .pyc
appDir = os.getcwd()
appFiles = []
def getAppFiles(arg, dirname, fnames):
if os.path.split(dirname)[1] in (".svn", "supplemental", "test"):
return
currnames = glob.glob(os.path.join(dirname, "*"))
filtered = tuple([nm for nm in currnames
if not nm.endswith(".pyc")
and not os.path.isdir(nm)])
if filtered:
subdir = dirname[len(arg)+1:]
appFiles.append((subdir, filtered))
os.path.walk(appDir, getAppFiles, appDir)
DATA_FILES.extend(appFiles)
if plat == "darwin":
# OS X
OPTIONS = {
"excludes": ["psycopg2", "MySQLdb", "numpy", "wxPython"],
"includes": ["mx", "wx", "wx.lib.calendar", "wx.gizmos"],
"optimize": 2,
"argv_emulation": True,
"resources": DATA_FILES,
"plist": dict(CFBundleGetInfoString="1.1",
CFBundleIdentifier="com.dabodev.springboard",
LSPrefersPPC=False,
NSHumanReadableCopyright="Copyright 2009-2010 Ed Leafe"
),
"iconfile": "springboard.icns"}
elif plat == "win32":
# Windows
import py2exe
OPTIONS = {"excludes": ["psycopg2", "MySQLdb", "numpy", "kinterbasdb"]}
setup(
app=APP,
version = "1.1",
description = "Dabo Springboard",
name = "Dabo Springboard",
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)