Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Unified Diff: scripts/master/chromium_step.py

Issue 10830251: Remove preamble link if annotated step has no extra sections. (Closed) Base URL: http://git.chromium.org/chromium/tools/build.git@master
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/master/unittests/annotator_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/chromium_step.py
diff --git a/scripts/master/chromium_step.py b/scripts/master/chromium_step.py
index 4cb34f19df59a16eb86669579590b76934970006..5cfc6285827f7a44dad2feae8dacd7dbad95b988 100644
--- a/scripts/master/chromium_step.py
+++ b/scripts/master/chromium_step.py
@@ -685,8 +685,19 @@ class AnnotatedCommand(ProcessLogShellStep):
self.script_observer = AnnotationObserver(self)
self.addLogObserver('stdio', self.script_observer)
+ def _removePreamble(self):
+ """Remove preamble if there is only section.
+
+ 'stdio' will be identical to 'preamble' if there is only one annotator
+ section, so it's redundant to show both on the waterfall.
+ """
+ if len(self.script_observer.sections) == 1:
+ self.step_status.logs = [x for x in self.step_status.logs if
+ x.name != 'preamble']
+
def interrupt(self, reason):
self.script_observer.fixupLast(builder.EXCEPTION)
+ self._removePreamble()
return ProcessLogShellStep.interrupt(self, reason)
def evaluateCommand(self, cmd):
@@ -697,6 +708,7 @@ class AnnotatedCommand(ProcessLogShellStep):
def commandComplete(self, cmd):
self.script_observer.handleReturnCode(cmd.rc)
+ self._removePreamble()
return ProcessLogShellStep.commandComplete(self, cmd)
« no previous file with comments | « no previous file | scripts/master/unittests/annotator_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698