support python 2 in setup.py also :-)

svn: r20679
This commit is contained in:
Benny Malengier 2012-11-18 17:31:39 +00:00
parent 3e85d2f7c9
commit 7576054885

View File

@ -43,6 +43,8 @@ import os
import glob import glob
import codecs import codecs
import subprocess import subprocess
if sys.version_info[0] < 3:
import commands
from stat import ST_MODE from stat import ST_MODE
VERSION = '4.0.0' VERSION = '4.0.0'
@ -56,6 +58,9 @@ def intltool_version():
Return the version of intltool as a tuple. Return the version of intltool as a tuple.
''' '''
cmd = 'intltool-update --version | head -1 | cut -d" " -f3' cmd = 'intltool-update --version | head -1 | cut -d" " -f3'
if sys.version_info[0] < 3:
retcode, version_str = commands.getstatusoutput(cmd)
else:
retcode, version_str = subprocess.getstatusoutput(cmd) retcode, version_str = subprocess.getstatusoutput(cmd)
if retcode != 0: if retcode != 0:
return None return None
@ -329,7 +334,6 @@ for (dirpath, dirnames, filenames) in os.walk(basedir):
data_list.append(dirpath[7:] + '/' + dirname + '/*.js') data_list.append(dirpath[7:] + '/' + dirname + '/*.js')
data_list.append('plugins/webstuff/images/*.gif') data_list.append('plugins/webstuff/images/*.gif')
data_list.append('plugins/webstuff/images/*.ico') data_list.append('plugins/webstuff/images/*.ico')
print(data_list)
setup(name = 'gramps', setup(name = 'gramps',
description = ('Gramps (Genealogical Research and Analysis Management ' description = ('Gramps (Genealogical Research and Analysis Management '