Index: chrome/common/extensions/docs/server2/template_data_source.py |
diff --git a/chrome/common/extensions/docs/server2/template_data_source.py b/chrome/common/extensions/docs/server2/template_data_source.py |
index 3c36b7151fc18a8d1b40af12789570718a66376b..853eb67c33ca2f142f91232a7a150ae5ce07ce9b 100644 |
--- a/chrome/common/extensions/docs/server2/template_data_source.py |
+++ b/chrome/common/extensions/docs/server2/template_data_source.py |
@@ -19,7 +19,7 @@ def _MakeBranchDict(branch): |
{ 'name': 'Beta', 'path': 'beta' }, |
{ 'name': 'Trunk', 'path': 'trunk' } |
], |
- 'current': branch |
+ 'current': None |
} |
class TemplateDataSource(object): |
@@ -48,8 +48,6 @@ class TemplateDataSource(object): |
public_template_path, |
private_template_path): |
self._branch_info = _MakeBranchDict(branch) |
- self._static_resources = ((('/' + branch) if branch != 'local' else '') + |
- '/static') |
self._api_data_source_factory = api_data_source_factory |
self._api_list_data_source = api_list_data_source |
self._intro_data_source = intro_data_source |
@@ -58,12 +56,11 @@ class TemplateDataSource(object): |
self._public_template_path = public_template_path |
self._private_template_path = private_template_path |
- def Create(self, request): |
+ def Create(self, request, channel_name): |
not at google - send to devlin
2012/08/13 00:53:00
See comment in handler.py. This could go in the fa
cduvall
2012/08/13 21:45:04
Done.
|
"""Returns a new TemplateDataSource bound to |request|. |
""" |
return TemplateDataSource( |
self._branch_info, |
- self._static_resources, |
self._api_data_source_factory.Create(request), |
self._api_list_data_source, |
self._intro_data_source, |
@@ -71,11 +68,11 @@ class TemplateDataSource(object): |
self._cache, |
self._public_template_path, |
self._private_template_path, |
- request) |
+ request, |
+ channel_name) |
def __init__(self, |
branch_info, |
- static_resources, |
api_data_source, |
api_list_data_source, |
intro_data_source, |
@@ -83,9 +80,9 @@ class TemplateDataSource(object): |
cache, |
public_template_path, |
private_template_path, |
- request): |
+ request, |
+ channel_name): |
self._branch_info = branch_info |
- self._static_resources = static_resources |
self._api_list_data_source = api_list_data_source |
self._intro_data_source = intro_data_source |
self._samples_data_source = samples_data_source |
@@ -94,6 +91,10 @@ class TemplateDataSource(object): |
self._public_template_path = public_template_path |
self._private_template_path = private_template_path |
self._request = request |
+ self._channel_name = channel_name |
+ self._branch_info['current'] = channel_name |
not at google - send to devlin
2012/08/13 00:53:00
If you do that, then you could make the current ch
cduvall
2012/08/13 21:45:04
Done.
|
+ self._static_resources = ( |
+ (('/' + channel_name) if channel_name != 'local' else '') + '/static') |
not at google - send to devlin
2012/08/13 00:53:00
Will this cause problems when we need to configure
not at google - send to devlin
2012/08/13 05:47:12
I also note that SamplesDataSource does the same t
cduvall
2012/08/13 21:45:04
This won't cause any problems. Even if the static
|
def Render(self, template_name): |
"""This method will render a template named |template_name|, fetching all |