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

Side by Side Diff: chrome/common/extensions/docs/server2/test_util.py

Issue 68873003: Docserver: Serve docs out of src/ not src/chrome/common/extensions. This allows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix samples Created 7 years, 1 month 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
OLDNEW
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
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()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698