summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 279c31d)
raw | patch | inline | side by side (parent: 279c31d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 4 Dec 2003 23:06:53 +0000 (23:06 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 4 Dec 2003 23:06:53 +0000 (23:06 +0000) |
- fixed date arithmetic to limit hours-per-day to 24, not 60
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2009 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2009 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/date.py | patch | blob | history | |
test/test_dates.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 2b856ee41f6b41cc4b72751fcaaa4f9fb31837ab..b2a94094c2c86c4dd61fd80590ba763608e2700d 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- added postgresql backend (originally from sf patch 761740, many changes
since)
- all RDBMS backends now have indexes on several columns
-- Change nosymessage and send_message to accept msgid=None (RFE #707235).
-- Handle Resent-From: headers (sf bug 841151)
-- Existing trackers (ie. live ones) may be used as templates for new
+- change nosymessage and send_message to accept msgid=None (RFE #707235).
+- handle Resent-From: headers (sf bug 841151)
+- existing trackers (ie. live ones) may be used as templates for new
trackers - the TEMPLATE-INFO.txt name entry has the tracker's dir name
appended (so the demo tracker's template name is "classic-demo")
-- Always sort MultilinkHTMLProperty in the correct order, usually
+- always sort MultilinkHTMLProperty in the correct order, usually
alphabetically (sf feature 790512).
Fixed:
- added testing of schema mutation, fixed rdbms backends handling of a
couple of cases
- HTML 4.01 validation on the 'classic' backend
-- Messages to the mailgw can be about classes other than issues now.
-- Signature matching is more precise (sf bug 827775).
-- Anonymous user can no longer edit or view itself (sf bug 828901).
-- Corrected typo in installation.html (sf bug 822967).
-- Clarified listTemplates docstring.
-- Print a nicer error message when the address is already in use
+- messages to the mailgw can be about classes other than issues now.
+- signature matching is more precise (sf bug 827775).
+- anonymous user can no longer edit or view itself (sf bug 828901).
+- corrected typo in installation.html (sf bug 822967).
+- clarified listTemplates docstring.
+- print a nicer error message when the address is already in use
(sf bug 798659).
-- Remove empty lines before sending strings off to the csv parser
+- remove empty lines before sending strings off to the csv parser
(sf bug 821364).
-- Centralised conversion of user-input data to hyperdb values (sf bug 802405,
+- centralised conversion of user-input data to hyperdb values (sf bug 802405,
sf bug 817217, sf rfe 816994)
- recalculate SHA on template files when installed tracker used as
template (sf bug 827510)
widget
Cleanup:
-- Replace curuserid attribute on Database with the extended getuid() method.
-- Extract a new 'mailer' module for sending mail.
-- Extract a '_send_mail' method for testing mail sending.
-- Simplify backend importing.
-- Use roundup_server in demo.py.
-- Implement newItemAction using editItemAction.
-- Use FormError in client.py, moving the handling up to inner_main().
-- Implemented semantic comparison of Message objects in test_mailgw.
+- replace curuserid attribute on Database with the extended getuid() method.
+- extract a new 'mailer' module for sending mail.
+- extract a '_send_mail' method for testing mail sending.
+- simplify backend importing.
+- use roundup_server in demo.py.
+- implement newItemAction using editItemAction.
+- use FormError in client.py, moving the handling up to inner_main().
+- implemented semantic comparison of Message objects in test_mailgw.
2003-??-?? 0.6.4
Fixed:
-- Hard-coded python2.3-ism (socket.timeout) fixed
-- Fixed activity displaying as future because of Date arithmetic fix in 0.6.3
+- fixed date arithmetic to not allow day-of-month == 0 (sf bug 853306)
+- fixed date arithmetic to limit hours-per-day to 24, not 60
+- hard-coded python2.3-ism (socket.timeout) fixed
+- fixed activity displaying as future because of Date arithmetic fix in 0.6.3
(sf bug 842027).
2003-11-14 0.6.3
Fixed:
-- Fixed detectors fix incorrectly fixed in bugfix release 0.6.2
-- Added note to upgrading doc for detectors fix in 0.6.2
-- Added script to help migrating queries from pre-0.6 trackers
-- Fixed "documentation" of getnodeids in roundup.hyperdb
-- Added flush() to DevNull (sf bug 835365)
-- Fixed javascript for help window for only one checkbox case
-- Date arithmetic was utterly broken, and has been for a long time.
+- fixed detectors fix incorrectly fixed in bugfix release 0.6.2
+- added note to upgrading doc for detectors fix in 0.6.2
+- added script to help migrating queries from pre-0.6 trackers
+- fixed "documentation" of getnodeids in roundup.hyperdb
+- added flush() to DevNull (sf bug 835365)
+- fixed javascript for help window for only one checkbox case
+- date arithmetic was utterly broken, and has been for a long time.
Date +/- Interval now works, and Date - Date also works (produces
an Interval.
-- Handle socket timeout exception (thanks Marcus Priesch)
-- Fixed retirement of items in rdbms imports (sf bug 841355)
-- Fixed bug in looking up journal of newly-created items in *dbm backends
+- handle socket timeout exception (thanks Marcus Priesch)
+- fixed retirement of items in rdbms imports (sf bug 841355)
+- fixed bug in looking up journal of newly-created items in *dbm backends
2003-09-29 0.6.2
diff --git a/roundup/date.py b/roundup/date.py
index b9fd398c160b56d844192fb778bb890e928838b5..b07bcf1664a41a34550da3f28f26b9e568c5cb38 100644 (file)
--- a/roundup/date.py
+++ b/roundup/date.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: date.py,v 1.57 2003-11-19 22:53:15 jlgijsbers Exp $
+# $Id: date.py,v 1.58 2003-12-04 23:06:53 richard Exp $
__doc__ = """
Date, time and time interval handling.
# now cope with under- and over-flow
# first do the time
while (second < 0 or second > 59 or minute < 0 or minute > 59 or
- hour < 0 or hour > 59):
+ hour < 0 or hour > 23):
if second < 0: minute -= 1; second += 60
elif second > 59: minute += 1; second -= 60
if minute < 0: hour -= 1; minute += 60
elif minute > 59: hour += 1; minute -= 60
if hour < 0: day -= 1; hour += 24
- elif hour > 59: day += 1; hour -= 24
+ elif hour > 23: day += 1; hour -= 24
# fix up the month so we're within range
while month < 1 or month > 12:
if month > 12: year += 1; month -= 12
# now do the days, now that we know what month we're in
- def get_mdays(year,month):
+ def get_mdays(year, month):
if month == 2 and calendar.isleap(year): return 29
else: return calendar.mdays[month]
-
- while month < 1 or month > 12 or day < 0 or day > get_mdays(year,month):
+
+ while month < 1 or month > 12 or day < 1 or day > get_mdays(year,month):
# now to day under/over
- if day < 0:
+ if day < 1:
# When going backwards, decrement month, then increment days
month -= 1
day += get_mdays(year,month)
diff --git a/test/test_dates.py b/test/test_dates.py
index 2c92acaaab33f2b26dd15d268ffc0c8006210d9f..f213360b75e8d6bb5d9e9d43832e9b665b32dec8 100644 (file)
--- a/test/test_dates.py
+++ b/test/test_dates.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: test_dates.py,v 1.30 2003-11-19 22:53:14 jlgijsbers Exp $
+# $Id: test_dates.py,v 1.31 2003-12-04 23:06:53 richard Exp $
from __future__ import nested_scopes
import unittest, time
def testOffsetSub(self):
ae = self.assertEqual
+ date = Date('2000-12-01') - Interval('- 1d')
+
date = Date('2000-01-01') - Interval('- 2y 2m')
ae(str(date), '2002-03-01.00:00:00')
date = Date('2000-01-01') - Interval('2m')