Browse to a package's PyPI or project homepage.

def browse(package, homepage):
    """Browse to a package's PyPI or project homepage."""
    p = Package(package)
    try:
        if homepage:
            secho(u'Opening homepage for "{0}"...'.format(package), bold=True)
            url = p.home_page
        else:
            secho(u'Opening PyPI page for "{0}"...'.format(package), bold=True)
            url = p.package_url
    except NotFoundError:
        abort_not_found(package)
    click.launch(url)