def print_app_details(app, public_key):
    """
        Print app details.
    """
    print 'App'
    if has_str_format:
        print " Name: {0:30} Type: {1:10} Owner: {2:20}".format(
            app['name'],
            app['type']['name'],
            app['owner']['username'])
        if app['type']['name'] == 'custom':
            print ' Buildpack URL: {0}\n'.format(app['buildpack_url'])
        print ' Repository: {0}'.format(app['repository'])
        print '\n Public Key: {0}'.format(public_key)

        print '\n Users'
        print "   {0:15} {1:35} {2:10} {3:10}".format('Name', 'Email', 'Role', 'Deployment')
        for user in app['users']:
            print "   {0:15} {1:35} {2:10} {3:10}".format(
                user['username'],
                user['email'],
                user['role'] if 'role' in user else '',
                user['deployment'] if 'deployment' in user else '(app)'
            )
        print '\n Deployments'
        for deployment in app['deployments']:
            print "   {0:60}".format(deployment['name'])
    else:
        print " Name: %-30ls Type: %-10ls Owner: %-20ls" % (
            app['name'],
            app['type']['name'],
            app['owner']['username'])
        print ' Repository: %s' % (app['repository'])
        print '\n Public Key: %s' % public_key
        print '\n Users'
        print "   %-15ls %-35ls %-10ls %-10ls" % ('Name', 'Email', 'Role', 'Deployment')
        for user in app['users']:
            if 'deployment' not in user:
                user['deployment'] = '(app)'
            if 'role' not in user:
                user['role'] = ''

            print "   %(username)-15ls %(email)-35ls %(role)-10ls %(deployment)-10ls" % (user)
        print '\n Deployments'
        for deployment in app['deployments']:
            print "   %(name)-60ls" % (deployment)
dataset/ETHPy150Open cloudControl/cctrl/cctrl/output.py/print_app_details/original