summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c1fb0c8)
raw | patch | inline | side by side (parent: c1fb0c8)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 2 Dec 2001 05:06:16 +0000 (05:06 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 2 Dec 2001 05:06:16 +0000 (05:06 +0000) |
the close() method on the database is no longer needed.
I bumped the minimum python requirement up to 2.1 accordingly.
. #487480 ] roundup-server
. #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.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@443 57a73879-2fb5-44c3-a270-3262357dd7e2
I bumped the minimum python requirement up to 2.1 accordingly.
. #487480 ] roundup-server
. #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.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@443 57a73879-2fb5-44c3-a270-3262357dd7e2
13 files changed:
diff --git a/CHANGES.txt b/CHANGES.txt
index 62bf81156bfa83710feed54fba4e7a2036455bde..bd0eb609b768664a3c56d510c7c2dde59071c0a1 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
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
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
diff --git a/INSTALL.txt b/INSTALL.txt
index 7827dfe19ecbc2311e60706504c0bad683b72861..272f94ef0e21221c61b51608e4210021ff2fa415 100644 (file)
--- a/INSTALL.txt
+++ b/INSTALL.txt
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:
diff --git a/cgi-bin/roundup.cgi b/cgi-bin/roundup.cgi
index d327ee3b8d4298e1f8009ccb370536a38a818e32..8434db1c0b8f9c3e4de7d960d2ca4e77a78fd1e8 100755 (executable)
--- a/cgi-bin/roundup.cgi
+++ b/cgi-bin/roundup.cgi
# 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)
#
#
# $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
#
diff --git a/roundup-admin b/roundup-admin
index e5f48a69d581f589d07e8ebb07ca2c79ab5e9b42..948c5663f4d684e110f8d15b6739e30fc17055cb 100755 (executable)
--- a/roundup-admin
+++ b/roundup-admin
# 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
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.
else:
ret = self.run_command(args)
if self.db: self.db.commit()
- if self.db: self.db.close()
return ret
#
# $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
#
diff --git a/roundup-mailgw b/roundup-mailgw
index 94623c59eea5a2d00f1e537d5f95ef2eb8d15401..9e3a006ae3ce9c2e8cd62cad0062883898551940 100755 (executable)
--- a/roundup-mailgw
+++ b/roundup-mailgw
# 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
#
# $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
diff --git a/roundup-server b/roundup-server
index 4ff953a266105fcfeae3bcc021cddac67db33fef..b56e644afe2601314188fccf092d7f3c8fbea168 100755 (executable)
--- a/roundup-server
+++ b/roundup-server
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
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)
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():
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()
#
# $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
#
index 38305b574d7a7fc90dc876d7a866ea089a529621..156857e1bd9af090e196b1b9d220bf4d68debf09 100644 (file)
# 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
if not db.has_key(nodeid):
raise IndexError, nodeid
res = marshal.loads(db[nodeid])
- if not cldb: db.close()
cache[nodeid] = res
return res
# 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):
# 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):
db = cldb or self.getclassdb(classname)
res = res + db.keys()
- if not cldb: db.close()
return res
#
(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
'''
# lock the DB
for method, args in self.transactions:
- print method.__name__, args
# TODO: optimise this, duh!
method(*args)
# unlock the DB
#
#$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
#
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index 451ae5b88b084c20a6c5949b848f8451ec043f24..f7075eaad15e376e18d5721c6b5e819f2dce03c9 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
# 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).
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:
# 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'):
-
- # handle the note
- if note:
- if '\n' in note:
- summary = re.split(r'\n\r?', note)[0]
- else:
- summary = note
- m = ['%s\n'%note]
+ 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 = _('This %(classname)s has been edited through'
- ' the web.\n')%{'classname': cn}
- m = [summary]
-
- # 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
+ 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)
+
+ # 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.
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:
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:
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
'''
# 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
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
# 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.
#
# $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.
#
diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py
index 779db2285b31389241d0c4398e90afb7d6498605..bfcd921b2b89c4b9cd2d4f1efd49a4f13a603deb 100644 (file)
--- a/roundup/hyperdb.py
+++ b/roundup/hyperdb.py
# 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
"""
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
continue
if node[self.key] == keyvalue:
return nodeid
- cldb.close()
raise KeyError, keyvalue
# XXX: change from spec - allows multiple props to match
l.append(id)
elif isinstance(prop, Multilink) and nodeid in property:
l.append(id)
- cldb.close()
return l
def stringFind(self, **requirements):
break
else:
l.append(nodeid)
- cldb.close()
return l
def list(self):
continue
l.append(nodeid)
l.sort()
- cldb.close()
return l
# XXX not in spec
else:
l.append((nodeid, node))
l.sort()
- cldb.close()
# optimise sort
m = []
#
# $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
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index fb4c84bf055530421b9d498dd8b47dc2102a178d..f3c1f4c7dfdf715478f8e05918dd8f60ceebe3fd 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
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 $
'''
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)
#
# $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
index 4a9e2b0eb04813a7f018ece5395ea247096eb232..865ee757b5aa9aa79e2bd26a8ff4291065f55a70 100644 (file)
# 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
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
index e97c28416c672d13f648a9218b6c2895f017bccd..57cb45c48ce58573453c5060504f923cb48827bb 100644 (file)
# 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
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
diff --git a/test/test_db.py b/test/test_db.py
index 83da8f1e3acf6dae7db9fa074cee20dce6c7e735..61c08a669c861b9112db963006c3c33af3ad7a01 100644 (file)
--- a/test/test_db.py
+++ b/test/test_db.py
# 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
# return MyTestResult()
def tearDown(self):
if self.db is not None:
- self.db.close()
shutil.rmtree('_test_dir')
class DBTestCase(MyTestCase):
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)
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)
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)
#
# $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.