happy/cli.py
def _infer_tarball_url():
    """Returns the tarball URL inferred from an app.json, if present."""
    try:
        with click.open_file('app.json', 'r') as f:
            contents = f.read()

        app_json = json.loads(contents)
    except IOError:
        return None

    repository = app_json.get('repository')

    if not repository:
        return None
    else:
        return app_json.get('repository') + '/tarball/master/'
def _infer_tarball_url():
    """Returns the tarball URL inferred from an app.json, if present."""
    try:
        with click.open_file('app.json', 'r') as f:
            contents = f.read()

        app_json = json.loads(contents)
    except IOError:
        return None

    repository = app_json.get('repository')

    if not repository:
        return None
    else:
        return app_json.get('repository') + '/tarball/master/'
Returns the tarball URL inferred from an app.json, if present.