michael@0: # Copyright (c) 2012 The Chromium Authors. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: """Helper functions to print buildbot messages.""" michael@0: michael@0: def PrintLink(label, url): michael@0: """Adds a link with name |label| linking to |url| to current buildbot step. michael@0: michael@0: Args: michael@0: label: A string with the name of the label. michael@0: url: A string of the URL. michael@0: """ michael@0: print '@@@STEP_LINK@%s@%s@@@' % (label, url) michael@0: michael@0: michael@0: def PrintMsg(msg): michael@0: """Appends |msg| to the current buildbot step text. michael@0: michael@0: Args: michael@0: msg: String to be appended. michael@0: """ michael@0: print '@@@STEP_TEXT@%s@@@' % msg michael@0: michael@0: michael@0: def PrintSummaryText(msg): michael@0: """Appends |msg| to main build summary. Visible from waterfall. michael@0: michael@0: Args: michael@0: msg: String to be appended. michael@0: """ michael@0: print '@@@STEP_SUMMARY_TEXT@%s@@@' % msg michael@0: michael@0: michael@0: def PrintError(): michael@0: """Marks the current step as failed.""" michael@0: print '@@@STEP_FAILURE@@@' michael@0: michael@0: michael@0: def PrintWarning(): michael@0: """Marks the current step with a warning.""" michael@0: print '@@@STEP_WARNINGS@@@' michael@0: michael@0: michael@0: def PrintNamedStep(step): michael@0: print '@@@BUILD_STEP %s@@@' % step