5621: add '--skip-fuzzy' flag with check_po; try to get correct path for win32 (Peter contribution)

svn: r19098
This commit is contained in:
Jérôme Rapinat 2012-03-19 18:46:50 +00:00
parent 8161e7a5ff
commit 30a25b7b7f

View File

@ -30,11 +30,11 @@ from optparse import OptionParser, OptionGroup
if sys.platform == 'win32': if sys.platform == 'win32':
# GetText Win 32 obtained from http://gnuwin32.sourceforge.net/packages/gettext.htm # GetText Win 32 obtained from http://gnuwin32.sourceforge.net/packages/gettext.htm
# ....\gettext\bin\msgmerge.exe needs to be on the path # ....\gettext\bin\msgmerge.exe needs to be on the path
msgmergeCmd = 'c:\Program_files\gettext\bin\msgmerge.exe' msgmergeCmd = 'C:\Program Files(x86)\gettext\bin\msgmerge.exe'
msgfmtCmd = 'c:\Program_files\gettext\bin\msgfmt.exe' msgfmtCmd = 'C:\Program Files(x86)\gettext\bin\msgfmt.exe'
msgattribCmd = 'c:\Program_files\gettext\bin\msgattrib.exe' msgattribCmd = 'C:\Program Files(x86)\gettext\bin\msgattrib.exe'
xgettextCmd = os.path.join('c:', 'Program_files', 'bin', 'xgettext.exe') xgettextCmd = os.path.join('C:', 'Program Files(x86)', 'gettext', 'bin', 'xgettext.exe')
pythonCmd = 'c:\Program_files\python\bin\python.exe' pythonCmd = 'C:\Program Files(x86)\python\bin\python.exe'
elif sys.platform == 'linux2' or os.name == 'darwin': elif sys.platform == 'linux2' or os.name == 'darwin':
msgmergeCmd = 'msgmerge' msgmergeCmd = 'msgmerge'
msgfmtCmd = 'msgfmt' msgfmtCmd = 'msgfmt'
@ -410,7 +410,7 @@ def check(args):
if arg[-3:] == '.po': if arg[-3:] == '.po':
print("Checked file: '%(lang.po)s'. See '%(txt)s.txt'." \ print("Checked file: '%(lang.po)s'. See '%(txt)s.txt'." \
% {'lang.po': arg, 'txt': arg[:2]}) % {'lang.po': arg, 'txt': arg[:2]})
os.system('''%(python)s ./check_po ./%(lang.po)s > %(lang)s.txt''' \ os.system('''%(python)s ./check_po --skip-fuzzy ./%(lang.po)s > %(lang)s.txt''' \
% {'python': pythonCmd, 'lang.po': arg, 'lang': arg[:2]}) % {'python': pythonCmd, 'lang.po': arg, 'lang': arg[:2]})
os.system('''%(msgfmt)s -c -v %(lang.po)s''' % {'msgfmt': msgfmtCmd, 'lang.po': arg}) os.system('''%(msgfmt)s -c -v %(lang.po)s''' % {'msgfmt': msgfmtCmd, 'lang.po': arg})
else: else: