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

Side by Side Diff: client/bin/factory_error.py

Issue 3438007: Replace newline characters in factory tests (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: Address review comments Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | client/site_tests/factory_Audio/factory_Audio.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2010 The Chromium OS 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 # DESCRIPTION :
6 #
7 # This library provides mocked exception classes that replace all newline
8 # characters with "<br/>" so that the factory log is easier to parse.
9
10 from autotest_lib.client.common_lib import error
11
12 _glob = globals()
13 for _name in error.__all__:
14 _thing = error.__dict__[_name]
15 if isinstance(_thing, type) and issubclass(_thing, Exception):
16 _str = lambda self: _thing.__str__(self).replace('\n', '<br/>')
17 _glob[_name] = type(_name, (_thing,), dict(__str__=_str))
18 else:
19 _glob[_name] = _thing
20
21 __all__ = error.__all__
OLDNEW
« no previous file with comments | « no previous file | client/site_tests/factory_Audio/factory_Audio.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698