--- libgmail.py.orig 2004-11-10 23:53:01 +0200 +++ libgmail.py 2004-11-10 23:55:19 +0200 @@ -818,6 +818,7 @@ # Extract number of messages in thread/conversation. self._authors = threadInfo[T_AUTHORS_HTML] + self.info = threadInfo try: # TODO: Find out if this information can be found another way... @@ -846,6 +847,25 @@ return iter(self._messages) + def __getattr__(self, name): + """ + Dynamically dispatch some interesting thread properties. + """ + attrs = { 'unread': T_UNREAD, + 'star': T_STAR, + 'date': T_DATE_HTML, + 'authors': T_AUTHORS_HTML, + 'flags': T_FLAGS, + 'subject': T_SUBJECT_HTML, + 'snippet': T_SNIPPET_HTML, + 'categories': T_CATEGORIES, + 'attach': T_ATTACH_HTML, + 'matching_msgid': T_MATCHING_MSGID, + 'extra_snippet': T_EXTRA_SNIPPET } + if name in attrs: + return self.info[ attrs[name] ]; + + raise AttributeError("no attribute %s" % name) def _getMessages(self, thread): """