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

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

Issue 10689144: Extensions Docs Server: Samples zip files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up and tests 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
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/echo_handler.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 os 6 import os
7 7
8 from handlebar_dict_generator import HandlebarDictGenerator 8 from handlebar_dict_generator import HandlebarDictGenerator
9 import third_party.json_schema_compiler.json_comment_eater as json_comment_eater 9 import third_party.json_schema_compiler.json_comment_eater as json_comment_eater
10 import third_party.json_schema_compiler.model as model 10 import third_party.json_schema_compiler.model as model
(...skipping 21 matching lines...) Expand all
32 32
33 def __getitem__(self, key): 33 def __getitem__(self, key):
34 return self.get(key) 34 return self.get(key)
35 35
36 def get(self, key): 36 def get(self, key):
37 path, ext = os.path.splitext(key) 37 path, ext = os.path.splitext(key)
38 unix_name = model.UnixName(path) 38 unix_name = model.UnixName(path)
39 json_path = unix_name + '.json' 39 json_path = unix_name + '.json'
40 idl_path = unix_name + '.idl' 40 idl_path = unix_name + '.idl'
41 try: 41 try:
42 return self._json_cache.get(self._base_path + '/' + json_path) 42 return self._json_cache.getFromFile(self._base_path + '/' + json_path)
43 except: 43 except:
44 try: 44 try:
45 return self._idl_cache.get(self._base_path + '/' + idl_path) 45 return self._idl_cache.getFromFile(self._base_path + '/' + idl_path)
46 except: 46 except:
47 pass 47 return None
48 return None
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/echo_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698