From 824eb84421e46ede7e4efd8e1b131298c9b6051a Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 23 Sep 2002 07:09:15 +0000 Subject: [PATCH] oops git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1208 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/date.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roundup/date.py b/roundup/date.py index e048927..a016133 100644 --- a/roundup/date.py +++ b/roundup/date.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: date.py,v 1.29 2002-09-23 06:48:34 richard Exp $ +# $Id: date.py,v 1.30 2002-09-23 07:09:15 richard Exp $ __doc__ = """ Date, time and time interval handling. @@ -215,25 +215,25 @@ class Date: return str def set(self, spec, offset=0, date_re=re.compile(r''' - (((?P\d\d\d\d)-)?((?P\d\d?)-(?P\d\d?))?)? # yyyy-mm-dd - (?P\.)? # . - (((?P\d?\d):(?P\d\d))?(:(?P\d\d))?)? # hh:mm:ss - (?P.+)? # offset + (((?P\d{4}-)?((?P\d\d?)-(?P\d\d?))?)? # yyyy-mm-dd + (?P\.)? # . + (((?P\d?\d):(?P\d\d))?(:(?P\d\d))?)? # hh:mm:ss + (?P.+)? # offset ''', re.VERBOSE), serialised_re=re.compile(''' - (\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2}) - ''')): + (\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d) + ''', re.VERBOSE)): ''' set the date to the value in spec ''' m = serialised_re.match(spec) - if m: + if m is not None: # we're serialised - easy! self.year, self.month, self.day, self.hour, self.minute, \ - self.second = map(int, m.groups()[1:7]) + self.second = map(int, m.groups()[:6]) return # not serialised data, try usual format m = date_re.match(spec) - if not m: + if m is None: raise ValueError, _('Not a date spec: [[yyyy-]mm-dd].' '[[h]h:mm[:ss]][offset]') -- 2.30.2