def LoadPagespeedEntry(pagespeed_entry, open_fn=None):
 builder = yaml_object.ObjectBuilder(PagespeedEntry)
 handler = yaml_builder.BuilderHandler(builder)
 listener = yaml_listener.EventListener(handler)
 listener.Parse(pagespeed_entry)
 parsed_yaml = handler.GetResults()
 if (not parsed_yaml):
  return PagespeedEntry()
 if (len(parsed_yaml) > 1):
  raise MalformedPagespeedConfiguration('Multiple configuration sections in the yaml')
 return parsed_yaml[0]

def LoadPagespeedEntry ( pagespeed_entry , open_fn = None ) : builder = yaml_object . ObjectBuilder ( PagespeedEntry ) handler = yaml_builder . BuilderHandler ( builder ) listener = yaml_listener . EventListener ( handler ) listener . Parse ( pagespeed_entry ) parsed_yaml = handler . GetResults ( ) if ( not parsed_yaml ) : return PagespeedEntry ( ) if ( len ( parsed_yaml ) > 1 ) : raise MalformedPagespeedConfiguration ( 'Multiple configuration sections in the yaml' ) return parsed_yaml [ 0 ]
load a yaml file or string and return a pagespeedentry .