Changeset 8848 for branches/gajim_0.11.1

Show
Ignore:
Timestamp:
09/22/07 13:53:18 (14 months ago)
Author:
asterix
Message:

fix type of returns variable in get_events: it's a dict if jid is not given

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/events.py

    r8843 r8848  
    132132 
    133133        def get_events(self, account, jid = None, types = []): 
    134                 '''if event is not specified, get all events from this jid, 
     134                '''returns all events from the given account of the form 
     135                {jid1: [], jid2: []} 
     136                if jid is given, returns all events from the given jid in a list: [] 
    135137                optionnaly only from given type''' 
    136138                if not self._events.has_key(account): 
    137139                        return [] 
    138                 events_list = [] # list of events 
    139140                if not jid: 
     141                        events_list = {} # list of events 
    140142                        for jid_ in self._events[account]: 
    141143                                events = [] 
     
    148150                if not self._events[account].has_key(jid): 
    149151                        return [] 
     152                events_list = [] # list of events 
    150153                for ev in self._events[account][jid]: 
    151154                        if not types or ev.type_ in types: