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

Unified Diff: chrome/common/extensions/docs/server2/api_models.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: fix samples 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/api_models.py
diff --git a/chrome/common/extensions/docs/server2/api_models.py b/chrome/common/extensions/docs/server2/api_models.py
index e55ccb8dc773819bd0b4496ef3dd3e0fbf2e9273..b8a1b1fc36cd10262855f27e579fb75c631728dc 100644
--- a/chrome/common/extensions/docs/server2/api_models.py
+++ b/chrome/common/extensions/docs/server2/api_models.py
@@ -7,10 +7,10 @@ import os
import posixpath
from compiled_file_system import SingleFile
+from extensions_paths import API
from file_system import FileNotFoundError
from future import Gettable, Future
from schema_util import ProcessSchema
-from svn_constants import API_PATH
from third_party.json_schema_compiler.model import Namespace, UnixName
@@ -46,24 +46,23 @@ class APIModels(object):
# Callers sometimes specify a filename which includes .json or .idl - if
# so, believe them. They may even include the 'api/' prefix.
if os.path.splitext(api_name)[1] in ('.json', '.idl'):
- if not api_name.startswith(API_PATH + '/'):
- api_name = posixpath.join(API_PATH, api_name)
+ if not api_name.startswith(API + '/'):
+ api_name = posixpath.join(API, api_name)
return self._model_cache.GetFromFile(api_name)
- assert not api_name.startswith(API_PATH)
+ assert not api_name.startswith(API)
# API names are given as declarativeContent and app.window but file names
# will be declarative_content and app_window.
file_name = UnixName(api_name).replace('.', '_')
- # Devtools APIs are in API_PATH/devtools/ not API_PATH/, and have their
+ # Devtools APIs are in API/devtools/ not API/, and have their
# "devtools" names removed from the file names.
basename = posixpath.basename(file_name)
if basename.startswith('devtools_'):
file_name = posixpath.join(
'devtools', file_name.replace(basename, basename[len('devtools_'):]))
- futures = [self._model_cache.GetFromFile('%s/%s.%s' %
- (API_PATH, file_name, ext))
+ futures = [self._model_cache.GetFromFile('%s/%s.%s' % (API, file_name, ext))
for ext in ('json', 'idl')]
def resolve():
for future in futures:

Powered by Google App Engine
This is Rietveld 408576698