Fix date problems (ranges, non-english settings) reading from data file.

svn: r607
This commit is contained in:
David Hampton 2001-12-05 00:09:12 +00:00
parent 82830723e8
commit 1d7204e7d9
2 changed files with 9 additions and 3 deletions

View File

@ -101,8 +101,10 @@ class Date:
range = 1
normal = 0
from_str = _("(from|between|bet|bet.)")
to_str = _("(and|to|-)")
# The last part of these two strings must remain untranslated. It
# is required to read saved data from XML.
from_str = _("(from|between|bet|bet.") + "|FROM)"
to_str = _("(and|to|-") + "|TO)"
fmt = compile(r"\s*" + from_str + r"\s+(.+)\s+" + to_str + r"\s+(.+)\s*$",
IGNORECASE)
@ -333,8 +335,9 @@ class SingleDate:
_("after") : after,
_("aft.") : after,
_("aft") : after,
# And the untranslated versions for backward compatability
# And the untranslated versions for reading saved data from XML.
"abt" : about,
"about" : about,
"after" : after,
"before" : before }
@ -350,6 +353,8 @@ class SingleDate:
_("bef\.?") + '|' + \
"abt" + '|' + \
"aft" + '|' + \
"after" + '|' + \
"before" + '|' + \
"bef" + ')'
start = "^\s*" + modifiers + "?\s*"

View File

@ -411,6 +411,7 @@ class GrampsParser:
d.get_start_date().setIsoDate(attrs['start'])
d.get_stop_date().setIsoDate(attrs['stop'])
d.range = 1
def start_dateval(self,attrs):
if self.ord: