summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: df67e03)
raw | patch | inline | side by side (parent: df67e03)
author | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 18 Dec 2001 15:30:34 +0000 (15:30 +0000) | ||
committer | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 18 Dec 2001 15:30:34 +0000 (15:30 +0000) |
. Fixed file creation and retrieval in same transaction in anydbm
backend
. Cgi interface now renders new issue after issue creation
. Could not set issue status to resolved through cgi interface
. Mail gateway was changing status back to 'chatting' if status was
omitted as an argument
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@476 57a73879-2fb5-44c3-a270-3262357dd7e2
backend
. Cgi interface now renders new issue after issue creation
. Could not set issue status to resolved through cgi interface
. Mail gateway was changing status back to 'chatting' if status was
omitted as an argument
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@476 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_anydbm.py | patch | blob | history | |
roundup/cgi_client.py | patch | blob | history | |
roundup/mailgw.py | patch | blob | history |
index 0d52750cf605106f40fe1de70129962023924575..b6226aac7de490ad1ef17b067a53638f0bf0ef9a 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: back_anydbm.py,v 1.19 2001-12-17 03:52:48 richard Exp $
+#$Id: back_anydbm.py,v 1.20 2001-12-18 15:30:34 rochecompaan Exp $
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
def getfile(self, classname, nodeid, property):
'''Store the content of the file in the database.
'''
- return open(self.filename(classname, nodeid, property), 'rb').read()
+ filename = self.filename(classname, nodeid, property)
+ try:
+ return open(filename, 'rb').read()
+ except:
+ return open(filename+'.tmp', 'rb').read()
#
#
#$Log: not supported by cvs2svn $
+#Revision 1.19 2001/12/17 03:52:48 richard
+#Implemented file store rollback. As a bonus, the hyperdb is now capable of
+#storing more than one file per node - if a property name is supplied,
+#the file is called designator.property.
+#I decided not to migrate the existing files stored over to the new naming
+#scheme - the FileClass just doesn't specify the property name.
+#
#Revision 1.18 2001/12/16 10:53:38 richard
#take a copy of the node dict so that the subsequent set
#operation doesn't modify the oldvalues structure
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index f47da62d77a86f9021a51876b66140cf4897a613..e3dee1c27162ba6f27a2113b97898003d5e66efa 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.83 2001-12-15 23:51:01 richard Exp $
+# $Id: cgi_client.py,v 1.84 2001-12-18 15:30:30 rochecompaan Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
unread_id = self.db.status.lookup('unread')
resolved_id = self.db.status.lookup('resolved')
chatting_id = self.db.status.lookup('chatting')
+ current_status = cl.get(self.nodeid, 'status')
except KeyError:
pass
else:
- if (props['status'] == unread_id or props['status'] == resolved_id):
+ if (props['status'] == unread_id or props['status'] == resolved_id and current_status == resolved_id):
props['status'] = chatting_id
# add assignedto to the nosy list
if props.has_key('assignedto'):
self._post_editnode(nid)
# and some nice feedback for the user
message = _('%(classname)s created ok')%{'classname': cn}
+
+ self.db.commit()
+ # render the newly created issue
+ self.nodeid = nid
+ self.pagehead('%s: %s'%(self.classname.capitalize(), nid),
+ message)
+ item = htmltemplate.ItemTemplate(self, self.TEMPLATES,
+ self.classname)
+ item.render(nid)
+ self.pagefoot()
except:
self.db.rollback()
s = StringIO.StringIO()
traceback.print_exc(None, s)
message = '<pre>%s</pre>'%cgi.escape(s.getvalue())
- self.pagehead(_('New %(classname)s')%{'classname':
- self.classname.capitalize()}, message)
+ else:
+ self.pagehead(_('New %(classname)s')%{'classname':
+ self.classname.capitalize()}, message)
- # call the template
- newitem = htmltemplate.NewItemTemplate(self, self.TEMPLATES,
- self.classname)
- newitem.render(self.form)
+ # call the template
+ newitem = htmltemplate.NewItemTemplate(self, self.TEMPLATES,
+ self.classname)
+ newitem.render(self.form)
- self.pagefoot()
+ self.pagefoot()
newissue = newnode
def newuser(self, message=None):
#
# $Log: not supported by cvs2svn $
+# Revision 1.83 2001/12/15 23:51:01 richard
+# Tested the changes and fixed a few problems:
+# . files are now attached to the issue as well as the message
+# . newuser is a real method now since we don't want to do the message/file
+# stuff for it
+# . added some documentation
+# The really big changes in the diff are a result of me moving some code
+# around to keep like methods together a bit better.
+#
# Revision 1.82 2001/12/15 19:24:39 rochecompaan
# . Modified cgi interface to change properties only once all changes are
# collected, files created and messages generated.
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 22dc1f9b5a28c88eda004aa650261ac53d293950..f533c755f4ddac8026463f29c36157c1c0f20ac7 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.43 2001-12-15 19:39:01 rochecompaan Exp $
+$Id: mailgw.py,v 1.44 2001-12-18 15:30:34 rochecompaan Exp $
'''
except KeyError:
pass
else:
- if (not props.has_key('status') or
- props['status'] == unread_id or
- props['status'] == resolved_id):
+ if (not props.has_key('status') and
+ properties['status'] == unread_id or
+ properties['status'] == resolved_id):
props['status'] = chatting_id
# add nosy in arguments to issue's nosy list
#
# $Log: not supported by cvs2svn $
+# Revision 1.43 2001/12/15 19:39:01 rochecompaan
+# Oops.
+#
# Revision 1.42 2001/12/15 19:24:39 rochecompaan
# . Modified cgi interface to change properties only once all changes are
# collected, files created and messages generated.