Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Subclasses of various slave command classes.""" | 5 """Subclasses of various slave command classes.""" |
| 6 | 6 |
| 7 from datetime import datetime | 7 from datetime import datetime |
| 8 import copy | 8 import copy |
| 9 import errno | 9 import errno |
| 10 import json | 10 import json |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1051 | 1051 |
| 1052 def finalizeLogLines(self, section, log_label): | 1052 def finalizeLogLines(self, section, log_label): |
| 1053 section['finished_logs'].append(log_label) | 1053 section['finished_logs'].append(log_label) |
| 1054 logs = section['annotated_logs'].pop(log_label, ()) | 1054 logs = section['annotated_logs'].pop(log_label, ()) |
| 1055 addLogToStep(section['step'], log_label, '\n'.join(logs)) | 1055 addLogToStep(section['step'], log_label, '\n'.join(logs)) |
| 1056 | 1056 |
| 1057 def SET_BUILD_PROPERTY(self, name, value): | 1057 def SET_BUILD_PROPERTY(self, name, value): |
| 1058 # Support: @@@SET_BUILD_PROPERTY@<name>@<json>@@@ | 1058 # Support: @@@SET_BUILD_PROPERTY@<name>@<json>@@@ |
| 1059 # Sets the property and indicates that it came from an annoation on the | 1059 # Sets the property and indicates that it came from an annoation on the |
| 1060 # current step. | 1060 # current step. |
| 1061 self.command.build.setProperty(name, json.loads(value), 'Annotation(%s)' | 1061 try: |
| 1062 % self.cursor['name']) | 1062 self.command.build.setProperty(name, json.loads(value), 'Annotation(%s)' |
| 1063 % self.cursor['name']) | |
| 1064 except Exception as e: | |
| 1065 raise Exception(repr([ | |
|
estaab
2016/04/08 05:22:46
What's the format of the regular exception? If you
dnj
2016/04/11 18:17:15
Why is this here in the first place? Is this debug
Paweł Hajdan Jr.
2016/04/11 20:44:39
"As you see, it has some local hacks I've used for
| |
| 1066 str(e), | |
| 1067 str(name), | |
| 1068 str(value), | |
| 1069 ])) | |
| 1063 | 1070 |
| 1064 def STEP_LOG_LINE(self, log_label, log_line): | 1071 def STEP_LOG_LINE(self, log_label, log_line): |
| 1065 # Support: @@@STEP_LOG_LINE@<label>@<line>@@@ (add log to step) | 1072 # Support: @@@STEP_LOG_LINE@<label>@<line>@@@ (add log to step) |
| 1066 # Appends a line to the log's array. When STEP_LOG_END is called, | 1073 # Appends a line to the log's array. When STEP_LOG_END is called, |
| 1067 # that will finalize the log and call addCompleteLog(). | 1074 # that will finalize the log and call addCompleteLog(). |
| 1068 self.addLogLines(log_label, (log_line,)) | 1075 self.addLogLines(log_label, (log_line,)) |
| 1069 | 1076 |
| 1070 def STEP_LOG_END(self, log_label): | 1077 def STEP_LOG_END(self, log_label): |
| 1071 # Support: @@@STEP_LOG_END@<label>@@@ (finalizes log to step) | 1078 # Support: @@@STEP_LOG_END@<label>@@@ (finalizes log to step) |
| 1072 if (len(self.cursor['finished_logs'])+1) >= self._STEP_MAX_LOGS: | 1079 if (len(self.cursor['finished_logs'])+1) >= self._STEP_MAX_LOGS: |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1543 and starts to wait for remaining steps to finish. Returns command_result | 1550 and starts to wait for remaining steps to finish. Returns command_result |
| 1544 as Deferred.""" | 1551 as Deferred.""" |
| 1545 self.scriptComplete(command_result) | 1552 self.scriptComplete(command_result) |
| 1546 steps_d = self.script_observer.waitForSteps() | 1553 steps_d = self.script_observer.waitForSteps() |
| 1547 # Ignore the waitForSteps' result and return the original result, | 1554 # Ignore the waitForSteps' result and return the original result, |
| 1548 # so the caller of runCommand receives command_result. | 1555 # so the caller of runCommand receives command_result. |
| 1549 steps_d.addCallback(lambda *_: command_result) | 1556 steps_d.addCallback(lambda *_: command_result) |
| 1550 return steps_d | 1557 return steps_d |
| 1551 d.addCallback(onCommandFinished) | 1558 d.addCallback(onCommandFinished) |
| 1552 return d | 1559 return d |
| OLD | NEW |