# Path: shelf/hook/event.py
# class Event(object):
#     ARTIFACT_UPLOADED = "ARTIFACT_UPLOADED"
#     METADATA_UPDATED = "METADATA_UPDATED"
# 
# Path: shelf/hook/background/action.py
# def execute_command(command, log_level, event, uri, meta_uri, cwd="."):
# def create_container(log_level):
# def create_background_logger(level):


from shelf.hook.event import Event
from shelf.hook.background import action
    def __init__(self, container, multiprocessing, host, command):
        """
            Args:
                container(shelf.hook.container)
                multiprocessing(multiprocessing)
                host(string) The protocol + hostname which hosts shelf.
                command(string) Command to run for each event.
        """
        self.container = container
        self.multiprocessing = multiprocessing
        self.host = host
        self.command = command

    def notify_artifact_uploaded(self, identity):
        """
            Fires an event that describes an artifact being uploaded.

            Args:
                identity(shelf.resource_identity)
        """
        self._notify(identity, Event.ARTIFACT_UPLOADED)

    def notify_metadata_updated(self, identity):
        """
            Fires an event that describes an artifact's metadata being updated.
            This will notify any hooks that are listening.

            Args:
                identity(shelf.resource_identity)
        """

# Path: shelf/hook/event.py
# class Event(object):
#     ARTIFACT_UPLOADED = "ARTIFACT_UPLOADED"
#     METADATA_UPDATED = "METADATA_UPDATED"
# 
# Path: shelf/hook/background/action.py
# def execute_command(command, log_level, event, uri, meta_uri, cwd="."):
# def create_container(log_level):
# def create_background_logger(level):


# Path: shelf/hook/manager.py
from shelf.hook.event import Event
from shelf.hook.background import action

    def __init__(self, container, multiprocessing, host, command):
        """
            Args:
                container(shelf.hook.container)
                multiprocessing(multiprocessing)
                host(string) The protocol + hostname which hosts shelf.
                command(string) Command to run for each event.
        """
        self.container = container
        self.multiprocessing = multiprocessing
        self.host = host
        self.command = command

    def notify_artifact_uploaded(self, identity):
        """
            Fires an event that describes an artifact being uploaded.

            Args:
                identity(shelf.resource_identity)
        """
        self._notify(identity, Event.ARTIFACT_UPLOADED)

    def notify_metadata_updated(self, identity):
        """
            Fires an event that describes an artifact's metadata being updated.
            This will notify any hooks that are listening.

            Args:
                identity(shelf.resource_identity)
        """

        self._notify(identity, Event.METADATA_UPDATED)