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

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

Issue 10704252: Extensions Docs Server: Internal file system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed up Created 8 years, 5 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 path_utils import FormatKey 5 from path_utils import FormatKey
6 from third_party.handlebar import Handlebar 6 from third_party.handlebar import Handlebar
7 7
8 EXTENSIONS_URL = '/chrome/extensions' 8 EXTENSIONS_URL = '/chrome/extensions'
9 9
10 class TemplateDataSource(object): 10 class TemplateDataSource(object):
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 'static': self._static_resources 60 'static': self._static_resources
61 }).text 61 }).text
62 62
63 def __getitem__(self, key): 63 def __getitem__(self, key):
64 return self.get(key) 64 return self.get(key)
65 65
66 def get(self, key): 66 def get(self, key):
67 real_path = FormatKey(key) 67 real_path = FormatKey(key)
68 for base_path in self._base_paths: 68 for base_path in self._base_paths:
69 try: 69 try:
70 return self._cache.getFromFile(base_path + '/' + real_path) 70 return self._cache.GetFromFile(base_path + '/' + real_path)
71 except: 71 except Exception:
72 pass 72 pass
73 return None 73 return None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698