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

View File

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