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

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

Issue 14218004: Devserver: only populate data during cron jobs, meaning all data from instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integration test Created 7 years, 8 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 import logging 5 import logging
6 6
7 from branch_utility import BranchUtility 7 from branch_utility import BranchUtility
8 from docs_server_utils import FormatKey 8 from docs_server_utils import FormatKey
9 import compiled_file_system as compiled_fs 9 import compiled_file_system as compiled_fs
10 from file_system import FileNotFoundError 10 from file_system import FileNotFoundError
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return render_data.text 140 return render_data.text
141 141
142 def get(self, key): 142 def get(self, key):
143 return self.GetTemplate(self._private_template_path, key) 143 return self.GetTemplate(self._private_template_path, key)
144 144
145 def GetTemplate(self, base_path, template_name): 145 def GetTemplate(self, base_path, template_name):
146 real_path = FormatKey(template_name) 146 real_path = FormatKey(template_name)
147 try: 147 try:
148 return self._cache.GetFromFile(base_path + '/' + real_path) 148 return self._cache.GetFromFile(base_path + '/' + real_path)
149 except FileNotFoundError as e: 149 except FileNotFoundError as e:
150 logging.info(e) 150 logging.warning('Template %s in %s not found: %s' % (
151 template_name, base_path, e))
151 return None 152 return None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698