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

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

Issue 15842014: Doc Server Manifest Generation Followup Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 from fnmatch import fnmatch
6 import logging
7 import mimetypes
8 import traceback
9 import os
10
11 from api_data_source import APIDataSource 5 from api_data_source import APIDataSource
12 from api_list_data_source import APIListDataSource 6 from api_list_data_source import APIListDataSource
13 from appengine_url_fetcher import AppEngineUrlFetcher 7 from appengine_wrappers import IsDevServer
14 from appengine_wrappers import GetAppVersion, IsDevServer
15 from branch_utility import BranchUtility
16 from caching_file_system import CachingFileSystem 8 from caching_file_system import CachingFileSystem
17 from compiled_file_system import CompiledFileSystem 9 from compiled_file_system import CompiledFileSystem
18 from empty_dir_file_system import EmptyDirFileSystem 10 from empty_dir_file_system import EmptyDirFileSystem
19 from example_zipper import ExampleZipper 11 from example_zipper import ExampleZipper
20 from file_system import FileNotFoundError
21 from github_file_system import GithubFileSystem
22 from intro_data_source import IntroDataSource 12 from intro_data_source import IntroDataSource
23 from local_file_system import LocalFileSystem 13 from local_file_system import LocalFileSystem
14 from manifest_data_source import ManifestDataSource
24 from object_store_creator import ObjectStoreCreator 15 from object_store_creator import ObjectStoreCreator
25 from offline_file_system import OfflineFileSystem
26 from path_canonicalizer import PathCanonicalizer 16 from path_canonicalizer import PathCanonicalizer
27 from reference_resolver import ReferenceResolver 17 from reference_resolver import ReferenceResolver
28 from samples_data_source import SamplesDataSource 18 from samples_data_source import SamplesDataSource
29 from sidenav_data_source import SidenavDataSource 19 from sidenav_data_source import SidenavDataSource
30 from subversion_file_system import SubversionFileSystem
31 import svn_constants 20 import svn_constants
32 from template_data_source import TemplateDataSource 21 from template_data_source import TemplateDataSource
33 from test_object_store import TestObjectStore 22 from test_object_store import TestObjectStore
34 from third_party.json_schema_compiler.model import UnixName
35 import url_constants
36 23
37 class ServerInstance(object): 24 class ServerInstance(object):
38 def __init__(self, 25 def __init__(self,
39 channel, 26 channel,
40 object_store_creator, 27 object_store_creator,
41 host_file_system, 28 host_file_system,
42 app_samples_file_system, 29 app_samples_file_system,
43 static_path, 30 static_path,
44 compiled_fs_factory): 31 compiled_fs_factory):
45 self.channel = channel 32 self.channel = channel
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 77
91 self.intro_data_source_factory = IntroDataSource.Factory( 78 self.intro_data_source_factory = IntroDataSource.Factory(
92 self.compiled_host_fs_factory, 79 self.compiled_host_fs_factory,
93 self.ref_resolver_factory, 80 self.ref_resolver_factory,
94 [svn_constants.INTRO_PATH, svn_constants.ARTICLE_PATH]) 81 [svn_constants.INTRO_PATH, svn_constants.ARTICLE_PATH])
95 82
96 self.sidenav_data_source_factory = SidenavDataSource.Factory( 83 self.sidenav_data_source_factory = SidenavDataSource.Factory(
97 self.compiled_host_fs_factory, 84 self.compiled_host_fs_factory,
98 svn_constants.JSON_PATH) 85 svn_constants.JSON_PATH)
99 86
87 self.manifest_data_source = ManifestDataSource(
88 self.compiled_host_fs_factory,
89 host_file_system,
90 '/'.join((svn_constants.JSON_PATH, 'manifest.json')),
91 '/'.join((svn_constants.API_PATH, '_manifest_features.json')))
92
100 self.template_data_source_factory = TemplateDataSource.Factory( 93 self.template_data_source_factory = TemplateDataSource.Factory(
101 channel, 94 channel,
102 self.api_data_source_factory, 95 self.api_data_source_factory,
96
103 self.api_list_data_source_factory, 97 self.api_list_data_source_factory,
104 self.intro_data_source_factory, 98 self.intro_data_source_factory,
105 self.samples_data_source_factory, 99 self.samples_data_source_factory,
106 self.sidenav_data_source_factory, 100 self.sidenav_data_source_factory,
107 self.compiled_host_fs_factory, 101 self.compiled_host_fs_factory,
108 self.ref_resolver_factory, 102 self.ref_resolver_factory,
103 self.manifest_data_source,
109 svn_constants.PUBLIC_TEMPLATE_PATH, 104 svn_constants.PUBLIC_TEMPLATE_PATH,
110 svn_constants.PRIVATE_TEMPLATE_PATH, 105 svn_constants.PRIVATE_TEMPLATE_PATH,
111 static_path) 106 static_path)
112 107
113 self.example_zipper = ExampleZipper( 108 self.example_zipper = ExampleZipper(
114 self.compiled_host_fs_factory, 109 self.compiled_host_fs_factory,
115 svn_constants.DOCS_PATH) 110 svn_constants.DOCS_PATH)
116 111
117 self.path_canonicalizer = PathCanonicalizer( 112 self.path_canonicalizer = PathCanonicalizer(
118 channel, 113 channel,
(...skipping 21 matching lines...) Expand all
140 store_type=TestObjectStore) 135 store_type=TestObjectStore)
141 file_system = CachingFileSystem(LocalFileSystem.Create(), 136 file_system = CachingFileSystem(LocalFileSystem.Create(),
142 object_store_creator) 137 object_store_creator)
143 return ServerInstance( 138 return ServerInstance(
144 channel, 139 channel,
145 object_store_creator, 140 object_store_creator,
146 file_system, 141 file_system,
147 EmptyDirFileSystem(), 142 EmptyDirFileSystem(),
148 '/static', 143 '/static',
149 CompiledFileSystem.Factory(file_system, object_store_creator)) 144 CompiledFileSystem.Factory(file_system, object_store_creator))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698