From ffa2e9a0a763f8a284925edf52022e966c57fce3 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 14 Oct 2010 23:47:55 +0200 Subject: ext.signal_dispatcher: optimization of signal_emit --- ranger/ext/signal_dispatcher.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ranger/ext/signal_dispatcher.py b/ranger/ext/signal_dispatcher.py index c1630c0c..3f407bff 100644 --- a/ranger/ext/signal_dispatcher.py +++ b/ranger/ext/signal_dispatcher.py @@ -76,12 +76,11 @@ class SignalDispatcher(object): def signal_emit(self, signal_name, **kw): assert isinstance(signal_name, str) - try: - handlers = self._signals[signal_name] - except: - return + if signal_name not in self._signals: + return True + handlers = self._signals[signal_name] if not handlers: - return + return True signal = Signal(origin=self, name=signal_name, **kw) @@ -98,6 +97,7 @@ class SignalDispatcher(object): else: fnc() if signal.stopped: - return + return False except ReferenceError: handlers.remove(handler) + return True -- cgit 1.4.1-2-gfad0 '/akspecs/ranger/?h=v1.5.2'>summary refs log blame commit diff stats
path: root/Makefile
blob: f7950392cce467d1d75e5b17b794b4bf540199dd (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15