Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import contextlib | |
| 6 | |
| 7 from pylib.base import output_manager | |
| 8 | |
| 9 # TODO(mikecase): This class is currently mostly unused. | |
|
jbudorick
2017/08/23 16:16:20
haha, maybe TODO someone else. (me?)
mikecase (-- gone --)
2017/08/24 05:29:08
done
| |
| 10 # Add a --bot-mode argument that all bots pass. If --bot-mode and | |
| 11 # --local-ouput args are both not passed to test runner then use this | |
|
jbudorick
2017/08/23 16:16:20
super nit: --local-output
mikecase (-- gone --)
2017/08/24 05:29:08
done
| |
| 12 # as the output manager impl. | |
| 13 | |
| 14 # pylint: disable=abstract-method | |
|
jbudorick
2017/08/23 16:16:20
Is this because one of these doesn't override a No
| |
| 15 # pylint: disable=no-self-use | |
| 16 # pylint: disable=super-init-not-called | |
|
jbudorick
2017/08/23 16:16:20
Why doesn't NoopArchivedFile call super.__init__()
mikecase (-- gone --)
2017/08/24 05:29:07
Because it creates a tempfile. Basically, I hate s
| |
| 17 # pylint: disable=unused-argument | |
| 18 | |
| 19 class NoopOutputManager(output_manager.OutputManager): | |
| 20 | |
| 21 def __init__(self): | |
| 22 super(NoopOutputManager, self).__init__() | |
| 23 | |
| 24 #override | |
| 25 @contextlib.contextmanager | |
| 26 def ArchiveAndDeleteFile(self, *args, **kwargs): | |
| 27 yield NoopArchivedFile() | |
| 28 | |
| 29 | |
| 30 class NoopArchivedFile(output_manager.ArchivedFile): | |
| 31 | |
| 32 def __init__(self): | |
| 33 pass | |
| 34 | |
| 35 def write(self, *args, **kwargs): | |
| 36 pass | |
| 37 | |
| 38 def flush(self, *args, **kwargs): | |
| 39 pass | |
| 40 | |
| 41 def Link(self): | |
| 42 return '' | |
| 43 | |
| OLD | NEW |