adapt setup script for win32
svn: r21316
This commit is contained in:
parent
a3a758fd13
commit
69800680a3
12
setup.py
12
setup.py
@ -62,7 +62,10 @@ def intltool_version():
|
|||||||
'''
|
'''
|
||||||
Return the version of intltool as a tuple.
|
Return the version of intltool as a tuple.
|
||||||
'''
|
'''
|
||||||
|
if not sys.platform == 'win32':
|
||||||
cmd = 'intltool-update --version | head -1 | cut -d" " -f3'
|
cmd = 'intltool-update --version | head -1 | cut -d" " -f3'
|
||||||
|
else:
|
||||||
|
cmd = "perl -e 'print `intltool-update --version 2>&1` =~ m/(\d+.\d+.\d+)/;'"
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
retcode, version_str = commands.getstatusoutput(cmd)
|
retcode, version_str = commands.getstatusoutput(cmd)
|
||||||
else:
|
else:
|
||||||
@ -198,6 +201,14 @@ def merge(in_file, out_file, option, po_dir='po', cache=True):
|
|||||||
option += ' -c ' + cache_file
|
option += ' -c ' + cache_file
|
||||||
|
|
||||||
if (not os.path.exists(out_file) and os.path.exists(in_file)):
|
if (not os.path.exists(out_file) and os.path.exists(in_file)):
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
cmd = (('set LC_ALL=C && intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
||||||
|
'%(out_file)s') %
|
||||||
|
{'opt' : option,
|
||||||
|
'po_dir' : po_dir,
|
||||||
|
'in_file' : in_file,
|
||||||
|
'out_file' : out_file})
|
||||||
|
else:
|
||||||
cmd = (('LC_ALL=C intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
cmd = (('LC_ALL=C intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
||||||
'%(out_file)s') %
|
'%(out_file)s') %
|
||||||
{'opt' : option,
|
{'opt' : option,
|
||||||
@ -264,6 +275,7 @@ class build(_build):
|
|||||||
"""Custom build command."""
|
"""Custom build command."""
|
||||||
def run(self):
|
def run(self):
|
||||||
build_trans(self)
|
build_trans(self)
|
||||||
|
if not sys.platform == 'win32':
|
||||||
build_man(self)
|
build_man(self)
|
||||||
build_intl(self)
|
build_intl(self)
|
||||||
write_const_py(self)
|
write_const_py(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user