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

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

Issue 453713002: Docserver: Generate a table of extension/app API owners (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mlg rebasing Created 6 years, 3 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
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 sys 5 import sys
6 6
7 import schema_util 7 import schema_util
8 from docs_server_utils import ToUnicode 8 from docs_server_utils import ToUnicode
9 from file_system import FileNotFoundError 9 from file_system import FileNotFoundError
10 from future import Future 10 from future import Future
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 return Future(exc_info=sys.exc_info()) 200 return Future(exc_info=sys.exc_info())
201 201
202 cache_entry = self._file_object_store.Get(path).Get() 202 cache_entry = self._file_object_store.Get(path).Get()
203 if (cache_entry is not None) and (version == cache_entry.version): 203 if (cache_entry is not None) and (version == cache_entry.version):
204 return Future(value=cache_entry._cache_data) 204 return Future(value=cache_entry._cache_data)
205 205
206 def compile_(files): 206 def compile_(files):
207 cache_data = self._compilation_function(path, files) 207 cache_data = self._compilation_function(path, files)
208 self._file_object_store.Set(path, _CacheEntry(cache_data, version)) 208 self._file_object_store.Set(path, _CacheEntry(cache_data, version))
209 return cache_data 209 return cache_data
210
210 return self._file_system.ReadSingle( 211 return self._file_system.ReadSingle(
211 path, skip_not_found=skip_not_found).Then(compile_) 212 path, skip_not_found=skip_not_found).Then(compile_)
212 213
213 def GetFromFileListing(self, path): 214 def GetFromFileListing(self, path):
214 '''Calls |compilation_function| on the listing of the files at |path|. 215 '''Calls |compilation_function| on the listing of the files at |path|.
215 Assumes that the path given is to a directory. 216 Assumes that the path given is to a directory.
216 ''' 217 '''
217 AssertIsDirectory(path) 218 AssertIsDirectory(path)
218 219
219 try: 220 try:
(...skipping 22 matching lines...) Expand all
242 cache_entry = self._list_object_store.Get(path).Get() 243 cache_entry = self._list_object_store.Get(path).Get()
243 if cache_entry is not None: 244 if cache_entry is not None:
244 return cache_entry.version 245 return cache_entry.version
245 return self._file_system.Stat(path).version 246 return self._file_system.Stat(path).version
246 247
247 def FileExists(self, path): 248 def FileExists(self, path):
248 return self._file_system.Exists(path) 249 return self._file_system.Exists(path)
249 250
250 def GetIdentity(self): 251 def GetIdentity(self):
251 return self._file_system.GetIdentity() 252 return self._file_system.GetIdentity()
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/app.yaml ('k') | chrome/common/extensions/docs/server2/cron.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698