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

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

Issue 10835012: Extension Docs Server: Include a list of samples used in the api reference page. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: api_data_source is a factory Created 8 years, 4 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import logging 6 import logging
7 import os 7 import os
8 import sys 8 import sys
9 9
10 # Add the original server location to sys.path so we are able to import 10 # Add the original server location to sys.path so we are able to import
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return SERVER_INSTANCES[branch] 71 return SERVER_INSTANCES[branch]
72 if branch == 'local': 72 if branch == 'local':
73 file_system = LocalFileSystem(EXTENSIONS_PATH) 73 file_system = LocalFileSystem(EXTENSIONS_PATH)
74 else: 74 else:
75 fetcher = AppEngineUrlFetcher( 75 fetcher = AppEngineUrlFetcher(
76 _GetURLFromBranch(branch) + '/' + EXTENSIONS_PATH) 76 _GetURLFromBranch(branch) + '/' + EXTENSIONS_PATH)
77 file_system = MemcacheFileSystem(SubversionFileSystem(fetcher), 77 file_system = MemcacheFileSystem(SubversionFileSystem(fetcher),
78 AppEngineMemcache(branch, memcache)) 78 AppEngineMemcache(branch, memcache))
79 79
80 cache_builder = FileSystemCache.Builder(file_system) 80 cache_builder = FileSystemCache.Builder(file_system)
81 api_data_source = APIDataSource(cache_builder, API_PATH) 81 api_data_source_factory = APIDataSource.Factory(cache_builder, API_PATH)
82 api_list_data_source = APIListDataSource(cache_builder, 82 api_list_data_source = APIListDataSource(cache_builder,
83 file_system, 83 file_system,
84 API_PATH, 84 API_PATH,
85 PUBLIC_TEMPLATE_PATH) 85 PUBLIC_TEMPLATE_PATH)
86 intro_data_source = IntroDataSource(cache_builder, 86 intro_data_source = IntroDataSource(cache_builder,
87 [INTRO_PATH, ARTICLE_PATH]) 87 [INTRO_PATH, ARTICLE_PATH])
88 samples_data_source_factory = SamplesDataSource.Factory(branch, 88 samples_data_source_factory = SamplesDataSource.Factory(branch,
89 file_system, 89 file_system,
90 cache_builder, 90 cache_builder,
91 EXAMPLES_PATH) 91 EXAMPLES_PATH)
92 template_data_source_factory = TemplateDataSource.Factory( 92 template_data_source_factory = TemplateDataSource.Factory(
93 branch, 93 branch,
94 api_data_source, 94 api_data_source_factory,
95 api_list_data_source, 95 api_list_data_source,
96 intro_data_source, 96 intro_data_source,
97 samples_data_source_factory, 97 samples_data_source_factory,
98 cache_builder, 98 cache_builder,
99 PUBLIC_TEMPLATE_PATH, 99 PUBLIC_TEMPLATE_PATH,
100 PRIVATE_TEMPLATE_PATH) 100 PRIVATE_TEMPLATE_PATH)
101 example_zipper = ExampleZipper(file_system, 101 example_zipper = ExampleZipper(file_system,
102 cache_builder, 102 cache_builder,
103 DOCS_PATH, 103 DOCS_PATH,
104 EXAMPLES_PATH) 104 EXAMPLES_PATH)
(...skipping 27 matching lines...) Expand all
132 # TODO: This leaks Server instances when branch bumps. 132 # TODO: This leaks Server instances when branch bumps.
133 self._GetInstanceForBranch(branch).Get(real_path, 133 self._GetInstanceForBranch(branch).Get(real_path,
134 self.request, 134 self.request,
135 self.response) 135 self.response)
136 136
137 def main(): 137 def main():
138 run_wsgi_app(webapp.WSGIApplication([('/.*', Handler)], debug=False)) 138 run_wsgi_app(webapp.WSGIApplication([('/.*', Handler)], debug=False))
139 139
140 if __name__ == '__main__': 140 if __name__ == '__main__':
141 main() 141 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698