diff --git a/sat_frontends/quick_frontend/quick_app.py b/sat_frontends/quick_frontend/quick_app.py index fcbfe402..c8bce06c 100644 --- a/sat_frontends/quick_frontend/quick_app.py +++ b/sat_frontends/quick_frontend/quick_app.py @@ -581,18 +581,22 @@ class QuickApp(object): assert type_ in C.LISTENERS self._listeners.setdefault(type_, {})[callback] = profiles_filter - def removeListener(self, type_, callback): + def removeListener(self, type_, callback, ignore_missing=False): """Remove a callback from listeners - @param type_: same as for [addListener] - @param callback: callback to remove + @param type_(str): same as for [addListener] + @param callback(callable): callback to remove + @param ignore_missing(bool): if True, don't log error if the listener doesn't + exist """ assert type_ in C.LISTENERS try: self._listeners[type_].pop(callback) except KeyError: - log.error( - f"Trying to remove an inexisting listener (type = {type_}): {callback}") + if not ignore_missing: + log.error( + f"Trying to remove an inexisting listener (type = {type_}): " + f"{callback}") def callListeners(self, type_, *args, **kwargs): """Call the methods which listen type_ event. If a profiles filter has