| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 from __future__ import print_function | 5 from __future__ import print_function |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 saved = getattr(logging, name) | 45 saved = getattr(logging, name) |
| 46 setattr(logging, name, replacement) | 46 setattr(logging, name, replacement) |
| 47 try: | 47 try: |
| 48 return fn(*args, **optargs) | 48 return fn(*args, **optargs) |
| 49 finally: | 49 finally: |
| 50 setattr(logging, name, saved) | 50 setattr(logging, name, saved) |
| 51 return impl | 51 return impl |
| 52 return decorator | 52 return decorator |
| 53 | 53 |
| 54 | 54 |
| 55 def ReadFile(*path): | 55 def ChromiumPath(*path): |
| 56 with open(os.path.join(sys.path[0], '..', '..', *path)) as f: | 56 return os.path.join( |
| 57 sys.path[0], '..', '..', '..', '..', '..', *path) |
| 58 |
| 59 |
| 60 def ReadFile(*path, **read_args): |
| 61 with open(ChromiumPath(*path), **read_args) as f: |
| 57 return f.read() | 62 return f.read() |
| OLD | NEW |