(func)
return wrapper
Raise an exception if the device is not connected before calling the
    actual function.
Raise an exception if the device is not connected before calling the
    actual function.
Raise an exception if the device is not connected before calling the actual function .
def connection_required(func):
    """Raise an exception if the device is not connected before calling the
    actual function.
    """
    @functools.wraps(func)
    def wrapper(self, *args, **kwargs):
        if self._handle is None:
            raise exceptions.NotConnectedError()
        return func(self, *args, **kwargs)
    return wrapper
def connection_required ( func ) : @ functools . wraps ( func ) def wrapper ( self , * args , * * kwargs ) : if self . _handle is None : raise exceptions . NotConnectedError ( ) return func ( self , * args , * * kwargs ) return wrapper