Decorator to require that this component be installed

def require_self(func, *args, **kwargs):
    """Decorator to require that this component be installed"""

    try:
        __import__(package['name'])
    except ImportError:
        sys.stderr.write(
            "This component needs to be installed first. Run " +
            "`invoke install`\n")
        sys.exit(1)
    return func(*args, **kwargs)