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

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

Issue 10809062: Extensions Docs Server: Samples search and icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Commit again to fix static path for non local docs Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/server2/echo_handler.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d22c5f83ec0a1a37f865f8d4e124a3a717109e0c..69167eb041b08311dfb4e9af6b55ab88926368ec 100644
--- a/chrome/common/extensions/docs/server2/samples_data_source.py
+++ b/chrome/common/extensions/docs/server2/samples_data_source.py
@@ -6,7 +6,7 @@ import json
import logging
import re
-DEFAULT_ICON_PATH = '/static/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.
@@ -16,7 +16,9 @@ class SamplesDataSource(object):
"""A factory to create SamplesDataSource instances bound to individual
Requests.
"""
- def __init__(self, file_system, cache_builder, samples_path):
+ def __init__(self, branch, file_system, cache_builder, samples_path):
+ self._static_path = ((('/' + branch) if branch != 'local' else '') +
+ '/static')
self._file_system = file_system
self._cache = cache_builder.build(self._MakeSamplesList)
self._samples_path = samples_path
@@ -91,7 +93,7 @@ class SamplesDataSource(object):
l10n_data = self._GetDataFromManifest(sample_path)
sample_base_path = sample_path.split('/', 1)[1]
if l10n_data['icon'] is None:
- icon_path = DEFAULT_ICON_PATH
+ icon_path = self._static_path + DEFAULT_ICON_PATH
else:
icon_path = sample_base_path + '/' + l10n_data['icon']
l10n_data.update({
« no previous file with comments | « chrome/common/extensions/docs/server2/echo_handler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698