-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (81 loc) · 3.26 KB
/
index.html
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
layout: default
---
<style>
.btn-outline-inverse {
color: #fff;
background-color: transparent;
border-color: #E95420;
}
</style>
<div class="header-container jumbotron">
<div class="container">
<h1>Whistle</h1>
<h2>Event Dispatcher for Python</h2>
<p>Whistle is a simple tool that allow your application components to communicate with each other by dispatching
events and listening to them.</p>
<p class="text-center">
<a class="btn btn-primary btn-lg" href="https://pypi.org/project/whistle/" target="_blank"
role="button">Install</a>
<a class="btn btn-primary btn-outline-inverse btn-lg" href="#documentation"
role="button">Documentation</a>
</p>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-10">
<h2 class="header-light regular-pad">What is Whistle?</h2>
<blockquote>
<p>
Whistle is an Event Dispatcher library for the Python 3.5+ language.
</p>
<p>
It's largely inspired from Symfony's EventDispatcher component.
</p>
<p>
Using an event dispatcher is a great way to write loosely coupled extensible code, having each part
only communicate using light events.
</p>
</blockquote>
</div>
<div class="col-md-2 text-center">
<br>
<div class="clearfix">
<div class="pull-left" style="margin-right:0.5em">
<a class="github-button" href="https://github.com/python-whistle/whistle/fork"
data-icon="octicon-repo-forked" data-size="large" aria-label="Fork Whistle on GitHub"></a>
</div>
<div class="pull-left">
<a class="github-button" href="https://github.com/python-whistle/whistle" data-icon="octicon-star"
data-size="large" data-show-count="true" aria-label="Star Whistle on GitHub">Star</a>
</div>
</div>
<img src="img/whistle-logo.png" alt="Whistle, python's event dispatcher."
class="img-responsive">
<a name="documentation"></a>
</div>
</div>
<hr>
<div class="row">
<h2>Quick start</h2>
<p>Install the <code>whistle</code> package:</p>
<pre><code> $ pip install whistle</code></pre>
<h3>Create an event dispatcher</h3>
<pre><code class="python">from whistle import EventDispatcher
dispatcher = EventDispatcher()</code></pre>
<h3>Add a listener to react to events</h3>
<pre><code class="python">def on_spectacle_starts(event):
print('Please turn down your phones!')
dispatcher.add_listener('spectacle.starts', on_spectacle_starts)</code></pre>
<h3>Dispatch it!</h3>
<pre><code class="python">dispatcher.dispatch('spectacle.starts')</code></pre>
</div>
<hr>
<div class="row">
<h2>License</h2>
<p>
Whistle and the surrounding material (like this website) is licensed under the Apache License, version 2.0.
</p>
</div>
</div>