Mercurial > p > roundup > code
changeset 2359:8611bf29baec
deepcopy was broken for date stuff
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 23 May 2004 10:23:28 +0000 |
| parents | 351304739aae |
| children | 571f451800df |
| files | roundup/date.py |
| diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/date.py Sun May 23 09:44:47 2004 +0000 +++ b/roundup/date.py Sun May 23 10:23:28 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: date.py,v 1.69 2004-05-19 17:12:18 a1s Exp $ +# $Id: date.py,v 1.70 2004-05-23 10:23:28 richard Exp $ """Date, time and time interval handling. """ @@ -370,6 +370,10 @@ return Date((self.year, self.month, self.day, self.hour + offset, self.minute, self.second, 0, 0, 0)) + def __deepcopy__(self, memo): + return Date((self.year, self.month, self.day, self.hour, + self.minute, self.second, 0, 0, 0)) + def get_tuple(self): return (self.year, self.month, self.day, self.hour, self.minute, self.second, 0, 0, 0) @@ -460,6 +464,10 @@ self.second = spec self.second = int(self.second) + def __deepcopy__(self, memo): + return Interval((self.sign, self.year, self.month, self.day, + self.hour, self.minute, self.second)) + def set(self, spec, allowdate=1, interval_re=re.compile(''' \s*(?P<s>[-+])? # + or - \s*((?P<y>\d+\s*)y)? # year
