OLD | NEW |
---|---|
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 | 5 import os |
10 | 6 |
11 from api_data_source import APIDataSource | 7 from api_data_source import APIDataSource |
12 from api_list_data_source import APIListDataSource | 8 from api_list_data_source import APIListDataSource |
13 from appengine_url_fetcher import AppEngineUrlFetcher | 9 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 | 10 from caching_file_system import CachingFileSystem |
17 from compiled_file_system import CompiledFileSystem | 11 from compiled_file_system import CompiledFileSystem |
18 from empty_dir_file_system import EmptyDirFileSystem | 12 from empty_dir_file_system import EmptyDirFileSystem |
19 from example_zipper import ExampleZipper | 13 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 | 14 from intro_data_source import IntroDataSource |
23 from local_file_system import LocalFileSystem | 15 from local_file_system import LocalFileSystem |
16 from manifest_data_source import ManifestDataSource | |
24 from object_store_creator import ObjectStoreCreator | 17 from object_store_creator import ObjectStoreCreator |
25 from offline_file_system import OfflineFileSystem | |
26 from path_canonicalizer import PathCanonicalizer | 18 from path_canonicalizer import PathCanonicalizer |
27 from reference_resolver import ReferenceResolver | 19 from reference_resolver import ReferenceResolver |
28 from samples_data_source import SamplesDataSource | 20 from samples_data_source import SamplesDataSource |
29 from sidenav_data_source import SidenavDataSource | 21 from sidenav_data_source import SidenavDataSource |
30 from subversion_file_system import SubversionFileSystem | |
31 import svn_constants | 22 import svn_constants |
32 from template_data_source import TemplateDataSource | 23 from template_data_source import TemplateDataSource |
33 from test_object_store import TestObjectStore | 24 from test_object_store import TestObjectStore |
34 from third_party.json_schema_compiler.model import UnixName | |
35 import url_constants | |
36 | 25 |
37 class ServerInstance(object): | 26 class ServerInstance(object): |
38 def __init__(self, | 27 def __init__(self, |
39 channel, | 28 channel, |
40 object_store_creator, | 29 object_store_creator, |
41 host_file_system, | 30 host_file_system, |
42 app_samples_file_system): | 31 app_samples_file_system): |
43 self.channel = channel | 32 self.channel = channel |
44 | 33 |
45 self.object_store_creator = object_store_creator | 34 self.object_store_creator = object_store_creator |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 | 79 |
91 self.intro_data_source_factory = IntroDataSource.Factory( | 80 self.intro_data_source_factory = IntroDataSource.Factory( |
92 self.compiled_host_fs_factory, | 81 self.compiled_host_fs_factory, |
93 self.ref_resolver_factory, | 82 self.ref_resolver_factory, |
94 [svn_constants.INTRO_PATH, svn_constants.ARTICLE_PATH]) | 83 [svn_constants.INTRO_PATH, svn_constants.ARTICLE_PATH]) |
95 | 84 |
96 self.sidenav_data_source_factory = SidenavDataSource.Factory( | 85 self.sidenav_data_source_factory = SidenavDataSource.Factory( |
97 self.compiled_host_fs_factory, | 86 self.compiled_host_fs_factory, |
98 svn_constants.JSON_PATH) | 87 svn_constants.JSON_PATH) |
99 | 88 |
89 self.manifest_data_source = ManifestDataSource( | |
90 self.compiled_host_fs_factory, | |
91 os.path.join(svn_constants.JSON_PATH, 'manifest.json'), | |
not at google - send to devlin
2013/05/10 04:14:14
'/'.join, these are URL paths not os paths.
jshumway
2013/05/11 02:37:08
Done.
| |
92 os.path.join(svn_constants.API_PATH, '_manifest_features.json'), channel) | |
93 | |
100 self.template_data_source_factory = TemplateDataSource.Factory( | 94 self.template_data_source_factory = TemplateDataSource.Factory( |
101 channel, | 95 channel, |
102 self.api_data_source_factory, | 96 self.api_data_source_factory, |
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 | 106 |
112 self.example_zipper = ExampleZipper( | 107 self.example_zipper = ExampleZipper( |
113 self.compiled_host_fs_factory, | 108 self.compiled_host_fs_factory, |
114 svn_constants.DOCS_PATH) | 109 svn_constants.DOCS_PATH) |
115 | 110 |
116 self.path_canonicalizer = PathCanonicalizer( | 111 self.path_canonicalizer = PathCanonicalizer( |
117 channel, | 112 channel, |
118 self.compiled_host_fs_factory) | 113 self.compiled_host_fs_factory) |
(...skipping 12 matching lines...) Expand all Loading... | |
131 def ForLocal(): | 126 def ForLocal(): |
132 channel = 'trunk' | 127 channel = 'trunk' |
133 object_store_creator = ObjectStoreCreator(channel, | 128 object_store_creator = ObjectStoreCreator(channel, |
134 start_empty=False, | 129 start_empty=False, |
135 store_type=TestObjectStore) | 130 store_type=TestObjectStore) |
136 return ServerInstance( | 131 return ServerInstance( |
137 channel, | 132 channel, |
138 object_store_creator, | 133 object_store_creator, |
139 CachingFileSystem(LocalFileSystem.Create(), object_store_creator), | 134 CachingFileSystem(LocalFileSystem.Create(), object_store_creator), |
140 EmptyDirFileSystem()) | 135 EmptyDirFileSystem()) |
OLD | NEW |