From: Fred L. D. <fd...@us...> - 2001-06-29 14:22:39
|
Update of /cvsroot/grail/grail/src/bookmarks In directory usw-pr-cvs1:/tmp/cvs-serv7703 Modified Files: iso8601.py Log Message: Synchronize with revision 1.6 from PyXML. Index: iso8601.py =================================================================== RCS file: /cvsroot/grail/grail/src/bookmarks/iso8601.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** iso8601.py 2001/06/05 14:53:08 1.2 --- iso8601.py 2001/06/29 14:22:36 1.3 *************** *** 78,82 **** return tostring(t, time.timezone) ! # Internal data and functions: --- 78,82 ---- return tostring(t, time.timezone) ! # Internal data and functions: *************** *** 100,121 **** def __extract_date(m): ! year = int(m.group("year"), 10) julian = m.group("julian") if julian: ! return __find_julian(year, int(julian, 10)) ! month = int(m.group("month"), 10) day = 1 if month is None: month = 1 - elif not 1 <= month <= 12: - raise ValueError, "illegal month number: " + m.group("month") else: ! day = m.group("day") ! if day: ! day = int(day, 10) ! if not 1 <= day <= 31: ! raise ValueError, "illegal day number: " + m.group("day") else: ! day = 1 return year, month, day --- 100,123 ---- def __extract_date(m): ! year = int(m.group("year")) julian = m.group("julian") if julian: ! return __find_julian(year, int(julian)) ! month = m.group("month") day = 1 if month is None: month = 1 else: ! month = int(month) ! if not 1 <= month <= 12: ! raise ValueError, "illegal month number: " + m.group("month") else: ! day = m.group("day") ! if day: ! day = int(day) ! if not 1 <= day <= 31: ! raise ValueError, "illegal day number: " + m.group("day") ! else: ! day = 1 return year, month, day *************** *** 127,134 **** if not hours: return 0, 0, 0 ! hours = int(hours, 10) if not 0 <= hours <= 23: raise ValueError, "illegal hour number: " + m.group("hours") ! minutes = int(m.group("minutes"), 10) if not 0 <= minutes <= 59: raise ValueError, "illegal minutes number: " + m.group("minutes") --- 129,136 ---- if not hours: return 0, 0, 0 ! hours = int(hours) if not 0 <= hours <= 23: raise ValueError, "illegal hour number: " + m.group("hours") ! minutes = int(m.group("minutes")) if not 0 <= minutes <= 59: raise ValueError, "illegal minutes number: " + m.group("minutes") *************** *** 152,159 **** if tzd == "Z": return 0 ! hours = int(m.group("tzdhours"), 10) minutes = m.group("tzdminutes") if minutes: ! minutes = int(minutes, 10) else: minutes = 0 --- 154,161 ---- if tzd == "Z": return 0 ! hours = int(m.group("tzdhours")) minutes = m.group("tzdminutes") if minutes: ! minutes = int(minutes) else: minutes = 0 |