~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/server/model.py

  • Committer: William Grant
  • Date: 2012-01-22 08:36:57 UTC
  • Revision ID: william.grant@canonical.com-20120122083657-g3tihynuczfkphat
message content isn't always included.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        """Get a date and dict of an RFC822 message."""
71
71
        parsed = email.parser.Parser().parsestr(message)
72
72
        message_dict = {}
73
 
        message_dict['content'] = message
74
73
 
75
74
        for key in ('from', 'to', 'subject', 'message-id'):
76
75
            value = parsed.get(key, None)
93
92
    def add_message(self, archive_uuid, message):
94
93
        message_uuid = uuid.uuid4()
95
94
        message_date, message_dict = self._parse_message(message)
 
95
        message_dict['content'] = message
96
96
        message_dict['date_created'] = (
97
97
            datetime.datetime.utcnow().isoformat() + 'Z')
98
98
        self.messages.insert(message_uuid, message_dict)