summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2011-03-30 17:19:43 +0200
committerVo Minh Thu <vmt@openerp.com>2011-03-30 17:19:43 +0200
commitb247657a6a55c4c1fc6fa41744b7c1b24671718d (patch)
treeb685f128966edcb62de5f580268fc00e2ac09bb5
parent0519496d0a446cf951102cce6568ece892d84cf5 (diff)
[FIX] setup.py: add pytz timezone files as data_files.
- this is needed for the windows packaging as py2exe will leave them out. - it was already done in the 5.0 branch, but implemented differently, by copying the files into the library.zip (which we dont use anymore in trunk). lp bug: https://launchpad.net/bugs/701407 fixed bzr revid: vmt@openerp.com-20110330151943-gvl1zg2yawa4vx5x
-rw-r--r--debian/control2
-rwxr-xr-xsetup.py15
2 files changed, 16 insertions, 1 deletions
diff --git a/debian/control b/debian/control
index d2fca92b5d8..11c98536526 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,7 @@ Package: openerp-server
Section: net
Architecture: all
Depends:
- ${misc:Depends}, adduser, python, python-dateutil, python-libxslt1,
+ ${misc:Depends}, adduser, python, python-dateutil, python-libxslt1,
python-lxml, python-psycopg2, python-pydot, python-pychart, python-reportlab,
python-tz, python-pyparsing, python-yaml, python-mako,
postgresql-client (>=8.2)
diff --git a/setup.py b/setup.py
index 76c59126e73..930b266e66b 100755
--- a/setup.py
+++ b/setup.py
@@ -104,6 +104,21 @@ if os.name == 'nt':
files.append((join('openerp',dp), map(lambda x: join('openerp', dp, x), names)))
os.chdir('..')
files.append(('openerp', [join('openerp', 'import_xml.rng'),]))
+
+ # copy pytz/timzeone
+ # TODO check if we have to also copy dateutil's timezone data.
+ import pytz
+ # Make sure the layout of pytz hasn't changed
+ assert (pytz.__file__.endswith('__init__.pyc') or
+ pytz.__file__.endswith('__init__.py')), pytz.__file__
+ pytz_dir = os.path.dirname(pytz.__file__)
+
+ saved_dir = os.getcwd()
+ os.chdir(pytz_dir)
+ for dp, dn, names in os.walk('zoneinfo'):
+ files.append((join('pytz',dp), map(lambda x: join(pytz_dir, dp, x), names)))
+ os.chdir(saved_dir)
+
return files
py2exe_data_files = data_files()