~openerp-dev/openobject-client-web/6.0-opw-599608-rgo

« back to all changes in this revision

Viewing changes to win32/fixps.py

  • Committer: Xavier Morel
  • Date: 2010-11-08 13:21:12 UTC
  • mfrom: (3784.1.6 trunk)
  • Revision ID: xmo@openerp.com-20101108132112-al0aostzkpjvh1by
[IMP] new win32 service spec (to be merged into root setup.py/py2exe), new NSIS script

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import os, sys
2
 
import re
3
 
 
4
 
PY_DIR = os.path.dirname(sys.executable)
5
 
MY_DIR = os.path.dirname(os.path.abspath(__file__))
6
 
 
7
 
pat = re.compile('^#!.*$', re.M)
8
 
 
9
 
for f in os.listdir(MY_DIR):
10
 
 
11
 
    if not f.endswith('.py') or f.endswith('.pyw') or f == 'fixps.py':
12
 
        continue
13
 
 
14
 
    f = os.path.join(MY_DIR, f)
15
 
 
16
 
    src = open(f).read()
17
 
    src = pat.sub('#!"%s\python.exe"' % PY_DIR, src)
18
 
 
19
 
    fo = open(f, 'w')
20
 
    fo.write(src)
21
 
    fo.close()
22