Browse Source

Code style fixes

pull/43/merge^2
Robert Schindler 9 years ago
parent
commit
7c398c6b24
  1. 4
      socketio/namespace.py
  2. 2
      socketio/util.py

4
socketio/namespace.py

@ -75,8 +75,8 @@ class Namespace(object):
if _event_name == event_name:
extra_middlewares = getattr(attr, '_sio_middlewares', [])
return util._apply_middlewares(
self.middlewares + extra_middlewares, event_name,
self.name, attr)
self.middlewares + extra_middlewares, event_name,
self.name, attr)
@staticmethod
def event_name(name):

2
socketio/util.py

@ -5,6 +5,7 @@ def _copy_sio_properties(from_func, to_func):
if key.startswith('_sio'):
setattr(to_func, key, getattr(from_func, key))
def _apply_middlewares(middlewares, event, namespace, handler):
"""Wraps the given handler with a wrapper that executes middlewares
before and after the real event handler."""
@ -43,6 +44,7 @@ def _apply_middlewares(middlewares, event, namespace, handler):
return wrapped
def apply_middleware(middleware):
"""Returns a decorator for event handlers that adds the given
middleware to the handler decorated with it.

Loading…
Cancel
Save