Mercurial > p > roundup > code
changeset 431:a28a80b714f9
Eliminate database close method by using weakrefs.
. We now use weakrefs in the Classes to keep the database reference, so
the close() method on the database is no longer needed.
I bumped the minimum python requirement up to 2.1 accordingly.
. [SF#487480] roundup-server
. [SF#487476] INSTALL.txt
I also cleaned up the change message / post-edit stuff in the cgi client.
There's now a clearly marked "TODO: append the change note" where I believe
the change note should be added there. The "changes" list will obviously
have to be modified to be a dict of the changes, or somesuch.
More testing needed.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 02 Dec 2001 05:06:16 +0000 |
| parents | 350685601f37 |
| children | f97415cccb9d |
| files | CHANGES.txt INSTALL.txt cgi-bin/roundup.cgi roundup-admin roundup-mailgw roundup-server roundup/backends/back_anydbm.py roundup/cgi_client.py roundup/hyperdb.py roundup/mailgw.py roundup/templates/classic/dbinit.py roundup/templates/extended/dbinit.py test/test_db.py |
| diffstat | 13 files changed, 215 insertions(+), 135 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Sat Dec 01 07:17:50 2001 +0000 +++ b/CHANGES.txt Sun Dec 02 05:06:16 2001 +0000 @@ -14,6 +14,7 @@ the database when the commit() method is called. Only the anydbm backend is modified in this way - neither of the bsddb backends have been. + Fixed: . Lots of bugs, thanks Roché and others on the devel mailing list! . login_action and newuser_action return values were being ignored @@ -21,6 +22,10 @@ gateway. . Fixed login/registration forwarding the user to the right page (or not, on a failure) + . We now use weakrefs in the Classes to keep the database reference, so + the close() method on the database is no longer needed. + . #487480 ] roundup-server + . #487476 ] INSTALL.txt 2001-11-23 - 0.3.0
--- a/INSTALL.txt Sat Dec 01 07:17:50 2001 +0000 +++ b/INSTALL.txt Sun Dec 02 05:06:16 2001 +0000 @@ -64,7 +64,7 @@ MAIL_DOMAIN - The domain name used for email addresses Any further configuration should be possible by editing the instance home's -__init__.py directly. +instance_config.py directly. The email addresses used by the system by default are:
--- a/cgi-bin/roundup.cgi Sat Dec 01 07:17:50 2001 +0000 +++ b/cgi-bin/roundup.cgi Sun Dec 02 05:06:16 2001 +0000 @@ -16,13 +16,13 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup.cgi,v 1.20 2001-11-26 22:55:56 richard Exp $ +# $Id: roundup.cgi,v 1.21 2001-12-02 05:06:16 richard Exp $ # python version check import sys -if int(sys.version[0]) < 2: +if not hasattr(sys, 'version_info') or sys.version_info[:2] < (2,1): print "Content-Type: text/plain\n" - print "Roundup requires Python 2.0 or newer." + print "Roundup requires Python 2.1 or newer." sys.exit(0) # @@ -200,6 +200,18 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.20 2001/11/26 22:55:56 richard +# Feature: +# . Added INSTANCE_NAME to configuration - used in web and email to identify +# the instance. +# . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup +# signature info in e-mails. +# . Some more flexibility in the mail gateway and more error handling. +# . Login now takes you to the page you back to the were denied access to. +# +# Fixed: +# . Lots of bugs, thanks Roché and others on the devel mailing list! +# # Revision 1.19 2001/11/22 00:25:10 richard # quick fix for file uploads on windows in roundup.cgi #
--- a/roundup-admin Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup-admin Sun Dec 02 05:06:16 2001 +0000 @@ -16,11 +16,11 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup-admin,v 1.49 2001-12-01 07:17:50 richard Exp $ +# $Id: roundup-admin,v 1.50 2001-12-02 05:06:16 richard Exp $ import sys -if int(sys.version[0]) < 2: - print 'Roundup requires python 2.0 or later.' +if not hasattr(sys, 'version_info') or sys.version_info[:2] < (2,1): + print 'Roundup requires python 2.1 or later.' sys.exit(1) import string, os, getpass, getopt, re, UserDict @@ -614,6 +614,32 @@ raise UsageError, 'no such %s node "%s"'%(classname, nodeid) return 0 + def do_commit(self, args): + '''Usage: commit + Commit all changes made to the database. + + The changes made during an interactive session are not + automatically written to the database - they must be committed + using this command. + + One-off commands on the command-line are automatically committed if + they are successful. + ''' + self.db.commit() + return 0 + + def do_rollback(self, args): + '''Usage: rollback + Undo all changes that are pending commit to the database. + + The changes made during an interactive session are not + automatically written to the database - they must be committed + manually. This command undoes all those changes, so a commit + immediately after would make no changes to the database. + ''' + self.db.commit() + return 0 + def do_retire(self, args): '''Usage: retire designator[,designator]* Retire the node specified by designator. @@ -883,7 +909,6 @@ else: ret = self.run_command(args) if self.db: self.db.commit() - if self.db: self.db.close() return ret @@ -893,6 +918,15 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.49 2001/12/01 07:17:50 richard +# . We now have basic transaction support! Information is only written to +# the database when the commit() method is called. Only the anydbm +# backend is modified in this way - neither of the bsddb backends have been. +# The mail, admin and cgi interfaces all use commit (except the admin tool +# doesn't have a commit command, so interactive users can't commit...) +# . Fixed login/registration forwarding the user to the right page (or not, +# on a failure) +# # Revision 1.48 2001/11/27 22:32:03 richard # typo #
--- a/roundup-mailgw Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup-mailgw Sun Dec 02 05:06:16 2001 +0000 @@ -16,11 +16,11 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundup-mailgw,v 1.16 2001-11-30 18:23:55 jhermann Exp $ +# $Id: roundup-mailgw,v 1.17 2001-12-02 05:06:16 richard Exp $ import sys, os, re, cStringIO -if int(sys.version[0]) < 2: - print "Roundup requires Python 2.0 or newer." +if not hasattr(sys, 'version_info') or sys.version_info[:2] < (2,1): + print "Roundup requires Python 2.1 or newer." sys.exit(1) from roundup.mailgw import Message @@ -168,6 +168,9 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.16 2001/11/30 18:23:55 jhermann +# Cleaned up strange import (less pollution, too) +# # Revision 1.15 2001/11/30 13:16:37 rochecompaan # Fixed bug. Mail gateway was not using the extended Message class # resulting in failed submissions when mails were processed from a Unix
--- a/roundup-server Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup-server Sun Dec 02 05:06:16 2001 +0000 @@ -20,13 +20,12 @@ Based on CGIHTTPServer in the Python library. -$Id: roundup-server,v 1.20 2001-11-26 22:55:56 richard Exp $ +$Id: roundup-server,v 1.21 2001-12-02 05:06:16 richard Exp $ """ import sys -if int(sys.version[0]) < 2: - print "Content-Type: text/plain\n" - print "Roundup requires Python 2.0 or newer." +if not hasattr(sys, 'version_info') or sys.version_info[:2] < (2,1): + print "Roundup requires Python 2.1 or newer." sys.exit(0) import os, urllib, StringIO, traceback, cgi, binascii, string, getopt, imp @@ -77,17 +76,18 @@ except cgi_client.NotFound: self.send_error(404, self.path) except cgi_client.Unauthorised: - self.wfile.write('Content-Type: text/html\n') - self.wfile.write('Status: 403\n\n') - self.wfile.write('You are not authorised to access this URL.') + self.send_error(403, self.path) except: + # it'd be nice to be able to detect if these are going to have + # any effect... + self.send_response(400) + self.send_header('Content-Type', 'text/html') + self.end_headers() try: reload(cgitb) - self.wfile.write("Content-Type: text/html\n\n") self.wfile.write(cgitb.breaker()) self.wfile.write(cgitb.html()) except: - self.wfile.write("Content-Type: text/html\n\n") self.wfile.write("<pre>") s = StringIO.StringIO() traceback.print_exc(None, s) @@ -100,8 +100,10 @@ def index(self): ''' Print up an index of the available instances ''' + self.send_response(200) + self.send_header('Content-Type', 'text/html') + self.end_headers() w = self.wfile.write - w("Content-Type: text/html\n\n") w('<html><head><title>Roundup instances index</title></head>\n') w('<body><h1>Roundup instances index</h1><ol>\n') for instance in self.ROUNDUP_INSTANCE_HOMES.keys(): @@ -161,21 +163,6 @@ decoded_query = query.replace('+', ' ') - # reload all modules - # TODO check for file timestamp changes and dependencies - #reload(date) - #reload(hyperdb) - #reload(roundupdb) - #reload(htmltemplate) - #reload(cgi_client) - #sys.path.insert(0, module_path) - #try: - # reload(instance) - #finally: - # del sys.path[0] - - self.send_response(200, "Script output follows") - # do the roundup thang client = instance.Client(instance, self, env) client.main() @@ -262,6 +249,18 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.20 2001/11/26 22:55:56 richard +# Feature: +# . Added INSTANCE_NAME to configuration - used in web and email to identify +# the instance. +# . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup +# signature info in e-mails. +# . Some more flexibility in the mail gateway and more error handling. +# . Login now takes you to the page you back to the were denied access to. +# +# Fixed: +# . Lots of bugs, thanks Roché and others on the devel mailing list! +# # Revision 1.19 2001/11/12 22:51:04 jhermann # Fixed option & associated error handling #
--- a/roundup/backends/back_anydbm.py Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup/backends/back_anydbm.py Sun Dec 02 05:06:16 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.12 2001-12-01 07:17:50 richard Exp $ +#$Id: back_anydbm.py,v 1.13 2001-12-02 05:06:16 richard Exp $ import anydbm, os, marshal from roundup import hyperdb, date, password @@ -134,7 +134,6 @@ if not db.has_key(nodeid): raise IndexError, nodeid res = marshal.loads(db[nodeid]) - if not cldb: db.close() cache[nodeid] = res return res @@ -149,7 +148,6 @@ # not in the cache - check the database db = cldb or self.getclassdb(classname) res = db.has_key(nodeid) - if not cldb: db.close() return res def countnodes(self, classname, cldb=None): @@ -159,7 +157,6 @@ # and count those in the DB db = cldb or self.getclassdb(classname) count = count + len(db.keys()) - if not cldb: db.close() return count def getnodeids(self, classname, cldb=None): @@ -168,7 +165,6 @@ db = cldb or self.getclassdb(classname) res = res + db.keys() - if not cldb: db.close() return res # @@ -202,17 +198,8 @@ (nodeid, date_stamp, self.journaltag, action, params) = entry date_obj = date.Date(date_stamp) res.append((nodeid, date_obj, self.journaltag, action, params)) - db.close() return res - def close(self): - ''' Close the Database. - - Commit all data to the database and release circular refs so - the database is closed cleanly. - ''' - self.classes = {} - # # Basic transaction support @@ -222,7 +209,6 @@ ''' # lock the DB for method, args in self.transactions: - print method.__name__, args # TODO: optimise this, duh! method(*args) # unlock the DB @@ -262,6 +248,15 @@ # #$Log: not supported by cvs2svn $ +#Revision 1.12 2001/12/01 07:17:50 richard +#. We now have basic transaction support! Information is only written to +# the database when the commit() method is called. Only the anydbm +# backend is modified in this way - neither of the bsddb backends have been. +# The mail, admin and cgi interfaces all use commit (except the admin tool +# doesn't have a commit command, so interactive users can't commit...) +#. Fixed login/registration forwarding the user to the right page (or not, +# on a failure) +# #Revision 1.11 2001/11/21 02:34:18 richard #Added a target version field to the extended issue schema #
--- a/roundup/cgi_client.py Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup/cgi_client.py Sun Dec 02 05:06:16 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: cgi_client.py,v 1.73 2001-12-01 07:17:50 richard Exp $ +# $Id: cgi_client.py,v 1.74 2001-12-02 05:06:16 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -327,16 +327,15 @@ props['status'] == resolved_id): props['status'] = chatting_id changed.append('status') - note = None - if self.form.has_key('__note'): - note = self.form['__note'] - note = note.value - if changed or note: - p = self._post_editnode(self.nodeid, changed) - props['messages'] = p['messages'] - props['files'] = p['files'] - cl.set(self.nodeid, **props) - # and some nice feedback for the user + + # make the changes + cl.set(self.nodeid, **props) + + # handle linked nodes and change message generation + self._post_editnode(self.nodeid, changed) + + # and some nice feedback for the user + if changed: message = _('%(changes)s edited ok')%{'changes': ', '.join(changed)} else: @@ -476,40 +475,54 @@ # create the new file entry files.append(self.db.file.create(type=mime_type, name=file.filename, content=file.file.read())) + # and save the reference + cl.set(nid, files=files) + if changes is not None and 'file' not in changes: + changes.append('file') + # # generate an edit message - # don't bother if there's no messages or nosy list + # + + # we don't want to do a message if none of the following is true... props = cl.getprops() note = None if self.form.has_key('__note'): note = self.form['__note'] note = note.value - send = len(cl.get(nid, 'nosy', [])) or note - if (send and props.has_key('messages') and - isinstance(props['messages'], hyperdb.Multilink) and - props['messages'].classname == 'msg'): + if not props.has_key('messages'): + return + if not isinstance(props['messages'], hyperdb.Multilink): + return + if not props['messages'].classname == 'msg': + return + if not (len(cl.get(nid, 'nosy', [])) or note): + return - # handle the note - if note: - if '\n' in note: - summary = re.split(r'\n\r?', note)[0] - else: - summary = note - m = ['%s\n'%note] + # handle the note + if note: + if '\n' in note: + summary = re.split(r'\n\r?', note)[0] else: - summary = _('This %(classname)s has been edited through' - ' the web.\n')%{'classname': cn} - m = [summary] + summary = note + m = ['%s\n'%note] + else: + summary = _('This %(classname)s has been edited through' + ' the web.\n')%{'classname': cn} + m = [summary] + + # TODO: append the change note! - # now create the message - content = '\n'.join(m) - message_id = self.db.msg.create(author=self.getuid(), - recipients=[], date=date.Date('.'), summary=summary, - content=content, files=files) - messages = cl.get(nid, 'messages') - messages.append(message_id) - props = {'messages': messages, 'files': files} - return props + # now create the message + content = '\n'.join(m) + message_id = self.db.msg.create(author=self.getuid(), + recipients=[], date=date.Date('.'), summary=summary, + content=content, files=files) + + # update the messages property + messages = cl.get(nid, 'messages') + messages.append(message_id) + cl.set(nid, messages=messages, files=files) def newnode(self, message=None): ''' Add a new node to the database. @@ -542,8 +555,8 @@ props = {} try: nid = self._createnode() - props = self._post_editnode(nid) - cl.set(nid, **props) + # handle linked nodes and change message generation + self._post_editnode(nid) # and some nice feedback for the user message = _('%(classname)s created ok')%{'classname': cn} except: @@ -579,8 +592,11 @@ mime_type = mimetypes.guess_type(file.filename)[0] if not mime_type: mime_type = "application/octet-stream" - self._post_editnode(cl.create(content=file.file.read(), - type=mime_type, name=file.filename)) + # save the file + nid = cl.create(content=file.file.read(), type=mime_type, + name=file.filename) + # handle linked nodes + self._post_editnode(nid) # and some nice feedback for the user message = _('%(classname)s created ok')%{'classname': cn} except: @@ -713,7 +729,6 @@ return 1 on successful login ''' # re-open the database as "admin" - self.db.close() self.db = self.instance.open('admin') # TODO: pre-check the required fields and username key property @@ -767,25 +782,6 @@ ''' # determine the uid to use self.db = self.instance.open('admin') - try: - self.main_user() - finally: - self.db.close() - - # re-open the database for real, using the user - self.db = self.instance.open(self.user) - try: - self.main_action() - except: - self.db.close() - raise - self.db.commit() - self.db.close() - - - def main_user(self): - '''Figure out who the user is - ''' cookie = Cookie.Cookie(self.env.get('HTTP_COOKIE', '')) user = 'anonymous' if (cookie.has_key('roundup_user') and @@ -814,11 +810,9 @@ else: self.user = user + # re-open the database for real, using the user + self.db = self.instance.open(self.user) - def main_action(self): - '''Check for appropriate access permission, and then perform the - action the users specifies - ''' # now figure which function to call path = self.split_path @@ -874,6 +868,9 @@ # just a regular action self.do_action(action) + # commit all changes to the database + self.db.commit() + def do_action(self, action, dre=re.compile(r'([^\d]+)(\d+)'), nre=re.compile(r'new(\w+)')): '''Figure the user's action and do it. @@ -1071,6 +1068,15 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.73 2001/12/01 07:17:50 richard +# . We now have basic transaction support! Information is only written to +# the database when the commit() method is called. Only the anydbm +# backend is modified in this way - neither of the bsddb backends have been. +# The mail, admin and cgi interfaces all use commit (except the admin tool +# doesn't have a commit command, so interactive users can't commit...) +# . Fixed login/registration forwarding the user to the right page (or not, +# on a failure) +# # Revision 1.72 2001/11/30 20:47:58 rochecompaan # Links in page header are now consistent with default sort order. #
--- a/roundup/hyperdb.py Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup/hyperdb.py Sun Dec 02 05:06:16 2001 +0000 @@ -15,14 +15,14 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: hyperdb.py,v 1.38 2001-12-01 07:17:50 richard Exp $ +# $Id: hyperdb.py,v 1.39 2001-12-02 05:06:16 richard Exp $ __doc__ = """ Hyperdatabase implementation, especially field types. """ # standard python modules -import cPickle, re, string +import cPickle, re, string, weakref # roundup modules import date, password @@ -96,7 +96,7 @@ """ self.classname = classname self.properties = properties - self.db = db + self.db = weakref.proxy(db) # use a weak ref to avoid circularity self.key = '' # do the db-related init stuff @@ -495,7 +495,6 @@ continue if node[self.key] == keyvalue: return nodeid - cldb.close() raise KeyError, keyvalue # XXX: change from spec - allows multiple props to match @@ -532,7 +531,6 @@ l.append(id) elif isinstance(prop, Multilink) and nodeid in property: l.append(id) - cldb.close() return l def stringFind(self, **requirements): @@ -559,7 +557,6 @@ break else: l.append(nodeid) - cldb.close() return l def list(self): @@ -573,7 +570,6 @@ continue l.append(nodeid) l.sort() - cldb.close() return l # XXX not in spec @@ -666,7 +662,6 @@ else: l.append((nodeid, node)) l.sort() - cldb.close() # optimise sort m = [] @@ -873,6 +868,15 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.38 2001/12/01 07:17:50 richard +# . We now have basic transaction support! Information is only written to +# the database when the commit() method is called. Only the anydbm +# backend is modified in this way - neither of the bsddb backends have been. +# The mail, admin and cgi interfaces all use commit (except the admin tool +# doesn't have a commit command, so interactive users can't commit...) +# . Fixed login/registration forwarding the user to the right page (or not, +# on a failure) +# # Revision 1.37 2001/11/28 21:55:35 richard # . login_action and newuser_action return values were being ignored # . Woohoo! Found that bloody re-login bug that was killing the mail
--- a/roundup/mailgw.py Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup/mailgw.py Sun Dec 02 05:06:16 2001 +0000 @@ -73,7 +73,7 @@ an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.38 2001-12-01 07:17:50 richard Exp $ +$Id: mailgw.py,v 1.39 2001-12-02 05:06:16 richard Exp $ ''' @@ -352,11 +352,8 @@ author = self.db.uidFromAddress(message.getaddrlist('from')[0]) # reopen the database as the author username = self.db.user.get(author, 'username') - self.db.close() self.db = self.instance.open(username) - self.handle_message(author, username, - # re-get the class with the new database connection cl = self.db.getclass(classname) @@ -601,6 +598,15 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.38 2001/12/01 07:17:50 richard +# . We now have basic transaction support! Information is only written to +# the database when the commit() method is called. Only the anydbm +# backend is modified in this way - neither of the bsddb backends have been. +# The mail, admin and cgi interfaces all use commit (except the admin tool +# doesn't have a commit command, so interactive users can't commit...) +# . Fixed login/registration forwarding the user to the right page (or not, +# on a failure) +# # Revision 1.37 2001/11/28 21:55:35 richard # . login_action and newuser_action return values were being ignored # . Woohoo! Found that bloody re-login bug that was killing the mail
--- a/roundup/templates/classic/dbinit.py Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup/templates/classic/dbinit.py Sun Dec 02 05:06:16 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: dbinit.py,v 1.11 2001-12-01 07:17:50 richard Exp $ +# $Id: dbinit.py,v 1.12 2001-12-02 05:06:16 richard Exp $ import os @@ -124,10 +124,18 @@ user.create(username="admin", password=adminpw, address=instance_config.ADMIN_EMAIL) db.commit() - db.close() # # $Log: not supported by cvs2svn $ +# Revision 1.11 2001/12/01 07:17:50 richard +# . We now have basic transaction support! Information is only written to +# the database when the commit() method is called. Only the anydbm +# backend is modified in this way - neither of the bsddb backends have been. +# The mail, admin and cgi interfaces all use commit (except the admin tool +# doesn't have a commit command, so interactive users can't commit...) +# . Fixed login/registration forwarding the user to the right page (or not, +# on a failure) +# # Revision 1.10 2001/11/26 22:55:56 richard # Feature: # . Added INSTANCE_NAME to configuration - used in web and email to identify
--- a/roundup/templates/extended/dbinit.py Sat Dec 01 07:17:50 2001 +0000 +++ b/roundup/templates/extended/dbinit.py Sun Dec 02 05:06:16 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: dbinit.py,v 1.16 2001-12-01 07:17:50 richard Exp $ +# $Id: dbinit.py,v 1.17 2001-12-02 05:06:16 richard Exp $ import os @@ -175,10 +175,18 @@ address=instance_config.ADMIN_EMAIL) db.commit() - db.close() # # $Log: not supported by cvs2svn $ +# Revision 1.16 2001/12/01 07:17:50 richard +# . We now have basic transaction support! Information is only written to +# the database when the commit() method is called. Only the anydbm +# backend is modified in this way - neither of the bsddb backends have been. +# The mail, admin and cgi interfaces all use commit (except the admin tool +# doesn't have a commit command, so interactive users can't commit...) +# . Fixed login/registration forwarding the user to the right page (or not, +# on a failure) +# # Revision 1.15 2001/11/26 22:55:56 richard # Feature: # . Added INSTANCE_NAME to configuration - used in web and email to identify
--- a/test/test_db.py Sat Dec 01 07:17:50 2001 +0000 +++ b/test/test_db.py Sun Dec 02 05:06:16 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: test_db.py,v 1.8 2001-10-09 07:25:59 richard Exp $ +# $Id: test_db.py,v 1.9 2001-12-02 05:06:16 richard Exp $ import unittest, os, shutil @@ -50,7 +50,6 @@ # return MyTestResult() def tearDown(self): if self.db is not None: - self.db.close() shutil.rmtree('_test_dir') class DBTestCase(MyTestCase): @@ -158,7 +157,6 @@ os.mkdir('_test_dir') db = anydbm.Database('_test_dir', 'test') setupSchema(db, 1) - db.close() self.db = anydbm.Database('_test_dir') setupSchema(self.db, 0) @@ -191,7 +189,6 @@ os.mkdir('_test_dir') db = bsddb.Database('_test_dir', 'test') setupSchema(db, 1) - db.close() self.db = bsddb.Database('_test_dir') setupSchema(self.db, 0) @@ -215,7 +212,6 @@ os.mkdir('_test_dir') db = bsddb3.Database('_test_dir', 'test') setupSchema(db, 1) - db.close() self.db = bsddb3.Database('_test_dir') setupSchema(self.db, 0) @@ -242,6 +238,10 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.8 2001/10/09 07:25:59 richard +# Added the Password property type. See "pydoc roundup.password" for +# implementation details. Have updated some of the documentation too. +# # Revision 1.7 2001/08/29 06:23:59 richard # Disabled the bsddb3 module entirely in the unit testing. See CHANGES for # details.
