3756: Cannot set new year value different than default (first January) - remove list and parsing

svn: r15019
This commit is contained in:
Jérôme Rapinat 2010-04-04 06:43:27 +00:00
parent 1106d15cdc
commit 751888dacc

View File

@ -169,15 +169,6 @@ class DateParserFR(DateParser):
u's': Date.CAL_SWEDISH, u's': Date.CAL_SWEDISH,
} }
# newyear_to_int = DAteParser.newyear_to_int
newyear_to_int = {
u"1 jan": Date.NEWYEAR_JAN1,
u"1 mars": Date.NEWYEAR_MAR1,
u"25 mars": Date.NEWYEAR_MAR25,
u"1 sep" : Date.NEWYEAR_SEP1,
}
quality_to_int = { quality_to_int = {
u'estimée': Date.QUAL_ESTIMATED, u'estimée': Date.QUAL_ESTIMATED,
u'est.': Date.QUAL_ESTIMATED, u'est.': Date.QUAL_ESTIMATED,
@ -267,8 +258,6 @@ class DateDisplayFR(DateDisplay):
calendar = ("", u"Julien", u"Hébreu", u"Révolutionnaire", calendar = ("", u"Julien", u"Hébreu", u"Révolutionnaire",
u"Perse", u"Islamique", u"Suédois") u"Perse", u"Islamique", u"Suédois")
newyear = ("", u"1 mars", u"25 mars", u"1 sep")
_mod_str = ("", u"avant ", u"après ", u"vers ", "", "", "") _mod_str = ("", u"avant ", u"après ", u"vers ", "", "", "")
_qual_str = ("", u"estimée ", u"calculée ", "") _qual_str = ("", u"estimée ", u"calculée ", "")
@ -411,19 +400,19 @@ class DateDisplayFR(DateDisplay):
elif start == Date.EMPTY: elif start == Date.EMPTY:
return "" return ""
elif mod == Date.MOD_SPAN: elif mod == Date.MOD_SPAN:
date1 = (self.display_cal)[cal](start) date1 = self.display_cal[cal](start)
date2 = (self.display_cal)[cal](date.get_stop_date()) date2 = self.display_cal[cal](date.get_stop_date())
scal = self.format_extras(cal, newyear) scal = self.format_extras(cal, newyear)
return "%s%s %s %s %s%s" % (qual_str, u'de', date1, u'à', return "%s%s %s %s %s%s" % (qual_str, u'de', date1, u'à',
date2, scal) date2, scal)
elif mod == Date.MOD_RANGE: elif mod == Date.MOD_RANGE:
date1 = (self.display_cal)[cal](start) date1 = self.display_cal[cal](start)
date2 = (self.display_cal)[cal](date.get_stop_date()) date2 = self.display_cal[cal](date.get_stop_date())
scal = self.format_extras(cal, newyear) scal = self.format_extras(cal, newyear)
return "%s%s %s %s %s%s" % (qual_str, u'entre', date1, u'et', return "%s%s %s %s %s%s" % (qual_str, u'entre', date1, u'et',
date2, scal) date2, scal)
else: else:
text = (self.display_cal)[date.get_calendar()](start) text = self.display_cal[date.get_calendar()](start)
scal = self.format_extras(cal, newyear) scal = self.format_extras(cal, newyear)
return "%s%s%s%s" % (qual_str, (self._mod_str)[mod], text, return "%s%s%s%s" % (qual_str, (self._mod_str)[mod], text,
scal) scal)