Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / docs / server2 / data_source_registry.py
blob481a30b5c9145e3b5c803bf8270ab9bc85fd8d18
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
3 # found in the LICENSE file.
5 from data_source import DataSource
6 from intro_data_source import IntroDataSource
7 from manifest_data_source import ManifestDataSource
8 from permissions_data_source import PermissionsDataSource
9 from sidenav_data_source import SidenavDataSource
10 from strings_data_source import StringsDataSource
11 from template_data_source import TemplateDataSource
12 from whats_new_data_source import WhatsNewDataSource
15 _all_data_sources = {
16 'intros': IntroDataSource,
17 'manifest_source': ManifestDataSource,
18 'partials': TemplateDataSource,
19 'permissions': PermissionsDataSource,
20 'sidenavs': SidenavDataSource,
21 'strings': StringsDataSource,
22 'whatsNew' : WhatsNewDataSource
25 assert all(issubclass(cls, DataSource)
26 for cls in _all_data_sources.itervalues())
28 def CreateDataSources(server_instance, request=None):
29 '''Create a dictionary of initialized DataSources. DataSources are
30 initialized with |server_instance| and |request|. If the DataSources are
31 going to be used for Cron, |request| should be omitted.
33 The key of each DataSource is the name the template system will use to access
34 the DataSource.
35 '''
36 return dict((name, cls(server_instance, request))
37 for name, cls in _all_data_sources.iteritems())