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

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

Issue 63203002: Docserver: Make the hand-written Cron methods run first rather than last, since (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jeffrey Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 from operator import itemgetter 6 from operator import itemgetter
7 import posixpath 7 import posixpath
8 8
9 from chroot_file_system import ChrootFileSystem 9 from chroot_file_system import ChrootFileSystem
10 from content_provider import ContentProvider 10 from content_provider import ContentProvider
11 from future import Gettable, Future
11 from svn_constants import JSON_PATH 12 from svn_constants import JSON_PATH
12 from third_party.json_schema_compiler.memoize import memoize 13 from third_party.json_schema_compiler.memoize import memoize
13 14
14 15
15 _CONFIG_PATH = '%s/content_providers.json' % JSON_PATH 16 _CONFIG_PATH = '%s/content_providers.json' % JSON_PATH
16 17
17 18
18 class ContentProviders(object): 19 class ContentProviders(object):
19 '''Implements the content_providers.json configuration; see 20 '''Implements the content_providers.json configuration; see
20 chrome/common/extensions/docs/templates/json/content_providers.json for its 21 chrome/common/extensions/docs/templates/json/content_providers.json for its
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 '%s: content provider type "%s" not supported' % (name, type_)) 96 '%s: content provider type "%s" not supported' % (name, type_))
96 return None 97 return None
97 98
98 return ContentProvider(name, 99 return ContentProvider(name,
99 self._compiled_fs_factory, 100 self._compiled_fs_factory,
100 file_system, 101 file_system,
101 supports_templates=supports_templates, 102 supports_templates=supports_templates,
102 supports_zip=supports_zip) 103 supports_zip=supports_zip)
103 104
104 def Cron(self): 105 def Cron(self):
105 for name, config in self._GetConfig().iteritems(): 106 futures = [self._CreateContentProvider(name, config).Cron()
106 self._CreateContentProvider(name, config).Cron() 107 for name, config in self._GetConfig().iteritems()]
108 return Future(delegate=Gettable(lambda: [f.Get() for f in futures]))
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/content_provider.py ('k') | chrome/common/extensions/docs/server2/cron.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698