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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/site_tests/factory_Audio/factory_Audio.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/bin/factory_error.py
diff --git a/client/bin/factory_error.py b/client/bin/factory_error.py
new file mode 100644
index 0000000000000000000000000000000000000000..a52521e301e906dedf683559375e9c38eca75cd9
--- /dev/null
+++ b/client/bin/factory_error.py
@@ -0,0 +1,21 @@
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# DESCRIPTION :
+#
+# This library provides mocked exception classes that replace all newline
+# characters with "<br/>" so that the factory log is easier to parse.
+
+from autotest_lib.client.common_lib import error
+
+_glob = globals()
+for _name in error.__all__:
+ _thing = error.__dict__[_name]
+ if isinstance(_thing, type) and issubclass(_thing, Exception):
+ _str = lambda self: _thing.__str__(self).replace('\n', '<br/>')
+ _glob[_name] = type(_name, (_thing,), dict(__str__=_str))
+ else:
+ _glob[_name] = _thing
+
+__all__ = error.__all__
« 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