Skip to content

Commit 037dd4e

Browse files
committed
Return Handler object on map
1 parent 5b3edf0 commit 037dd4e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pythonosc/dispatcher.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ def map(self, address, handler, *args, needs_reply_address=False):
4848
handlers after the osc messages arguments if any.
4949
- needs_reply_address: True if the handler function needs the
5050
originating client address passed (as the first argument).
51+
Returns:
52+
- Handler object
5153
"""
5254
# TODO: Check the spec:
5355
# http://opensoundcontrol.org/spec-1_0
5456
# regarding multiple mappings
55-
self._map[address].append(Handler(handler, list(args), needs_reply_address))
57+
handlerobj = Handler(handler, list(args), needs_reply_address)
58+
self._map[address].append(handlerobj)
59+
return handlerobj
5660

5761
def unmap(self, address, handler, *args, needs_reply_address=False):
5862
"""Remove an already mapped handler from an address

0 commit comments

Comments
 (0)