From a55a26c777a0e6d9e8c49f35e6154734d3933171 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 28 Nov 2012 13:09:50 +0100 Subject: [IMP] rewrite win32/setup.py to generate dynamic files bzr revid: chs@openerp.com-20121128120950-bi6uv3bn73gotmwi --- win32/setup.py | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) (limited to 'win32/setup.py') diff --git a/win32/setup.py b/win32/setup.py index 9c064c1f6d8..5366b63ab4d 100644 --- a/win32/setup.py +++ b/win32/setup.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,22 +15,53 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## from distutils.core import setup +import os import py2exe +meta = {} +execfile(os.path.join(os.path.dirname(__file__), '..', 'openerp', 'release.py'), meta) + +def generate_files(): + actions = { + 'start': ['stop', 'start'], + 'stop': ['stop'], + } + + files = [] + for action, steps in actions.items(): + fname = action + '.bat' + files.append(fname) + with open(fname, 'w') as fp: + fp.write('@PATH=%WINDIR%\system32;%WINDIR%;%WINDIR%\System32\Wbem;.') + for step in steps: + fp.write('@net %s %s' % (step, meta['nt_service_name'])) + + files.append('meta.py') + with open('meta.py', 'w') as fp: + for m in 'description serie nt_service_name'.split(): + fp.write("%s = %r" % (m, meta[m],)) -setup(service=["OpenERPServerService"], - options={"py2exe":{"excludes":["Tkconstants","Tkinter","tcl", - "_imagingtk","PIL._imagingtk", - "ImageTk", "PIL.ImageTk", - "FixTk"], - "skip_archive": 1, - "optimize": 2,}} + return files + +excludes = "Tkconstants Tkinter tcl _imagingtk PIL._imagingtk ImageTk PIL.ImageTk FixTk".split() + +setup(service = ["OpenERPServerService"], + version = meta['version'], + licence = meta['licence'], + url = meta['url'], + author = meta['author'], + author_email = meta['author_email'], + data_files = generate_files(), + options = {"py2exe": { + "excludes": excludes, + "skip_archive": 1, + "optimize": 2, + }} ) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - -- cgit v1.2.3 From af7fbd40abe038e91fcda28cd908a8d582989605 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 28 Nov 2012 14:24:13 +0100 Subject: some brief changes bzr revid: chs@openerp.com-20121128132413-op2z4vmv78y04u95 --- win32/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32/setup.py') diff --git a/win32/setup.py b/win32/setup.py index 5366b63ab4d..0d8f504cc01 100644 --- a/win32/setup.py +++ b/win32/setup.py @@ -52,7 +52,7 @@ excludes = "Tkconstants Tkinter tcl _imagingtk PIL._imagingtk ImageTk PIL.ImageT setup(service = ["OpenERPServerService"], version = meta['version'], - licence = meta['licence'], + license = meta['license'], url = meta['url'], author = meta['author'], author_email = meta['author_email'], -- cgit v1.2.3 From 7773d0d431d8d3c4195bc80c118f34a5396ce186 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 28 Nov 2012 15:25:21 +0100 Subject: [FIX] win32/setup.py: forgot \n bzr revid: chs@openerp.com-20121128142521-1giiba0fvxhq84mu --- win32/setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'win32/setup.py') diff --git a/win32/setup.py b/win32/setup.py index 0d8f504cc01..d6920e0be61 100644 --- a/win32/setup.py +++ b/win32/setup.py @@ -37,14 +37,14 @@ def generate_files(): fname = action + '.bat' files.append(fname) with open(fname, 'w') as fp: - fp.write('@PATH=%WINDIR%\system32;%WINDIR%;%WINDIR%\System32\Wbem;.') + fp.write('@PATH=%WINDIR%\system32;%WINDIR%;%WINDIR%\System32\Wbem;.\n') for step in steps: - fp.write('@net %s %s' % (step, meta['nt_service_name'])) + fp.write('@net %s %s\n' % (step, meta['nt_service_name'])) files.append('meta.py') with open('meta.py', 'w') as fp: for m in 'description serie nt_service_name'.split(): - fp.write("%s = %r" % (m, meta[m],)) + fp.write("%s = %r\n" % (m, meta[m],)) return files -- cgit v1.2.3