Skip to content

Commit 9a7677a

Browse files
committed
Code formatting.
1 parent 7b3502e commit 9a7677a

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

python-ecosys/pymitter/examples.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# create an EventEmitter instance
1212
from pymitter import EventEmitter
13+
1314
ee = EventEmitter(wildcard=True, new_listener=True, max_listeners=-1)
1415

1516

python-ecosys/pymitter/pymitter.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class EventEmitter(object):
3232
CB_KEY = "__callbacks"
3333
WC_CHAR = "*"
3434

35-
def __init__(self, wildcard=False, new_listener=False, max_listeners=-1, delimiter="."):
35+
def __init__(
36+
self, wildcard=False, new_listener=False, max_listeners=-1, delimiter="."
37+
):
3638
super(EventEmitter, self).__init__()
3739

3840
self.wildcard = wildcard
@@ -85,6 +87,7 @@ def on(self, event, func=None, ttl=-1):
8587
Registers a function to an event. *ttl* defines the times to listen. Negative values mean
8688
infinity. When *func* is *None*, decorator usage is assumed. Returns the function.
8789
"""
90+
8891
def on(func):
8992
if not callable(func):
9093
return func
@@ -124,6 +127,7 @@ def on_any(self, func=None, ttl=-1):
124127
to listen. Negative values mean infinity. When *func* is *None*, decorator usage is assumed.
125128
Returns the function.
126129
"""
130+
127131
def on_any(func):
128132
if not callable(func):
129133
return func
@@ -147,6 +151,7 @@ def off(self, event, func=None):
147151
Removes a function that is registered to an event. When *func* is *None*, decorator usage is
148152
assumed. Returns the function.
149153
"""
154+
150155
def off(func):
151156
branch = self._find_branch(event)
152157
if branch is None:
@@ -163,6 +168,7 @@ def off_any(self, func=None):
163168
Removes a function that was registered via :py:meth:`on_any`. When *func* is *None*,
164169
decorator usage is assumed. Returns the function.
165170
"""
171+
166172
def off_any(func):
167173
self._remove_listener(self._tree, func)
168174

python-ecosys/pymitter/setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
this_dir = os.path.dirname(os.path.abspath(__file__))
1111

1212
keywords = [
13-
"event", "emitter", "eventemitter", "wildcard", "node", "nodejs",
13+
"event",
14+
"emitter",
15+
"eventemitter",
16+
"wildcard",
17+
"node",
18+
"nodejs",
1419
]
1520

1621
classifiers = [

python-ecosys/pymitter/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def handler(func, event=None):
104104

105105
def newhandler():
106106
pass
107+
107108
self.ee4.on("4_new", newhandler)
108109

109110
self.assertTrue(stack[-1] == (newhandler, "4_new"))

0 commit comments

Comments
 (0)