def find_web_xml(app_name):
 app_dir = '/var/apps/{}/app'.format(app_name)
 file_name = 'appengine-web.xml'
 matches = []
 for (root, dirs, files) in os.walk(app_dir):
  if ((file_name in files) and root.endswith('/WEB-INF')):
   matches.append(os.path.join(root, file_name))
 if (len(matches) < 1):
  raise BadConfigurationException('Unable to find {} file for {}'.format(file_name, app_name))
 if (len(matches) > 1):
  matches.sort()
  match_to_use = matches[0]
  for match in matches:
   if (len(match) < len(match_to_use)):
    match_to_use = match
  return match_to_use
 return matches[0]

def find_web_xml ( app_name ) : app_dir = '/var/apps/{}/app' . format ( app_name ) file_name = 'appengine-web.xml' matches = [ ] for ( root , dirs , files ) in os . walk ( app_dir ) : if ( ( file_name in files ) and root . endswith ( '/WEB-INF' ) ) : matches . append ( os . path . join ( root , file_name ) ) if ( len ( matches ) < 1 ) : raise BadConfigurationException ( 'Unable to find {} file for {}' . format ( file_name , app_name ) ) if ( len ( matches ) > 1 ) : matches . sort ( ) match_to_use = matches [ 0 ] for match in matches : if ( len ( match ) < len ( match_to_use ) ) : match_to_use = match return match_to_use return matches [ 0 ]
returns the location of a java applications appengine-web .