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

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

Issue 68873003: Docserver: Serve docs out of src/ not src/chrome/common/extensions. This allows (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/samples_data_source.py
diff --git a/chrome/common/extensions/docs/server2/samples_data_source.py b/chrome/common/extensions/docs/server2/samples_data_source.py
index 3fdd09e5d540ad0b3c6f8658b4e78671ff987b84..25fb441668a2a3f08d558b6cd9357ebc08fd1ab8 100644
--- a/chrome/common/extensions/docs/server2/samples_data_source.py
+++ b/chrome/common/extensions/docs/server2/samples_data_source.py
@@ -10,11 +10,14 @@ import re
import traceback
from compiled_file_system import CompiledFileSystem
+from extensions_paths import EXAMPLES
import third_party.json_schema_compiler.json_comment_eater as json_comment_eater
import third_party.json_schema_compiler.model as model
import url_constants
-DEFAULT_ICON_PATH = 'images/sample-default-icon.png'
+
+_DEFAULT_ICON_PATH = 'images/sample-default-icon.png'
+
class SamplesDataSource(object):
'''Constructs a list of samples and their respective files and api calls.
@@ -28,12 +31,10 @@ class SamplesDataSource(object):
app_samples_file_system,
compiled_fs_factory,
ref_resolver_factory,
- extension_samples_path,
base_path):
self._host_file_system = host_file_system
self._app_samples_file_system = app_samples_file_system
self._ref_resolver = ref_resolver_factory.Create()
- self._extension_samples_path = extension_samples_path
self._base_path = base_path
self._extensions_cache = compiled_fs_factory.Create(
host_file_system,
@@ -51,7 +52,6 @@ class SamplesDataSource(object):
'''
return SamplesDataSource(self._extensions_cache,
self._apps_cache,
- self._extension_samples_path,
self._base_path,
request)
@@ -161,7 +161,7 @@ class SamplesDataSource(object):
manifest_data = self._GetDataFromManifest(sample_path, file_system)
if manifest_data['icon'] is None:
icon_path = posixpath.join(
- self._base_path, 'static', DEFAULT_ICON_PATH)
+ self._base_path, 'static', _DEFAULT_ICON_PATH)
else:
icon_path = '%s/%s' % (icon_base, manifest_data['icon'])
manifest_data.update({
@@ -178,12 +178,10 @@ class SamplesDataSource(object):
def __init__(self,
extensions_cache,
apps_cache,
- extension_samples_path,
base_path,
request):
self._extensions_cache = extensions_cache
self._apps_cache = apps_cache
- self._extension_samples_path = extension_samples_path
self._base_path = base_path
self._request = request
@@ -210,8 +208,7 @@ class SamplesDataSource(object):
if key == 'apps':
samples_list = self._apps_cache.GetFromFileListing('/').Get()
else:
- samples_list = self._extensions_cache.GetFromFileListing(
- self._extension_samples_path + '/').Get()
+ samples_list = self._extensions_cache.GetFromFileListing(EXAMPLES).Get()
return_list = []
for dict_ in samples_list:
name = dict_['name']

Powered by Google App Engine
This is Rietveld 408576698