(func)
return wrapper
Decorator that raises :class:`EvdevError` if there is no write access to the
        input device.
Decorator that raises :class:`EvdevError` if there is no write access to the
        input device.
Decorator that raises : class : EvdevError if there is no write access to the input device .
def need_write(func):
        '''
        Decorator that raises :class:`EvdevError` if there is no write access to the
        input device.
        '''
        @functools.wraps(func)
        def wrapper(*args):
            fd = args[0].fd
            if fcntl.fcntl(fd, fcntl.F_GETFL) & os.O_RDWR:
                return func(*args)
            msg = 'no write access to device "%s"' % args[0].path
            raise EvdevError(msg)
        return wrapper
def need_write ( func ) : @ functools . wraps ( func ) def wrapper ( * args ) : fd = args [ 0 ] . fd if fcntl . fcntl ( fd , fcntl . F_GETFL ) & os . O_RDWR : return func ( * args ) msg = 'no write access to device "%s"' % args [ 0 ] . path raise EvdevError ( msg ) return wrapper