diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2007-09-22 15:53:18 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2007-09-22 15:53:18 +0400 |
commit | da903ff511187002bd410a3ecf22a3f823506307 (patch) | |
tree | 6fb27121bbfc4c33bebfaf9d47e16b74f72058cb | |
parent | 98a85d625f703522db21ce22121dffbc2572baac (diff) |
fix type of returns variable in get_events: it's a dict if jid is not given
-rw-r--r-- | src/common/events.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/events.py b/src/common/events.py index 77ee70c92..ead250b19 100644 --- a/src/common/events.py +++ b/src/common/events.py @@ -131,12 +131,14 @@ class Events: return self._get_nb_events(types = types, account = account) def get_events(self, account, jid = None, types = []): - '''if event is not specified, get all events from this jid, + '''returns all events from the given account of the form + {jid1: [], jid2: []} + if jid is given, returns all events from the given jid in a list: [] optionnaly only from given type''' if not self._events.has_key(account): return [] - events_list = [] # list of events if not jid: + events_list = {} # list of events for jid_ in self._events[account]: events = [] for ev in self._events[account][jid_]: @@ -147,6 +149,7 @@ class Events: return events_list if not self._events[account].has_key(jid): return [] + events_list = [] # list of events for ev in self._events[account][jid]: if not types or ev.type_ in types: events_list.append(ev) |