Mercurial > p > roundup > code
diff roundup/mailgw.py @ 847:0f0f6049c9a7
made mailgw handle set and modify operations on multilinks [SF#579094]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 10 Jul 2002 06:39:37 +0000 |
| parents | 34eacaa7e313 |
| children | de3da99a7c02 |
line wrap: on
line diff
--- a/roundup/mailgw.py Wed Jul 10 06:34:13 2002 +0000 +++ b/roundup/mailgw.py Wed Jul 10 06:39:37 2002 +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.75 2002-07-09 01:21:24 richard Exp $ +$Id: mailgw.py,v 1.76 2002-07-10 06:39:37 richard Exp $ ''' @@ -445,6 +445,12 @@ curvalue = [] # handle each add/remove in turn + # keep an extra list for all items that are + # definitely in the new list (in case of e.g. + # <propname>=A,+B, which should replace the old + # list with A,B) + set = 0 + newvalue = [] for item in value.split(','): item = item.strip() @@ -455,6 +461,8 @@ item = item[1:] elif item.startswith('+'): item = item[1:] + else: + set = 1 # look up the value try: @@ -473,11 +481,16 @@ 'for %s.'%(item, propname)) continue else: + newvalue.append(item) if item not in curvalue: curvalue.append(item) - # that's it, set the new Multilink property value - props[propname] = curvalue + # that's it, set the new Multilink property value, + # or overwrite it completely + if set: + props[propname] = newvalue + else: + props[propname] = curvalue # handle any errors parsing the argument list if errors: @@ -771,6 +784,10 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.75 2002/07/09 01:21:24 richard +# Added ability for unit tests to turn off exception handling in mailgw so +# that exceptions are reported earlier (and hence make sense). +# # Revision 1.74 2002/05/29 01:16:17 richard # Sorry about this huge checkin! It's fixing a lot of related stuff in one go # though.
