Skip to content

Commit 9b2ba71

Browse files
author
Richard Jones
committed
fixes
1 parent f65b411 commit 9b2ba71

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Fixed:
2020
- fix python 2.3.3 strftime deprecation warning (sf patch 968398)
2121
- fix some column datatypes in postgresql and mysql (sf bugs 962611,
2222
959177 and 964231)
23+
- fixed RDBMS journal packing (sf bug 959177)
2324

2425

2526
2004-05-28 0.7.3

roundup/backends/rdbms_common.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.105 2004-06-09 05:13:14 richard Exp $
1+
# $Id: rdbms_common.py,v 1.106 2004-06-09 06:13:52 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1148,8 +1148,7 @@ def load_journal(self, classname, cols, nodeid):
11481148
def pack(self, pack_before):
11491149
''' Delete all journal entries except "create" before 'pack_before'.
11501150
'''
1151-
# get a 'yyyymmddhhmmss' version of the date
1152-
date_stamp = pack_before.serialise()
1151+
date_stamp = self.hyperdb_to_sql_value[Date](pack_before)
11531152

11541153
# do the delete
11551154
for classname in self.classes.keys():

roundup/date.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: date.py,v 1.72 2004-06-08 05:37:36 richard Exp $
18+
# $Id: date.py,v 1.73 2004-06-09 06:13:52 richard Exp $
1919

2020
"""Date, time and time interval handling.
2121
"""
@@ -662,7 +662,7 @@ def pretty(self):
662662
s = self.ngettext("%(number)s year", "%(number)s years",
663663
self.year) % {'number': self.year}
664664
elif self.month or self.day > 28:
665-
_months = int(((self.month * 30) + self.day) / 30)
665+
_months = max(1, int(((self.month * 30) + self.day) / 30))
666666
s = self.ngettext("%(number)s month", "%(number)s months",
667667
_months) % {'number': _months}
668668
elif self.day > 7:
@@ -689,7 +689,7 @@ def pretty(self):
689689
s = self._('1 1/2 hours')
690690
else:
691691
s = self.ngettext('1 %(number)s/4 hours',
692-
'1 %(number)s/4 hours', _quarters) % {'number': _quarters}
692+
'1 %(number)s/4 hours', _quarters)%{'number': _quarters}
693693
elif self.minute < 1:
694694
if self.sign > 0:
695695
return self._('in a moment')
@@ -705,7 +705,7 @@ def pretty(self):
705705
elif _quarters == 2:
706706
s = self._('1/2 an hour')
707707
else:
708-
s = self.ngettext('%(number)s/4 hours', '%(number)s/4 hours',
708+
s = self.ngettext('%(number)s/4 hour', '%(number)s/4 hours',
709709
_quarters) % {'number': _quarters}
710710
# XXX this is internationally broken
711711
if self.sign < 0:

0 commit comments

Comments
 (0)