5621: cleanup

svn: r19170
This commit is contained in:
Jérôme Rapinat 2012-03-29 09:19:54 +00:00
parent df071b9009
commit da29ed5238

View File

@ -30,17 +30,17 @@ 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(x86)\gettext\bin\msgmerge.exe' msgmergeCmd = os.path.join('C:', 'Program Files(x86)', 'gettext', 'bin', 'msgmerge.exe')
msgfmtCmd = 'C:\Program Files(x86)\gettext\bin\msgfmt.exe' msgfmtCmd = os.path.join('C:', 'Program Files(x86)', 'gettext', 'bin', 'msgfmt.exe')
msgattribCmd = 'C:\Program Files(x86)\gettext\bin\msgattrib.exe' msgattribCmd = os.path.join('C:', 'Program Files(x86)', 'gettext', 'bin', 'msgattrib.exe')
xgettextCmd = os.path.join('C:', 'Program Files(x86)', 'gettext', 'bin', 'xgettext.exe') xgettextCmd = os.path.join('C:', 'Program Files(x86)', 'gettext', 'bin', 'xgettext.exe')
pythonCmd = 'C:\Program Files(x86)\python\bin\python.exe' pythonCmd = os.path.join(sys.prefix, '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'
msgattribCmd = 'msgattrib' msgattribCmd = 'msgattrib'
xgettextCmd = 'xgettext' xgettextCmd = 'xgettext'
pythonCmd = 'python' pythonCmd = os.path.join(sys.prefix, 'bin', 'python')
def tests(): def tests():
""" """
@ -146,35 +146,6 @@ def TipsParse(filename, mark):
tips.close() tips.close()
'''
<?xml version="1.0" encoding="utf-8"?>
calendar>
<country _name="Bulgaria">
..
<country _name="Jewish Holidays">
<date _name="Yom Kippur" value="> passover(y)" offset="172"/>
char *s = N_("Bulgaria");
char *s = N_("Jewish Holidays");
char *s = N_("Yom Kippur");
gramps.pot:
msgid "Bulgaria"
msgid "Jewish Holidays"
msgid "Yom Kippur"
'''
holidays = open('../src/plugins/lib/holidays.xml.in.h', 'w')
for key in root.getiterator():
if key.attrib.get(mark):
line = key.attrib
string = line.items
name = 'char *s = N_("%(_name)s");\n' % line
holidays.write(name)
holidays.close()
root.clear() root.clear()
def HolidaysParse(filename, mark): def HolidaysParse(filename, mark):