diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2013-02-22 17:01:08 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2013-02-22 17:01:08 +0000 |
commit | 7da40be1e6dce4c69266c4f41d4f78ac8573c8f9 (patch) | |
tree | 22da3386241a42b4e1c83975786c26dc2917bb7b /alot/db | |
parent | abecfea666e59aa9063615225797c16bd29ce721 (diff) |
fix Envelope __[sg]etitem__
to actually work on self.headers as *list* of strings for each key.
this hasn't been a problem since these convenience methods are not
really uset at all atm..
Diffstat (limited to 'alot/db')
-rw-r--r-- | alot/db/envelope.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/alot/db/envelope.py b/alot/db/envelope.py index 4db8f67b..9b79b22b 100644 --- a/alot/db/envelope.py +++ b/alot/db/envelope.py @@ -86,7 +86,9 @@ class Envelope(object): >>> envelope['Subject'] = u'sm\xf8rebr\xf8d' """ - self.headers[name] = val + if name not in self.headers: + self.headers[name] = [] + self.headers[name].append(val) if self.sent_time: self.modified_since_sent = True @@ -95,7 +97,7 @@ class Envelope(object): """getter for header values. :raises: KeyError if undefined """ - return self.headers[name] + return self.headers[name][0] def __delitem__(self, name): del(self.headers[name]) |