'Translates error handlers specified in appengine-web.xml to yaml.'

def TranslateErrorHandlers(self):

    if (not self.app_engine_web_xml.static_error_handlers):
        return []
    statements = ['error_handlers:']
    for error_handler in self.app_engine_web_xml.static_error_handlers:
        path = self.ErrorHandlerPath(error_handler)
        statements.append(('-    file:    %s' % path))
        if error_handler.code:
            statements.append(('        error_code:    %s' % error_handler.code))
        mime_type = self.web_xml.GetMimeTypeForPath(error_handler.name)
        if mime_type:
            statements.append(('        mime_type:    %s' % mime_type))
    return statements
