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

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

Issue 10797039: Extensions Docs Server: devtools API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: console and audits are back 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
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 63d8aa3a3c819cf43c6977522b3e7c035611e85d..de937e6a4f0ad7ae8f98b7f9c3b670434fd3f7de 100644
--- a/chrome/common/extensions/docs/server2/api_list_data_source.py
+++ b/chrome/common/extensions/docs/server2/api_list_data_source.py
@@ -16,8 +16,14 @@ class APIListDataSource(object):
self._api_path = api_path + '/'
self._public_path = public_path + '/'
+ def _SanitizeAPIName(self, name):
+ filename = os.path.splitext(name)[0][len(self._api_path):].replace('/', '_')
+ if 'experimental' in filename:
+ filename = 'experimental_' + filename.replace('experimental_', '')
+ return filename
not at google - send to devlin 2012/07/30 08:17:20 This will have to play well with things like - lin
cduvall 2012/07/31 18:41:45 This is not used for handling $refs, this is just
+
def _ListAPIs(self, apis):
- api_names = set(os.path.splitext(name)[0] for name in apis)
+ api_names = set(self._SanitizeAPIName(name) for name in apis)
public_templates = self._file_system.ReadSingle(self._public_path)
template_names = [os.path.splitext(name)[0] for name in public_templates]
experimental_apis = []
@@ -40,6 +46,6 @@ class APIListDataSource(object):
def get(self, key):
try:
- return self._cache.GetFromFile(self._api_path)[key]
+ return self._cache.GetFromFileListing(self._api_path)[key]
except Exception as e:
return None

Powered by Google App Engine
This is Rietveld 408576698