def LoadSingleAppInfo(app_info):
 builder = yaml_object.ObjectBuilder(AppInfoExternal)
 handler = yaml_builder.BuilderHandler(builder)
 listener = yaml_listener.EventListener(handler)
 listener.Parse(app_info)
 app_infos = handler.GetResults()
 if (len(app_infos) < 1):
  raise appinfo_errors.EmptyConfigurationFile()
 if (len(app_infos) > 1):
  raise appinfo_errors.MultipleConfigurationFile()
 appyaml = app_infos[0]
 ValidateHandlers(appyaml.handlers)
 if appyaml.builtins:
  BuiltinHandler.Validate(appyaml.builtins, appyaml.runtime)
 if (appyaml.application and appyaml.project):
  raise appinfo_errors.MultipleProjectNames('Specify one of "application: name" or "project: name"')
 elif appyaml.project:
  appyaml.application = appyaml.project
  appyaml.project = None
 appyaml.NormalizeVmSettings()
 return appyaml

def LoadSingleAppInfo ( app_info ) : builder = yaml_object . ObjectBuilder ( AppInfoExternal ) handler = yaml_builder . BuilderHandler ( builder ) listener = yaml_listener . EventListener ( handler ) listener . Parse ( app_info ) app_infos = handler . GetResults ( ) if ( len ( app_infos ) < 1 ) : raise appinfo_errors . EmptyConfigurationFile ( ) if ( len ( app_infos ) > 1 ) : raise appinfo_errors . MultipleConfigurationFile ( ) appyaml = app_infos [ 0 ] ValidateHandlers ( appyaml . handlers ) if appyaml . builtins : BuiltinHandler . Validate ( appyaml . builtins , appyaml . runtime ) if ( appyaml . application and appyaml . project ) : raise appinfo_errors . MultipleProjectNames ( 'Specify one of "application: name" or "project: name"' ) elif appyaml . project : appyaml . application = appyaml . project appyaml . project = None appyaml . NormalizeVmSettings ( ) return appyaml
load a single appinfo object where one and only one is expected .