7921 Move holidays.xml.in to data [refactor]
This commit is contained in:
parent
98ee53aa17
commit
8694c7fcc7
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,7 +8,7 @@ dist/
|
||||
|
||||
# Gramps
|
||||
data/tips.xml
|
||||
gramps/plugins/lib/holidays.xml
|
||||
data/holidays.xml
|
||||
po/.intltool-merge-cache
|
||||
docs/_build/
|
||||
|
||||
|
@ -22,7 +22,7 @@ recursive-include windows *
|
||||
|
||||
# Remove files created in the build
|
||||
exclude data/tips.xml
|
||||
exclude gramps/plugins/lib/holidays.xml
|
||||
exclude data/holidays.xml
|
||||
exclude po/.intltool-merge-cache
|
||||
global-exclude *.pyc
|
||||
global-exclude *.pyo
|
||||
|
@ -38,7 +38,7 @@ import os
|
||||
#------------------------------------------------------------------------
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
from gramps.gen.const import PLUGINS_DIR, USER_PLUGINS
|
||||
from gramps.gen.const import PLUGINS_DIR, USER_PLUGINS, DATA_DIR
|
||||
from gramps.gen.lib.gcalendar import (gregorian_ymd, hebrew_sdn)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@ -188,9 +188,9 @@ class HolidayTable(object):
|
||||
if os.path.exists(holiday_full_path):
|
||||
HolidayTable.__holiday_files.append(holiday_full_path)
|
||||
|
||||
# Look for holiday files in the installation plugins directory and all
|
||||
# Look for holiday files in the installation data directory and all
|
||||
# subdirectories.
|
||||
for (dirpath, dirnames, filenames) in os.walk(PLUGINS_DIR):
|
||||
for (dirpath, dirnames, filenames) in os.walk(DATA_DIR):
|
||||
holiday_full_path = os.path.join(dirpath, holiday_file)
|
||||
if os.path.exists(holiday_full_path):
|
||||
HolidayTable.__holiday_files.append(holiday_full_path)
|
||||
|
@ -624,7 +624,6 @@ gramps/plugins/importer/importgrdb.py
|
||||
gramps/plugins/importer/importprogen.py
|
||||
gramps/plugins/importer/importvcard.py
|
||||
gramps/plugins/importer/importxml.py
|
||||
gramps/plugins/lib/holidays.xml.in
|
||||
gramps/plugins/lib/libcairodoc.py
|
||||
gramps/plugins/lib/libgedcom.py
|
||||
gramps/plugins/lib/libhtmlbackend.py
|
||||
@ -752,5 +751,6 @@ gramps/plugins/webstuff/webstuff.py
|
||||
data/gramps.desktop.in
|
||||
data/gramps.keys.in
|
||||
data/gramps.xml.in
|
||||
data/holidays.xml.in
|
||||
data/tips.xml.in
|
||||
data/gramps.appdata.xml.in
|
||||
|
@ -215,7 +215,7 @@ def HolidaysParse(filename, mark):
|
||||
msgid "Yom Kippur"
|
||||
'''
|
||||
|
||||
holidays = open('../gramps/plugins/lib/holidays.xml.in.h', 'w')
|
||||
holidays = open('../data/holidays.xml.in.h', 'w')
|
||||
for key in ellist:
|
||||
if key.attrib.get(mark):
|
||||
line = key.attrib
|
||||
@ -224,7 +224,7 @@ def HolidaysParse(filename, mark):
|
||||
name = 'char *s = N_("%(_name)s");\n' % line
|
||||
holidays.write(name)
|
||||
holidays.close()
|
||||
print ('Wrote ../gramps/plugins/lib/holidays.xml.in.h')
|
||||
print ('Wrote .../data/holidays.xml.in.h')
|
||||
root.clear()
|
||||
|
||||
|
||||
@ -538,8 +538,8 @@ def headers():
|
||||
# in.h; extract_xml
|
||||
if os.path.isfile('''../data/tips.xml.in.h'''):
|
||||
headers.append('''../data/tips.xml.in.h''')
|
||||
if os.path.isfile('''../gramps/plugins/lib/holidays.xml.in.h'''):
|
||||
headers.append('''../gramps/plugins/lib/holidays.xml.in.h''')
|
||||
if os.path.isfile('''../data/holidays.xml.in.h'''):
|
||||
headers.append('''../data/holidays.xml.in.h''')
|
||||
if os.path.isfile('''../data/gramps.xml.in.h'''):
|
||||
headers.append('''../data/gramps.xml.in.h''')
|
||||
if os.path.isfile('''../data/gramps.desktop.in.h'''):
|
||||
@ -559,7 +559,7 @@ def extract_xml():
|
||||
files. Own XML files parsing and custom translation marks.
|
||||
"""
|
||||
|
||||
HolidaysParse('../gramps/plugins/lib/holidays.xml.in', '_name')
|
||||
HolidaysParse('../data/holidays.xml.in', '_name')
|
||||
TipsParse('../data/tips.xml.in', '_tip')
|
||||
XmlParse('../data/gramps.xml.in', '_comment')
|
||||
XmlParse('../data/gramps.appdata.xml.in', '_p')
|
||||
|
2
setup.py
2
setup.py
@ -54,7 +54,7 @@ ALL_LINGUAS = ('ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en_GB',
|
||||
'ja', 'lt', 'nb', 'nl', 'nn', 'pl', 'pt_BR', 'pt_PT',
|
||||
'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'tr', 'uk', 'vi',
|
||||
'zh_CN', 'zh_HK', 'zh_TW')
|
||||
INTLTOOL_FILES = ('data/tips.xml', 'gramps/plugins/lib/holidays.xml')
|
||||
INTLTOOL_FILES = ('data/tips.xml', 'data/holidays.xml')
|
||||
|
||||
svem_flag = '--single-version-externally-managed'
|
||||
if svem_flag in sys.argv:
|
||||
|
Loading…
Reference in New Issue
Block a user