Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Message can be accessed by getitem
Browse files Browse the repository at this point in the history
  • Loading branch information
DavoudTaghawiNejad committed Sep 11, 2017
1 parent f1d1c7b commit ca17c77
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions abce/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def __init__(self, sender, receiver, topic, content):
self.topic = topic
self.content = content

def __getitem__(self, item):
return self.content[item]

def __repr__(self):
return "<{sender: %s; receiver: %s; topic: %s; content: %s}>" % (
str(self.sender), str(self.receiver), self.topic, str(self.content))
Expand Down

0 comments on commit ca17c77

Please sign in to comment.