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

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

Issue 10828235: Extensions Docs Server: Efficient MemcacheFileSystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 json 5 import json
6 import logging 6 import logging
7 import os 7 import os
8 8
9 from handlebar_dict_generator import HandlebarDictGenerator 9 from handlebar_dict_generator import HandlebarDictGenerator
10 import third_party.json_schema_compiler.json_comment_eater as json_comment_eater 10 import third_party.json_schema_compiler.json_comment_eater as json_comment_eater
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 def get(self, key): 84 def get(self, key):
85 path, ext = os.path.splitext(key) 85 path, ext = os.path.splitext(key)
86 unix_name = model.UnixName(path) 86 unix_name = model.UnixName(path)
87 json_path = unix_name + '.json' 87 json_path = unix_name + '.json'
88 idl_path = unix_name + '.idl' 88 idl_path = unix_name + '.idl'
89 try: 89 try:
90 return self._GenerateHandlebarContext(key, 90 return self._GenerateHandlebarContext(key,
91 self._json_cache.GetFromFile(self._base_path + '/' + json_path), 91 self._json_cache.GetFromFile(self._base_path + '/' + json_path),
92 path) 92 path)
93 except OSError: 93 except IOError:
94 try: 94 try:
95 return self._GenerateHandlebarContext(key, 95 return self._GenerateHandlebarContext(key,
96 self._idl_cache.GetFromFile(self._base_path + '/' + idl_path), 96 self._idl_cache.GetFromFile(self._base_path + '/' + idl_path),
97 path) 97 path)
98 except OSError as e: 98 except IOError as e:
99 raise 99 raise
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698