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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
import os
import re
import sys
import glob
from setuptools import setup
from setup_py2exe_custom import custom_py2exe, fixup_data_pytz_zoneinfo
execfile(os.path.join("openobject", "release.py"))
version_dash_incompatible = False
if 'bdist_rpm' in sys.argv:
version_dash_incompatible = True
try:
import py2exe
from py2exe_utils import opts
opts['options'].setdefault('py2exe',{})
opts['options']['py2exe'].setdefault('includes',[])
opts['options']['py2exe']['includes'].extend([
'win32api',
'win32con',
'win32event',
'win32service',
'win32serviceutil',
])
opts['options']['py2exe'].update(
skip_archive=1,
compressed=0,
bundle_files=3,
optimize=0,
collected_libs_dir='libs',
collected_libs_data_relocate='babel,pytz',
)
opts.setdefault('data_files', []).extend(fixup_data_pytz_zoneinfo())
opts.update(cmdclass={'py2exe': custom_py2exe},)
version_dash_incompatible = True
except ImportError:
opts = {}
if version_dash_incompatible:
version = version.split('-')[0]
FILE_PATTERNS = \
r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$'
def find_data_files(source, patterns=FILE_PATTERNS):
file_matcher = re.compile(patterns, re.I)
out = []
for base, _, files in os.walk(source):
cur_files = []
for f in files:
if file_matcher.match(f):
cur_files.append(os.path.join(base, f))
if cur_files:
out.append(
(base, cur_files))
return out
if os.name == 'nt':
sys.path.append("C:\Microsoft.VC90.CRT")
opts.setdefault('data_files',[]).extend([
("Microsoft.VC90.CRT", glob.glob('C:\Microsoft.VC90.CRT\*.*')),
(os.path.join('service', "Microsoft.VC90.CRT"), glob.glob('C:\Microsoft.VC90.CRT\*.*')),
])
setup(
name=name,
version=version,
description=description,
long_description=long_description,
author=author,
author_email=author_email,
url=url,
download_url=download_url,
license=license,
install_requires=[
"CherryPy == 3.1.2",
"Mako >= 0.2.4",
"Babel >= 0.9.4",
"FormEncode >= 1.2.2",
"simplejson >= 2.0.9",
"python-dateutil >= 1.4.1",
"pytz >= 2009j"
],
zip_safe=False,
packages=[
'openobject',
'openobject.admin',
'openobject.admin.i18n',
'openobject.controllers',
'openobject.i18n',
'openobject.test',
'openobject.tools',
'openobject.widgets'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Environment :: Web Environment',
'Topic :: Office/Business :: Financial',
],
scripts=['scripts/openerp-web'],
data_files=(find_data_files('addons/openerp')
+ find_data_files('addons/view_calendar')
+ find_data_files('addons/view_diagram')
+ find_data_files('addons/view_graph')
+ find_data_files('addons/widget_ckeditor')
+ find_data_files('doc', patterns='')
+ find_data_files('openobject', patterns=r'.+\.(cfg|css|js|mako|gif|png|jpg|ico)')
+ find_data_files('revprox', patterns='')
+ opts.pop('data_files', [])
),
**opts
)
|