-
Notifications
You must be signed in to change notification settings - Fork 25
/
setup.py
81 lines (65 loc) · 2.22 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
import glob
import os
from setuptools import find_packages, setup
from setuptools.command.sdist import sdist as _sdist
from dabo.version import __version__
setupDir = os.path.dirname(__file__)
# List the paths under dabo/icon/themes:
iconDir = os.path.join(setupDir, "dabo", "icons", "themes")
iconDirs = {}
def getIconSubDir(arg, dirname, fnames):
if "cards" not in dirname.lower() and dirname[-1] != "\\":
icons = glob.glob(os.path.join(dirname, "*.png"))
if icons:
subdir = os.path.join(iconDir, dirname[len(arg) + 1 :])
subdir = subdir.replace(os.sep, ".")
iconDirs[subdir] = ["*.png"]
os.walk(iconDir, getIconSubDir, iconDir)
# locale dirs:
localeDir = os.path.join(setupDir, "dabo", "locale")
localeDirs = []
def getLocaleDirs(arg, dirname, fnames):
if dirname[-1] != "\\":
po_files = tuple(glob.glob(os.path.join(dirname, "*.po")))
mo_files = tuple(glob.glob(os.path.join(dirname, "*.mo")))
if po_files:
subdir = os.path.join(localeDir, dirname[len(arg) + 1 :])
localeDirs.append((subdir, ["*.po"]))
if mo_files:
subdir = os.path.join(localeDir, dirname[len(arg) + 1 :])
localeDirs.append((subdir, ["*.po"]))
os.walk(localeDir, getLocaleDirs, localeDir)
package_data = {
"": [
"ANNOUNCE",
"AUTHORS",
"ChangeLog",
"INSTALL",
"LICENSE.TXT",
"README",
"TODO",
],
"dabo.icons": ["*.png", "*.ico"],
"dabo.icons.cards.small": ["*.png", "*.ico"],
"dabo.icons.cards.large": ["*.png", "*.ico"],
"dabo.lib.reporting": ["*.rfxml"],
"dabo.lib.reporting_stefano": ["*.rfxml"],
"dabo.ui.uiwx.macImageProblem": ["*.png"],
"dabo.ui.uiwx.masked": ["README"],
}
package_data.update(iconDirs)
package_data.update(localeDirs)
version = __version__
setup(
name="Dabo",
version=version,
url="http://dabodev.com/",
download_url="https://github.com/dabodev/dabo/archive/v%s.zip" % version,
author="Ed Leafe and Paul McNett",
author_email="dev@dabodev.com",
description="Dabo 3-tier Application Framework",
license="MIT",
packages=find_packages(),
package_data=package_data,
include_package_data=True,
)