Undo db update... missed many dates; reworking upgrade
svn: r10499
This commit is contained in:
@@ -80,7 +80,7 @@ class Date:
|
||||
|
||||
Supports partial dates, compound dates and alternate calendars.
|
||||
"""
|
||||
MOD_NONE = 0 # CODE
|
||||
MOD_NONE = 0
|
||||
MOD_BEFORE = 1
|
||||
MOD_AFTER = 2
|
||||
MOD_ABOUT = 3
|
||||
@@ -88,23 +88,17 @@ class Date:
|
||||
MOD_SPAN = 5
|
||||
MOD_TEXTONLY = 6
|
||||
|
||||
QUAL_NONE = 0 # BITWISE
|
||||
QUAL_ESTIMATED = 1
|
||||
QUAL_CALCULATED = 2
|
||||
QUAL_INTERPRETED = 4
|
||||
QUAL_NONE = 0
|
||||
QUAL_ESTIMATED = 1
|
||||
QUAL_CALCULATED = 2
|
||||
|
||||
CAL_GREGORIAN = 0 # CODE
|
||||
CAL_GREGORIAN = 0
|
||||
CAL_JULIAN = 1
|
||||
CAL_HEBREW = 2
|
||||
CAL_FRENCH = 3
|
||||
CAL_PERSIAN = 4
|
||||
CAL_ISLAMIC = 5
|
||||
|
||||
NEWYEAR_JAN1 = 0 # CODE
|
||||
NEWYEAR_MAR1 = 1
|
||||
NEWYEAR_MAR25 = 2
|
||||
NEWYEAR_SEP1 = 3
|
||||
|
||||
EMPTY = (0, 0, 0, False)
|
||||
|
||||
_POS_DAY = 0
|
||||
@@ -187,7 +181,6 @@ class Date:
|
||||
self.dateval = Date.EMPTY
|
||||
self.text = u""
|
||||
self.sortval = 0
|
||||
self.newyear = 0
|
||||
self.set_yr_mon_day(*source)
|
||||
elif type(source) == str:
|
||||
if (calendar != None or
|
||||
@@ -203,7 +196,6 @@ class Date:
|
||||
self.dateval = source.dateval
|
||||
self.text = source.text
|
||||
self.sortval = source.sortval
|
||||
self.newyear = source.newyear
|
||||
elif source:
|
||||
self.calendar = source.calendar
|
||||
self.modifier = source.modifier
|
||||
@@ -211,7 +203,6 @@ class Date:
|
||||
self.dateval = source.dateval
|
||||
self.text = source.text
|
||||
self.sortval = source.sortval
|
||||
self.newyear = source.newyear
|
||||
else:
|
||||
self.calendar = Date.CAL_GREGORIAN
|
||||
self.modifier = Date.MOD_NONE
|
||||
@@ -219,7 +210,6 @@ class Date:
|
||||
self.dateval = Date.EMPTY
|
||||
self.text = u""
|
||||
self.sortval = 0
|
||||
self.newyear = Date.NEWYEAR_JAN1
|
||||
|
||||
def serialize(self, no_text_date=False):
|
||||
"""
|
||||
@@ -231,14 +221,14 @@ class Date:
|
||||
text = self.text
|
||||
|
||||
return (self.calendar, self.modifier, self.quality,
|
||||
self.dateval, text, self.sortval, self.newyear)
|
||||
self.dateval, text, self.sortval)
|
||||
|
||||
def unserialize(self, data):
|
||||
"""
|
||||
Load from the format created by serialize.
|
||||
"""
|
||||
(self.calendar, self.modifier, self.quality,
|
||||
self.dateval, self.text, self.sortval, self.newyear) = data
|
||||
self.dateval, self.text, self.sortval) = data
|
||||
return self
|
||||
|
||||
def copy(self, source):
|
||||
@@ -252,7 +242,6 @@ class Date:
|
||||
self.dateval = source.dateval
|
||||
self.text = source.text
|
||||
self.sortval = source.sortval
|
||||
self.newyear = source.newyear
|
||||
|
||||
def __cmp__(self, other):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user