2007-04-20 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_ReadGedcom.py: fix calendar parsing
	* src/GrampsDb/_WriteGedcom.py: fix calendar generation



svn: r8412
This commit is contained in:
Don Allingham 2007-04-21 04:30:13 +00:00
parent bc2ef71467
commit c1be620f90
3 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,7 @@
2007-04-20 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: fix calendar parsing
* src/GrampsDb/_WriteGedcom.py: fix calendar generation
2007-04-20 Alex Roitman <shura@gramps-project.org>
* src/plugins/Checkpoint.py (Checkpoint.rcs): Remove debugging
output; Work out retrieval.

View File

@ -183,9 +183,9 @@ intRE = re.compile(r"\s*(\d+)\s*$")
nameRegexp = re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?")
snameRegexp = re.compile(r"/([^/]*)/([^/]*)")
modRegexp = re.compile(r"\s*(EST|CAL)\s+(.*)$")
calRegexp = re.compile(r"\s*(ABT|BEF|AFT)?\s*@#D([^@]+)@\s*(.*)$")
rangeRegexp = re.compile(r"\s*BET\s+@#D([^@]+)@\s*(.*)\s+AND\s+@#D([^@]+)@\s*(.*)$")
spanRegexp = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$")
calRegexp = re.compile(r"\s*(ABT|BEF|AFT)?\s*@#D?([^@]+)@\s*(.*)$")
rangeRegexp = re.compile(r"\s*BET\s+@#D?([^@]+)@\s*(.*)\s+AND\s+@#D?([^@]+)@\s*(.*)$")
spanRegexp = re.compile(r"\s*FROM\s+@#D?([^@]+)@\s*(.*)\s+TO\s+@#D?([^@]+)@\s*(.*)$")
intRegexp = re.compile(r"\s*INT\s+([^(]+)\((.*)\)$")
#-------------------------------------------------------------------------
@ -2456,7 +2456,10 @@ class GedcomParser(UpdateCallback):
match = calRegexp.match(text)
if match:
(abt,cal,data) = match.groups()
if abt:
dateobj = self.dp.parse("%s %s" % (abt, data))
else:
dateobj = self.dp.parse(data)
if cal == "FRENCH R":
dateobj.set_calendar(RelLib.Date.CAL_FRENCH)
elif cal == "JULIAN":

View File

@ -105,9 +105,9 @@ _month = [
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ]
_calmap = {
RelLib.Date.CAL_HEBREW : (_hmonth, '@#HEBREW@'),
RelLib.Date.CAL_FRENCH : (_fmonth, '@#FRENCH R@'),
RelLib.Date.CAL_JULIAN : (_month, '@#JULIAN@'),
RelLib.Date.CAL_HEBREW : (_hmonth, '@#DHEBREW@'),
RelLib.Date.CAL_FRENCH : (_fmonth, '@#DFRENCH R@'),
RelLib.Date.CAL_JULIAN : (_month, '@#DJULIAN@'),
}
_caldef = {