We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e4c71a commit ff483ebCopy full SHA for ff483eb
1 file changed
test/test_blinker.py
@@ -0,0 +1,37 @@
1
+#!/usr/bin/env python
2
+# encoding: utf-8
3
+
4
+"""
5
+@author: zhanghe
6
+@software: PyCharm
7
+@file: test_blinker.py
8
+@time: 2017/6/6 下午10:48
9
10
11
12
+from blinker import signal
13
14
+started = signal('round-started')
15
16
17
+def each(round):
18
+ print "Round %s!" % round
19
20
21
+started.connect(each)
22
23
24
+def round_two(round):
25
+ print "This is round two."
26
27
28
+started.connect(round_two, sender=2)
29
30
31
+for r in range(1, 4):
32
+ started.send(r)
33
34
35
+# https://pypi.python.org/pypi/blinker
36
+# http://pythonhosted.org/blinker/
37
+# https://github.com/jek/blinker
0 commit comments