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

Unified Diff: chrome/common/extensions/docs/server2/content_providers.py

Issue 61393002: Docserver: Enable GitHub content providers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/content_providers.py
diff --git a/chrome/common/extensions/docs/server2/content_providers.py b/chrome/common/extensions/docs/server2/content_providers.py
index 97e9390343284ca793a0945aaf88844f295cacbb..981579aa557e75bca8b5c80eaa5883c091e64f94 100644
--- a/chrome/common/extensions/docs/server2/content_providers.py
+++ b/chrome/common/extensions/docs/server2/content_providers.py
@@ -23,9 +23,13 @@ class ContentProviders(object):
Returns ContentProvider instances based on how they're configured there.
'''
- def __init__(self, compiled_fs_factory, host_file_system):
+ def __init__(self,
+ compiled_fs_factory,
+ host_file_system,
+ github_file_system_provider):
self._compiled_fs_factory = compiled_fs_factory
self._host_file_system = host_file_system
+ self._github_file_system_provider = github_file_system_provider
self._cache = compiled_fs_factory.ForJson(host_file_system)
@memoize
@@ -77,6 +81,13 @@ class ContentProviders(object):
return None
file_system = ChrootFileSystem(self._host_file_system,
chromium_config['dir'])
+ elif 'github' in config:
+ github_config = config['github']
+ if 'owner' not in github_config or 'repo' not in github_config:
+ logging.error('"github" must provide a owner and repo')
Jeffrey Yasskin 2013/11/06 04:00:19 I think your error should include the name of the
not at google - send to devlin 2013/11/06 23:00:13 Good idea.
+ return None
+ file_system = self._github_file_system_provider.Create(
Jeffrey Yasskin 2013/11/06 04:00:19 Does github need to provide a chroot too?
not at google - send to devlin 2013/11/06 23:00:13 Not yet, but might as well.
+ github_config['owner'], github_config['repo'])
else:
logging.error('Content provider type "%s" not supported', type_)
return None

Powered by Google App Engine
This is Rietveld 408576698