import pkg_resources


def load_egg(dist, app):
    """Load a registered application of a distribution

    In:
      - ``dist`` -- name of the distribution
      - ``app`` -- name of the application

    Return:
      - (the application, the distribution of the application)
    """
    dist = pkg_resources.get_distribution(dist)
    return dist.get_entry_info('nagare.applications', app).load(), dist