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

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

Issue 58303002: Docserver: Clean up APIListDataSourceTest a bit by constructing a full (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/api_list_data_source_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/api_list_data_source.py
diff --git a/chrome/common/extensions/docs/server2/api_list_data_source.py b/chrome/common/extensions/docs/server2/api_list_data_source.py
index df4bfaf97566a95e699cce7853e340e2b13b6664..10c4087449ba6b6ed471aea254e807f99e830661 100644
--- a/chrome/common/extensions/docs/server2/api_list_data_source.py
+++ b/chrome/common/extensions/docs/server2/api_list_data_source.py
@@ -4,9 +4,9 @@
from operator import itemgetter
import os
+import posixpath
-from third_party.json_schema_compiler.json_parse import Parse
-import third_party.json_schema_compiler.model as model
+from svn_constants import PUBLIC_TEMPLATE_PATH
import docs_server_utils as utils
def _GetAPICategory(api, documented_apis):
@@ -38,13 +38,9 @@ class APIListDataSource(object):
def __init__(self,
compiled_fs_factory,
file_system,
- public_template_path,
features_bundle,
object_store_creator):
self._file_system = file_system
- def NormalizePath(string):
- return string if string.endswith('/') else (string + '/')
- self._public_template_path = NormalizePath(public_template_path)
self._cache = compiled_fs_factory.Create(file_system,
self._CollectDocumentedAPIs,
APIListDataSource)
@@ -54,8 +50,8 @@ class APIListDataSource(object):
def _CollectDocumentedAPIs(self, base_dir, files):
def GetDocumentedAPIsForPlatform(names, platform):
public_templates = []
- for root, _, files in self._file_system.Walk(
- self._public_template_path + platform):
+ for root, _, files in self._file_system.Walk(posixpath.join(
+ PUBLIC_TEMPLATE_PATH, platform)):
public_templates.extend(
('%s/%s' % (root, name)).lstrip('/') for name in files)
template_names = set(os.path.splitext(name)[0]
@@ -69,7 +65,7 @@ class APIListDataSource(object):
def _GenerateAPIDict(self):
documented_apis = self._cache.GetFromFileListing(
- self._public_template_path).Get()
+ PUBLIC_TEMPLATE_PATH).Get()
api_features = self._features_bundle.GetAPIFeatures()
def FilterAPIs(platform):
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/api_list_data_source_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698