PIL module checking decorator.

def check_pil(func):
    """ PIL module checking decorator.
    """
    def __wrapper(*args, **kwargs):
        root = kwargs.get('root')
        if not Image:
            if root and root.get_opt('warn'):
                warn("Images manipulation require PIL")
            return 'none'
        return func(*args, **kwargs)
    return __wrapper