~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:35:26 UTC
  • Revision ID: william.grant@canonical.com-20120122083526-bgfpczfxhoa42ztp
date_created is no longer part of the original message dict.

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['date_created'] = (
74
 
            datetime.datetime.utcnow().isoformat() + 'Z')
75
73
        message_dict['content'] = message
76
74
 
77
75
        for key in ('from', 'to', 'subject', 'message-id'):
95
93
    def add_message(self, archive_uuid, message):
96
94
        message_uuid = uuid.uuid4()
97
95
        message_date, message_dict = self._parse_message(message)
 
96
        message_dict['date_created'] = (
 
97
            datetime.datetime.utcnow().isoformat() + 'Z')
98
98
        self.messages.insert(message_uuid, message_dict)
99
99
        self.archive_messages.insert(
100
100
            archive_uuid,