Make the roster easier to inspect.

The __repr__ version now looks like a regular dictionary.
This commit is contained in:
Lance Stout 2012-01-10 20:03:22 -08:00
parent a86935a42f
commit 1eb69f7075
3 changed files with 9 additions and 0 deletions

View file

@ -482,3 +482,6 @@ class RosterItem(object):
a roster reset request. a roster reset request.
""" """
self.resources = {} self.resources = {}
def __repr__(self):
return repr(self._state)

View file

@ -182,3 +182,6 @@ class Roster(object):
self._auto_subscribe = value self._auto_subscribe = value
for node in self._rosters: for node in self._rosters:
self._rosters[node].auto_subscribe = value self._rosters[node].auto_subscribe = value
def __repr__(self):
return repr(self._rosters)

View file

@ -285,3 +285,6 @@ class RosterNode(object):
if not self.xmpp.sentpresence: if not self.xmpp.sentpresence:
self.xmpp.event('sent_presence') self.xmpp.event('sent_presence')
self.xmpp.sentpresence = True self.xmpp.sentpresence = True
def __repr__(self):
return repr(self._jids)