Updated the check for gettext introduced in r12475 to also look at the version.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2010-02-22 20:25:43 +00:00
parent a3e2ddde65
commit 7573c4a9f7
1 changed files with 11 additions and 2 deletions

View File

@ -1,4 +1,6 @@
import os
import re
from subprocess import Popen, PIPE
def find_command(cmd, path=None, pathext=None):
if path is None:
@ -26,5 +28,12 @@ def find_command(cmd, path=None, pathext=None):
# checks if it can find xgettext on the PATH and
# imports the extraction tests if yes
if find_command('xgettext'):
from extraction import *
xgettext_cmd = find_command('xgettext')
if xgettext_cmd:
p = Popen('%s --version' % xgettext_cmd, shell=True, stdout=PIPE, stderr=PIPE, close_fds=os.name != 'nt', universal_newlines=True)
output = p.communicate()[0]
match = re.search(r'(?P<major>\d+)\.(?P<minor>\d+)', output)
if match:
xversion = (int(match.group('major')), int(match.group('minor')))
if xversion > (0, 15):
from extraction import *