From 1eb69f7075da2b26652c3193494d33b913ef91b1 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 10 Jan 2012 20:03:22 -0800 Subject: [PATCH] Make the roster easier to inspect. The __repr__ version now looks like a regular dictionary. --- sleekxmpp/roster/item.py | 3 +++ sleekxmpp/roster/multi.py | 3 +++ sleekxmpp/roster/single.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/sleekxmpp/roster/item.py b/sleekxmpp/roster/item.py index 6f956b31..bd7bbbde 100644 --- a/sleekxmpp/roster/item.py +++ b/sleekxmpp/roster/item.py @@ -482,3 +482,6 @@ class RosterItem(object): a roster reset request. """ self.resources = {} + + def __repr__(self): + return repr(self._state) diff --git a/sleekxmpp/roster/multi.py b/sleekxmpp/roster/multi.py index ee56f2a8..36c7e2ad 100644 --- a/sleekxmpp/roster/multi.py +++ b/sleekxmpp/roster/multi.py @@ -182,3 +182,6 @@ class Roster(object): self._auto_subscribe = value for node in self._rosters: self._rosters[node].auto_subscribe = value + + def __repr__(self): + return repr(self._rosters) diff --git a/sleekxmpp/roster/single.py b/sleekxmpp/roster/single.py index c2c7497d..903333a3 100644 --- a/sleekxmpp/roster/single.py +++ b/sleekxmpp/roster/single.py @@ -285,3 +285,6 @@ class RosterNode(object): if not self.xmpp.sentpresence: self.xmpp.event('sent_presence') self.xmpp.sentpresence = True + + def __repr__(self): + return repr(self._jids)