jupylet/app.py
def event(self, *args):
        """Function decorator for an event handler.
        Usage::
            @app.event
            def on_resize(self, width, height):
                # ...
        or::
            @app.event('on_resize')
            def foo(self, width, height):
                # ...
        """
        if len(args) == 0:                      # @window.event()
            def decorator(func):
                name = func.__name__
                self._dispatcher.set_handler(name, func)
                return func
            return decorator
        
        elif inspect.isroutine(args[0]):        # @window.event
            func = args[0]
            name = func.__name__
            self._dispatcher.set_handler(name, func)
            return args[0]
        
        elif isinstance(args[0], str):          # @window.event('on_resize')
            name = args[0]
            def decorator(func):
                self._dispatcher.set_handler(name, func)
                return func
            return decorator
Function decorator for an event handler.
        Usage::
            @app.event
            def on_resize(self, width, height):
                # ...
        or::
            @app.event('on_resize')
            def foo(self, width, height):
                # ...
        
Function decorator for an event handler.
Function decorator for an event handler .
def event(self, *args):
        if len(args) == 0:                      
            def decorator(func):
                name = func.__name__
                self._dispatcher.set_handler(name, func)
                return func
            return decorator
        elif inspect.isroutine(args[0]):        
            func = args[0]
            name = func.__name__
            self._dispatcher.set_handler(name, func)
            return args[0]
        elif isinstance(args[0], str):          ('on_resize')
            name = args[0]
            def decorator(func):
                self._dispatcher.set_handler(name, func)
                return func
            return decorator
def event ( self , * args ) : if len ( args ) == 0 : def decorator ( func ) : name = func . __name__ self . _dispatcher . set_handler ( name , func ) return func return decorator elif inspect . isroutine ( args [ 0 ] ) : func = args [ 0 ] name = func . __name__ self . _dispatcher . set_handler ( name , func ) return args [ 0 ] elif isinstance ( args [ 0 ] , str ) : name = args [ 0 ] def decorator ( func ) : self . _dispatcher . set_handler ( name , func ) return func return decorator
Function decorator for an event handler.
Function decorator for an event handler .
"""Function decorator for an event handler.
        Usage::
            @app.event
            def on_resize(self, width, height):
                # ...
        or::
            @app.event('on_resize')
            def foo(self, width, height):
                # ...
        """ # @window.event() # @window.event # @window.event('on_resize')
self