summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-10-14 23:47:55 +0200
committerhut <hut@lavabit.com>2010-10-14 23:47:55 +0200
commit1dd8d9f4b83f8b0cd38124a09fcb957ad4df6ad9 (patch)
tree1df5f960b3160423373656e1d775549758242ba2
parent02fd8621d2252f49920d0365b317db4c90c97c81 (diff)
downloadranger-1dd8d9f4b83f8b0cd38124a09fcb957ad4df6ad9.tar.gz
ext.signal_dispatcher: optimization of signal_emit
-rw-r--r--ranger/ext/signal_dispatcher.py12
1 files 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
1.4.2&id=3dbefa71785bf61b8f28d4a780064f3f4e04dcb5'>3dbefa71 ^
22bb7e35 ^
3dbefa71 ^
a02baa33 ^
22bb7e35 ^
3dbefa71 ^


22bb7e35 ^
3dbefa71 ^
22bb7e35 ^
3dbefa71 ^
22bb7e35 ^


3dbefa71 ^
a02baa33 ^
22bb7e35 ^




a02baa33 ^
22bb7e35 ^
0a8001b2 ^

a02baa33 ^
0a8001b2 ^


a02baa33 ^
0a8001b2 ^



a02baa33 ^
0a8001b2 ^




a02baa33 ^
0a8001b2 ^
22bb7e35 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82