Skip to content

Commit e90fe03

Browse files
author
Richard Jones
committed
Initial implementation (half-baked) at new Tracker instance.
Cleaned up caching API / comments in backends. Fixes to docs.
1 parent eb2a5b6 commit e90fe03

File tree

11 files changed

+129
-115
lines changed

11 files changed

+129
-115
lines changed

CHANGES.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

4-
2003-08-?? 0.6.1
4+
2003-09-?? 0.6.2
5+
Fixed:
6+
- cleaned up, clarified internal caching API in *dbm backends
7+
8+
9+
2003-08-31 0.6.1
510
Fixed:
611
- Add note about installing cgi-bin with a different interpreter
712
- Importing wasn't setting None values explicitly when it should have been

doc/announcement.txt

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,38 @@
11
=================================================
2-
SC-Track Roundup 0.6.0 - an issue tracking system
2+
SC-Track Roundup 0.6.1 - an issue tracking system
33
=================================================
44

5-
I'm pleased to announce the latest feature-packed release of Roundup. See
6-
below for a list of some of the goodies included in this release.
5+
I'm pleased to announce this maintenance release of Roundup. This fix
6+
introduces Python2.3 compatibility. My thanks to Paul Dubois for
7+
contributing the csv module compatibility layer.
78

89
If you're upgrading from an older version of Roundup you *must* follow
910
the "Software Upgrade" guidelines given in the maintenance documentation.
1011

1112
Unfortunately, the Zope frontend for Roundup is currently broken. I hope to
12-
revive it in a future 0.6 bugfix release.
13-
14-
The gadfly backend has now been removed, having served its purpose as a
15-
template for other RDBMS implementations. It is replaced by the sqlite and
16-
mysql backends.
13+
revive it in a future 0.6 maintenance release.
1714

1815
Roundup requires python 2.1.3 or later for correct operation.
1916

20-
The 0.6 release has lots of new goodies including:
21-
22-
- new instant-gratification Demo Mode ("python demo.py" :)
23-
- added mysql backend (see doc/mysql.txt for details)
24-
- web interface cleanups including nicer history display, nicer index
25-
navigation and nicer popup list windows
26-
- searching of date ranges
27-
- better international support, including utf-8 email handling and ability
28-
to display localized dates in web interface.
29-
- more documentation including revamped design document, unix manual pages
30-
and some FAQ entries
31-
- significantly more powerful form handling allowing editing of multiple
32-
items and creation of multiple items
33-
- tracker templates can contain subdirectories and static files (e.g.
34-
images) and we may now distribute templates separately from Roundup.
35-
Template HTML files now have a .html extension too.
36-
- user registration is now a two-step process, with confirmation from the
37-
email address supplied in the registration form, and we also have a
38-
password reset feature for forgotten password / login
39-
- Windows Service mode for roundup-server when daemonification is
40-
attempted on Windows
41-
- lots of speed enhancements, making the web interface much more responsive
42-
- fixed issues with dumb email or web clients
43-
- email system handles more SMTP and POP features (TLS, APOP, ...)
44-
- lots more little tweaks and back-end work...
17+
This release fixes some bugs:
18+
19+
- Add note about installing cgi-bin with a different interpreter
20+
- Importing wasn't setting None values explicitly when it should have been
21+
- Fixed import warning regarding 0xffff0000 literal, finally, really this
22+
time. Checked on win2k. (sf bug 786711)
23+
- Fix CGI editCSV action to handle metakit's integer itemids
24+
- Apply fix for "remove" links from Klamer Schutte
25+
- Added permission check on "remove" link while I was there..
26+
- Applied CSV fix for python2.3 (sf bug 790363)
27+
- Fixed form padding in LHS menu (sf bug 790502)
28+
- Fixed upgrading docs for timezones (sf bug 790498)
29+
- Set the content type on page templates (can have XML templates now)
30+
- Various cosmetic fixes (thanks James Kew for being persistent :)
31+
- Applied patch 739314 (sorry John!)
32+
33+
To give Roundup a try, just download (see below), unpack and run::
34+
35+
python demo.py
4536

4637
Source and documentation is available at the website:
4738
http://roundup.sourceforge.net/

doc/customizing.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.95 $
5+
:Version: $Revision: 1.96 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -1483,7 +1483,7 @@ _value the value of the property if any - this is the actual
14831483
There are several methods available on these wrapper objects:
14841484

14851485
=========== ================================================================
1486-
Method Description
1486+
Method Description
14871487
=========== ================================================================
14881488
plain render a "plain" representation of the property. This method
14891489
may take two arguments:

roundup/backends/back_anydbm.py

Lines changed: 22 additions & 30 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: back_anydbm.py,v 1.123 2003-08-26 00:06:55 richard Exp $
18+
#$Id: back_anydbm.py,v 1.124 2003-09-04 00:47:01 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -283,17 +283,20 @@ def savenode(self, classname, nodeid, node):
283283

284284
def getnode(self, classname, nodeid, db=None, cache=1):
285285
''' get a node from the database
286+
287+
Note the "cache" parameter is not used, and exists purely for
288+
backward compatibility!
286289
'''
287290
if __debug__:
288291
print >>hyperdb.DEBUG, 'getnode', (self, classname, nodeid, db)
289-
if cache:
290-
# try the cache
291-
cache_dict = self.cache.setdefault(classname, {})
292-
if cache_dict.has_key(nodeid):
293-
if __debug__:
294-
print >>hyperdb.TRACE, 'get %s %s cached'%(classname,
295-
nodeid)
296-
return cache_dict[nodeid]
292+
293+
# try the cache
294+
cache_dict = self.cache.setdefault(classname, {})
295+
if cache_dict.has_key(nodeid):
296+
if __debug__:
297+
print >>hyperdb.TRACE, 'get %s %s cached'%(classname,
298+
nodeid)
299+
return cache_dict[nodeid]
297300

298301
if __debug__:
299302
print >>hyperdb.TRACE, 'get %s %s'%(classname, nodeid)
@@ -1008,10 +1011,7 @@ def get(self, nodeid, propname, default=_marker, cache=1):
10081011
IndexError is raised. 'propname' must be the name of a property
10091012
of this class or a KeyError is raised.
10101013
1011-
'cache' indicates whether the transaction cache should be queried
1012-
for the node. If the node has been modified and you need to
1013-
determine what its values prior to modification are, you need to
1014-
set cache=0.
1014+
'cache' exists for backward compatibility, and is not used.
10151015
10161016
Attempts to get the "creation" or "activity" properties should
10171017
do the right thing.
@@ -1020,7 +1020,7 @@ def get(self, nodeid, propname, default=_marker, cache=1):
10201020
return nodeid
10211021

10221022
# get the node's dict
1023-
d = self.db.getnode(self.classname, nodeid, cache=cache)
1023+
d = self.db.getnode(self.classname, nodeid)
10241024

10251025
# check for one of the special props
10261026
if propname == 'creation':
@@ -1091,12 +1091,9 @@ def getnode(self, nodeid, cache=1):
10911091
'nodeid' must be the id of an existing node of this class or an
10921092
IndexError is raised.
10931093
1094-
'cache' indicates whether the transaction cache should be queried
1095-
for the node. If the node has been modified and you need to
1096-
determine what its values prior to modification are, you need to
1097-
set cache=0.
1094+
'cache' exists for backwards compatibility, and is not used.
10981095
'''
1099-
return Node(self, nodeid, cache=cache)
1096+
return Node(self, nodeid)
11001097

11011098
def set(self, nodeid, **propvalues):
11021099
'''Modify a property on an existing node of this class.
@@ -1134,14 +1131,7 @@ class or a KeyError is raised.
11341131
self.fireAuditors('set', nodeid, propvalues)
11351132
# Take a copy of the node dict so that the subsequent set
11361133
# operation doesn't modify the oldvalues structure.
1137-
try:
1138-
# try not using the cache initially
1139-
oldvalues = copy.deepcopy(self.db.getnode(self.classname, nodeid,
1140-
cache=0))
1141-
except IndexError:
1142-
# this will be needed if somone does a create() and set()
1143-
# with no intervening commit()
1144-
oldvalues = copy.deepcopy(self.db.getnode(self.classname, nodeid))
1134+
oldvalues = copy.deepcopy(self.db.getnode(self.classname, nodeid))
11451135

11461136
node = self.db.getnode(self.classname, nodeid)
11471137
if node.has_key(self.db.RETIRED_FLAG):
@@ -2040,7 +2030,9 @@ def import_list(self, propnames, proplist):
20402030
return newid
20412031

20422032
def get(self, nodeid, propname, default=_marker, cache=1):
2043-
''' trap the content propname and get it from the file
2033+
''' Trap the content propname and get it from the file
2034+
2035+
'cache' exists for backwards compatibility, and is not used.
20442036
'''
20452037
poss_msg = 'Possibly an access right configuration problem.'
20462038
if propname == 'content':
@@ -2051,9 +2043,9 @@ def get(self, nodeid, propname, default=_marker, cache=1):
20512043
return 'ERROR reading file: %s%s\n%s\n%s'%(
20522044
self.classname, nodeid, poss_msg, strerror)
20532045
if default is not _marker:
2054-
return Class.get(self, nodeid, propname, default, cache=cache)
2046+
return Class.get(self, nodeid, propname, default)
20552047
else:
2056-
return Class.get(self, nodeid, propname, cache=cache)
2048+
return Class.get(self, nodeid, propname)
20572049

20582050
def getprops(self, protected=1):
20592051
''' In addition to the actual properties on the node, these methods

roundup/backends/back_metakit.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.48 2003-08-26 00:06:56 richard Exp $
1+
# $Id: back_metakit.py,v 1.49 2003-09-04 00:47:01 richard Exp $
22
'''
33
Metakit backend for Roundup, originally by Gordon McMillan.
44
@@ -373,8 +373,9 @@ def create_inner(self, **propvalues):
373373
return str(newid)
374374

375375
def get(self, nodeid, propname, default=_marker, cache=1):
376-
# default and cache aren't in the spec
377-
# cache=0 means "original value"
376+
'''
377+
'cache' exists for backwards compatibility, and is not used.
378+
'''
378379

379380
view = self.getview()
380381
id = int(nodeid)
@@ -1407,7 +1408,7 @@ def __init__(self, db, classname, **properties):
14071408
Class.__init__(self, db, classname, **properties)
14081409

14091410
def get(self, nodeid, propname, default=_marker, cache=1):
1410-
x = Class.get(self, nodeid, propname, default, cache)
1411+
x = Class.get(self, nodeid, propname, default)
14111412
poss_msg = 'Possibly an access right configuration problem.'
14121413
if propname == 'content':
14131414
if x.startswith('file:'):

roundup/backends/rdbms_common.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.59 2003-08-26 00:06:56 richard Exp $
1+
# $Id: rdbms_common.py,v 1.60 2003-09-04 00:47:01 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1183,10 +1183,7 @@ def get(self, nodeid, propname, default=_marker, cache=1):
11831183
IndexError is raised. 'propname' must be the name of a property
11841184
of this class or a KeyError is raised.
11851185
1186-
'cache' indicates whether the transaction cache should be queried
1187-
for the node. If the node has been modified and you need to
1188-
determine what its values prior to modification are, you need to
1189-
set cache=0.
1186+
'cache' exists for backwards compatibility, and is not used.
11901187
'''
11911188
if propname == 'id':
11921189
return nodeid
@@ -1234,12 +1231,9 @@ def getnode(self, nodeid, cache=1):
12341231
'nodeid' must be the id of an existing node of this class or an
12351232
IndexError is raised.
12361233
1237-
'cache' indicates whether the transaction cache should be queried
1238-
for the node. If the node has been modified and you need to
1239-
determine what its values prior to modification are, you need to
1240-
set cache=0.
1234+
'cache' exists for backwards compatibility, and is not used.
12411235
'''
1242-
return Node(self, nodeid, cache=cache)
1236+
return Node(self, nodeid)
12431237

12441238
def set(self, nodeid, **propvalues):
12451239
'''Modify a property on an existing node of this class.
@@ -2094,7 +2088,9 @@ def import_list(self, propnames, proplist):
20942088

20952089
_marker = []
20962090
def get(self, nodeid, propname, default=_marker, cache=1):
2097-
''' trap the content propname and get it from the file
2091+
''' Trap the content propname and get it from the file
2092+
2093+
'cache' exists for backwards compatibility, and is not used.
20982094
'''
20992095
poss_msg = 'Possibly a access right configuration problem.'
21002096
if propname == 'content':
@@ -2105,9 +2101,9 @@ def get(self, nodeid, propname, default=_marker, cache=1):
21052101
return 'ERROR reading file: %s%s\n%s\n%s'%(
21062102
self.classname, nodeid, poss_msg, strerror)
21072103
if default is not self._marker:
2108-
return Class.get(self, nodeid, propname, default, cache=cache)
2104+
return Class.get(self, nodeid, propname, default)
21092105
else:
2110-
return Class.get(self, nodeid, propname, cache=cache)
2106+
return Class.get(self, nodeid, propname)
21112107

21122108
def getprops(self, protected=1):
21132109
''' In addition to the actual properties on the node, these methods

roundup/hyperdb.py

Lines changed: 10 additions & 15 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: hyperdb.py,v 1.87 2003-03-17 22:03:03 kedder Exp $
18+
# $Id: hyperdb.py,v 1.88 2003-09-04 00:47:01 richard Exp $
1919

2020
"""
2121
Hyperdatabase implementation, especially field types.
@@ -245,6 +245,8 @@ def unserialise(self, classname, node):
245245

246246
def getnode(self, classname, nodeid, db=None, cache=1):
247247
'''Get a node from the database.
248+
249+
'cache' exists for backwards compatibility, and is not used.
248250
'''
249251
raise NotImplementedError
250252

@@ -365,10 +367,7 @@ def get(self, nodeid, propname, default=_marker, cache=1):
365367
IndexError is raised. 'propname' must be the name of a property
366368
of this class or a KeyError is raised.
367369
368-
'cache' indicates whether the transaction cache should be queried
369-
for the node. If the node has been modified and you need to
370-
determine what its values prior to modification are, you need to
371-
set cache=0.
370+
'cache' exists for backwards compatibility, and is not used.
372371
"""
373372
raise NotImplementedError
374373

@@ -378,12 +377,9 @@ def getnode(self, nodeid, cache=1):
378377
'nodeid' must be the id of an existing node of this class or an
379378
IndexError is raised.
380379
381-
'cache' indicates whether the transaction cache should be queried
382-
for the node. If the node has been modified and you need to
383-
determine what its values prior to modification are, you need to
384-
set cache=0.
380+
'cache' exists for backwards compatibility, and is not used.
385381
'''
386-
return Node(self, nodeid, cache=cache)
382+
return Node(self, nodeid)
387383

388384
def set(self, nodeid, **propvalues):
389385
"""Modify a property on an existing node of this class.
@@ -580,18 +576,17 @@ class Node:
580576
def __init__(self, cl, nodeid, cache=1):
581577
self.__dict__['cl'] = cl
582578
self.__dict__['nodeid'] = nodeid
583-
self.__dict__['cache'] = cache
584579
def keys(self, protected=1):
585580
return self.cl.getprops(protected=protected).keys()
586581
def values(self, protected=1):
587582
l = []
588583
for name in self.cl.getprops(protected=protected).keys():
589-
l.append(self.cl.get(self.nodeid, name, cache=self.cache))
584+
l.append(self.cl.get(self.nodeid, name))
590585
return l
591586
def items(self, protected=1):
592587
l = []
593588
for name in self.cl.getprops(protected=protected).keys():
594-
l.append((name, self.cl.get(self.nodeid, name, cache=self.cache)))
589+
l.append((name, self.cl.get(self.nodeid, name)))
595590
return l
596591
def has_key(self, name):
597592
return self.cl.getprops().has_key(name)
@@ -604,15 +599,15 @@ def __getattr__(self, name):
604599
if self.__dict__.has_key(name):
605600
return self.__dict__[name]
606601
try:
607-
return self.cl.get(self.nodeid, name, cache=self.cache)
602+
return self.cl.get(self.nodeid, name)
608603
except KeyError, value:
609604
# we trap this but re-raise it as AttributeError - all other
610605
# exceptions should pass through untrapped
611606
pass
612607
# nope, no such attribute
613608
raise AttributeError, str(value)
614609
def __getitem__(self, name):
615-
return self.cl.get(self.nodeid, name, cache=self.cache)
610+
return self.cl.get(self.nodeid, name)
616611
def __setattr__(self, name, value):
617612
try:
618613
return self.cl.set(self.nodeid, **{name: value})

0 commit comments

Comments
 (0)