summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5183206)
raw | patch | inline | side by side (parent: 5183206)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 1 Aug 2001 04:24:21 +0000 (04:24 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 1 Aug 2001 04:24:21 +0000 (04:24 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@178 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/hyperdb.py | patch | blob | history | |
roundup/mailgw.py | patch | blob | history |
diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py
index ea37bddd6b1ef2d75512753678384e53265bec6c..3028535381447ee1b9aff0aa155196afa7802f9d 100644 (file)
--- a/roundup/hyperdb.py
+++ b/roundup/hyperdb.py
-# $Id: hyperdb.py,v 1.10 2001-07-30 02:38:31 richard Exp $
+# $iD: HYperdb.py,v 1.10 2001/07/30 02:38:31 richard Exp $
# standard python modules
import cPickle, re, string
else:
raise ValueError, 'node with key "%s" exists'%value
- prop = self.properties[key]
+ # try to handle this property
+ try:
+ prop = self.properties[key]
+ except KeyError:
+ raise KeyError, '"%s" has no property "%s"'%(self.classname,
+ key)
if prop.isLinkType:
if type(value) != type(''):
#
# $Log: not supported by cvs2svn $
+# Revision 1.10 2001/07/30 02:38:31 richard
+# get() now has a default arg - for migration only.
+#
# Revision 1.9 2001/07/29 09:28:23 richard
# Fixed sorting by clicking on column headings.
#
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 94655476de3217461f77235d95ccb0bbd0dd9671..e6d66cf9c3786ac28ce756d17aca19a1cb28ddb3 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.5 2001-07-29 07:01:39 richard Exp $
+$Id: mailgw.py,v 1.6 2001-08-01 04:24:21 richard Exp $
'''
# handle the files
files = []
for (name, type, data) in attachments:
- files.append(self.db.file.create(type=type, name=name, content=data))
+ files.append(self.db.file.create(type=type, name=name,
+ content=data))
# now handle the db stuff
if nodeid:
- # If an item designator (class name and id number) is found there, the
- # newly created "msg" node is added to the "messages" property for
- # that item, and any new "file" nodes are added to the "files"
+ # If an item designator (class name and id number) is found there,
+ # the newly created "msg" node is added to the "messages" property
+ # for that item, and any new "file" nodes are added to the "files"
# property for the item.
- message_id = self.db.msg.create(author=author, recipients=recipients,
- date=date.Date('.'), summary=summary, content=content,
- files=files)
+ message_id = self.db.msg.create(author=author,
+ recipients=recipients, date=date.Date('.'), summary=summary,
+ content=content, files=files)
messages = cl.get(nodeid, 'messages')
messages.append(message_id)
props['messages'] = messages
- apply(cl.set, (nodeid, ), props)
+ cl.set(nodeid, **props)
else:
# If just an item class name is found there, we attempt to create a
# new item of that class with its "messages" property initialized to
# contain the new "msg" node and its "files" property initialized to
# contain any new "file" nodes.
- message_id = self.db.msg.create(author=author, recipients=recipients,
- date=date.Date('.'), summary=summary, content=content,
- files=files)
- if not props.has_key('assignedto'):
+ message_id = self.db.msg.create(author=author,
+ recipients=recipients, date=date.Date('.'), summary=summary,
+ content=content, files=files)
+ # fill out the properties with defaults where required
+ if properties.has_key('assignedto') and \
+ not props.has_key('assignedto'):
props['assignedto'] = '1' # "admin"
- if not props.has_key('priority'):
- props['priority'] = '1' # "bug-fatal"
- if not props.has_key('status'):
+ if properties.has_key('status') and not props.has_key('status'):
props['status'] = '1' # "unread"
- if not props.has_key('title'):
+ if properties.has_key('title') and not props.has_key('title'):
props['title'] = title
props['messages'] = [message_id]
props['nosy'] = recipients[:]
#
# $Log: not supported by cvs2svn $
+# Revision 1.5 2001/07/29 07:01:39 richard
+# Added vim command to all source so that we don't get no steenkin' tabs :)
+#
# Revision 1.4 2001/07/28 06:43:02 richard
# Multipart message class has the getPart method now. Added some tests for it.
#