comparison sat_frontends/quick_frontend/quick_app.py @ 3166:122075ceaa53

quick frontend (app): replaced OrderedDict by regular dict: since Python 3.7 dict are officially ordered, so there is no need to use a specific class anymore.
author Goffi <goffi@goffi.org>
date Wed, 12 Feb 2020 19:40:48 +0100
parents 9dc170635bee
children d0fb79f97466
comparison
equal deleted inserted replaced
3165:7699a08ba8fb 3166:122075ceaa53
29 from sat_frontends.quick_frontend import quick_chat, quick_games 29 from sat_frontends.quick_frontend import quick_chat, quick_games
30 from sat_frontends.quick_frontend import quick_contact_list 30 from sat_frontends.quick_frontend import quick_contact_list
31 from sat_frontends.quick_frontend.constants import Const as C 31 from sat_frontends.quick_frontend.constants import Const as C
32 32
33 import sys 33 import sys
34 from collections import OrderedDict
35 import time 34 import time
36 35
37 36
38 log = getLogger(__name__) 37 log = getLogger(__name__)
39 38
318 if connect_bridge: 317 if connect_bridge:
319 self.connectBridge() 318 self.connectBridge()
320 319
321 # frontend notifications 320 # frontend notifications
322 self._notif_id = 0 321 self._notif_id = 0
323 self._notifications = OrderedDict() 322 self._notifications = {}
324 # watched progresses and associated callbacks 323 # watched progresses and associated callbacks
325 self._progress_ids = {} 324 self._progress_ids = {}
326 # available features 325 # available features
327 # FIXME: features are profile specific, to be checked 326 # FIXME: features are profile specific, to be checked
328 self.features = None 327 self.features = None
578 @param callback: method to call on event 577 @param callback: method to call on event
579 @param profiles_filter (set[unicode]): if set and not empty, the 578 @param profiles_filter (set[unicode]): if set and not empty, the
580 listener will be callable only by one of the given profiles. 579 listener will be callable only by one of the given profiles.
581 """ 580 """
582 assert type_ in C.LISTENERS 581 assert type_ in C.LISTENERS
583 self._listeners.setdefault(type_, OrderedDict())[callback] = profiles_filter 582 self._listeners.setdefault(type_, {})[callback] = profiles_filter
584 583
585 def removeListener(self, type_, callback): 584 def removeListener(self, type_, callback):
586 """Remove a callback from listeners 585 """Remove a callback from listeners
587 586
588 @param type_: same as for [addListener] 587 @param type_: same as for [addListener]