home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- from datetime import datetime
- from util.primitives import Storage, curly
-
- class Message(Storage):
-
- def __init__(self, buddy = None, message = None, conversation = None, type = 'incoming', timestamp = None, **other):
- self.buddy = buddy
- self.message = message
- self.type = type
- self.conversation = conversation
- self.timestamp = None if timestamp is not None else datetime.utcnow()
- self.update(other)
-
-
- def copy(self):
- m = Message()
- m.update(self)
- return m
-
-
- def __hash__(self):
- return hash(self._attrs)
-
-
- def __eq__(self, other):
- if not self is other:
- pass
- return self._attrs == getattr(other, '_attrs', None)
-
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
-
- def _attrs(self):
- logger = logger
- import common
- datetime = logger.message_timestamp_id(self.timestamp)
- return hash((self.message, self.type, datetime))
-
- _attrs = property(_attrs)
-
-
- class StatusUpdateMessage(Message):
-
- def __init__(self, **info):
- buddy = info['buddy']
- message = curly(info['header'], source = info)
- Message.__init__(self, buddy = buddy, message = message, type = 'status')
-
-
-