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

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

Issue 11079010: Extensions Docs Server: Preserve JSON declaration order in extensions documentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated with the new simplejson Created 8 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/build_server.py
diff --git a/chrome/common/extensions/docs/server2/build_server.py b/chrome/common/extensions/docs/server2/build_server.py
index 5a99253e70e9247a5c9c812398c5d8a261007c31..4605ab9f4fb95e0c79a086c377963eeb7239e095 100755
--- a/chrome/common/extensions/docs/server2/build_server.py
+++ b/chrome/common/extensions/docs/server2/build_server.py
@@ -15,7 +15,10 @@ SRC_DIR = os.path.join(sys.path[0], os.pardir, os.pardir, os.pardir, os.pardir,
THIRD_PARTY_DIR = os.path.join(SRC_DIR, 'third_party')
LOCAL_THIRD_PARTY_DIR = os.path.join(sys.path[0], 'third_party')
TOOLS_DIR = os.path.join(SRC_DIR, 'tools')
-SCHEMA_COMPILER_FILES = ['model.py', 'idl_schema.py', 'schema_util.py']
+SCHEMA_COMPILER_FILES = ['model.py',
+ 'idl_schema.py',
+ 'schema_util.py',
+ 'json_parse.py']
def MakeInit(path):
path = os.path.join(path, '__init__.py')
@@ -26,17 +29,19 @@ def OnError(function, path, excinfo):
os.chmod(path, stat.S_IWUSR)
function(path)
-def CopyThirdParty(src, dest, files=None):
+def CopyThirdParty(src, dest, files=None, make_init=True):
dest_path = os.path.join(LOCAL_THIRD_PARTY_DIR, dest)
if not files:
shutil.copytree(src, dest_path)
- MakeInit(dest_path)
+ if make_init:
+ MakeInit(dest_path)
return
try:
os.makedirs(dest_path)
except Exception:
pass
- MakeInit(dest_path)
+ if make_init:
+ MakeInit(dest_path)
for filename in files:
shutil.copy(os.path.join(src, filename), os.path.join(dest_path, filename))
@@ -60,6 +65,9 @@ def main():
'json_schema_compiler',
SCHEMA_COMPILER_FILES)
CopyThirdParty(TOOLS_DIR, 'json_schema_compiler', ['json_comment_eater.py'])
+ CopyThirdParty(os.path.join(THIRD_PARTY_DIR, 'simplejson'),
+ os.path.join('json_schema_compiler', 'simplejson'),
+ make_init=False)
MakeInit(LOCAL_THIRD_PARTY_DIR)
# To be able to use the Handlebar class we need this import in __init__.py.
« no previous file with comments | « chrome/common/extensions/docs/server2/api_data_source_test.py ('k') | tools/json_schema_compiler/json_parse.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698