| 1 |
import os |
|---|
| 2 |
import glob |
|---|
| 3 |
import ez_setup # From http://peak.telecommunity.com/DevCenter/setuptools |
|---|
| 4 |
ez_setup.use_setuptools() |
|---|
| 5 |
|
|---|
| 6 |
from setuptools import setup, find_packages |
|---|
| 7 |
from dabo.__version__ import version |
|---|
| 8 |
|
|---|
| 9 |
daboVersion = version["version"] |
|---|
| 10 |
|
|---|
| 11 |
# List the paths under dabo/icon/themes: |
|---|
| 12 |
iconDir = os.path.join("dabo", "icons", "themes") |
|---|
| 13 |
iconDirs = {} |
|---|
| 14 |
def getIconSubDir(arg, dirname, fnames): |
|---|
| 15 |
if ".svn" not in dirname and "cards" not in dirname.lower() and dirname[-1] != "\\": |
|---|
| 16 |
icons = glob.glob(os.path.join(dirname, "*.png")) |
|---|
| 17 |
if icons: |
|---|
| 18 |
subdir = os.path.join(iconDir, dirname[len(arg)+1:]) |
|---|
| 19 |
subdir = subdir.replace(os.sep, ".") |
|---|
| 20 |
iconDirs[subdir] = ["*.png"] |
|---|
| 21 |
os.path.walk(iconDir, getIconSubDir, iconDir) |
|---|
| 22 |
|
|---|
| 23 |
# locale dirs: |
|---|
| 24 |
localeDir = os.path.join("dabo", "locale") |
|---|
| 25 |
localeDirs = [] |
|---|
| 26 |
def getLocaleDirs(arg, dirname, fnames): |
|---|
| 27 |
if ".svn" not in dirname and dirname[-1] != "\\": |
|---|
| 28 |
po_files = tuple(glob.glob(os.path.join(dirname, "*.po"))) |
|---|
| 29 |
mo_files = tuple(glob.glob(os.path.join(dirname, "*.mo"))) |
|---|
| 30 |
if po_files or mo_files: |
|---|
| 31 |
subdir = os.path.join(localeDir, dirname[len(arg)+1:]) |
|---|
| 32 |
localeDirs.append((subdir, po_files + mo_files)) |
|---|
| 33 |
os.path.walk(localeDir, getLocaleDirs, localeDir) |
|---|
| 34 |
|
|---|
| 35 |
package_data = { |
|---|
| 36 |
'':['ANNOUNCE', 'AUTHORS', 'ChangeLog', 'INSTALL', |
|---|
| 37 |
'LICENSE.TXT', 'README', 'TODO'], |
|---|
| 38 |
'dabo.icons': ['*.png', '*.ico'], |
|---|
| 39 |
'dabo.icons.cards.small': ['*.png', '*.ico'], |
|---|
| 40 |
'dabo.icons.cards.large': ['*.png', '*.ico'], |
|---|
| 41 |
'dabo.lib.reporting':['*.rfxml'], |
|---|
| 42 |
'dabo.lib.reporting_stefano':['*.rfxml'], |
|---|
| 43 |
'dabo.ui.uiwx.macImageProblem':['*.png'], |
|---|
| 44 |
'dabo.ui.uiwx.masked':['README'], |
|---|
| 45 |
} |
|---|
| 46 |
|
|---|
| 47 |
package_data.update(iconDirs) |
|---|
| 48 |
|
|---|
| 49 |
data_files = [ |
|---|
| 50 |
(os.path.join('dabo', 'locale'), glob.glob('dabo/locale/*.pot')), |
|---|
| 51 |
] |
|---|
| 52 |
data_files.extend(localeDirs) |
|---|
| 53 |
|
|---|
| 54 |
setup( |
|---|
| 55 |
name = "Dabo", |
|---|
| 56 |
version = daboVersion, |
|---|
| 57 |
url = 'http://dabodev.com/', |
|---|
| 58 |
download_url = 'ftp://dabodev.com/dabo/dabo-%s.zip' % daboVersion, |
|---|
| 59 |
author = 'Ed Leafe and Paul McNett', |
|---|
| 60 |
author_email = 'dev@dabodev.com', |
|---|
| 61 |
description = 'Dabo 3-tier Application Framework', |
|---|
| 62 |
license = 'MIT', |
|---|
| 63 |
packages = find_packages(), |
|---|
| 64 |
package_data = package_data, |
|---|
| 65 |
data_files = data_files |
|---|
| 66 |
) |
|---|