-# setup from TinERP
-# taken from straw http://www.nongnu.org/straw/index.html
-# taken from gnomolicious http://www.nongnu.org/gnomolicious/
-# adapted by Nicolas Évrard <nicoe@altern.org>
-#
-
-import imp
-import sys
-import os
-from os.path import join, isfile, basename
-import glob
-
-from distutils.core import setup, Command
-from distutils.command.install import install
-
-has_py2exe = False
-if os.name == 'nt':
- import py2exe
- has_py2exe = True
-
-sys.path.append(join(os.path.abspath(os.path.dirname(__file__)), "bin"))
-
-execfile(join('bin', 'release.py'))
-
-if sys.argv[1] == 'bdist_rpm':
- version = version.split('-')[0]
-
-# get python short version
-py_short_version = '%s.%s' % sys.version_info[:2]
-
-required_modules = [
- ('lxml', 'lxml module: pythonic libxml2 and libxslt bindings'),
- ('mako', 'Mako template engine'),
- ('dateutil', "Extensions to the standard datetime module"),
- ('psycopg2', 'PostgreSQL module'),
- ('pychart', 'pychart module'),
- ('pydot', 'pydot module'),
- ('pytz', 'Timezone handling library for Python'),
- ('reportlab', 'reportlab module'),
- ('yaml', 'YAML parser and emitter for Python'),
- ('pywebdav', 'PyWebDAV is a standards compliant WebDAV server and library written in Python'),
-]
-
-def check_modules():
- errors = []
- for modname, desc in required_modules:
- try:
- imp.find_module(modname)
- except ImportError:
- errors.append(
- 'Error: python module %s (%s) is required' % (modname, desc))
-
- if errors:
- print '\n'.join(errors)
- sys.exit(1)
-
-def find_addons():
- for root, _, names in os.walk(join('bin', 'addons')):
- if '__openerp__.py' in names or '__terp__.py' in names:
- yield basename(root), root
- #look for extra modules
- try:
- empath = os.getenv('EXTRA_MODULES_PATH', '../addons/')
- for mname in open(join(empath, 'server_modules.list')):
- mname = mname.strip()
- if not mname:
- continue