summaryrefslogtreecommitdiffstats
path: root/o3d/documentation
diff options
context:
space:
mode:
authorgman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-03 19:01:37 +0000
committergman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-03 19:01:37 +0000
commitf8d51c6f1a9c629dfc7fd65a72639398addf245d (patch)
treee9165e8b3e6863932940da82f64dd91fa69ddf98 /o3d/documentation
parentd50d9dbb65e6ebce429fcbdab5c04e5a76b32f9b (diff)
downloadchromium_src-f8d51c6f1a9c629dfc7fd65a72639398addf245d.zip
chromium_src-f8d51c6f1a9c629dfc7fd65a72639398addf245d.tar.gz
chromium_src-f8d51c6f1a9c629dfc7fd65a72639398addf245d.tar.bz2
Change build to only have one place to list
o3djs files and build / selenium to use compiled o3djs libs. Review URL: http://codereview.chromium.org/353017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/documentation')
-rwxr-xr-xo3d/documentation/build_docs.py69
-rw-r--r--o3d/documentation/documentation.gyp8
-rw-r--r--o3d/documentation/get_docs_files.py70
3 files changed, 17 insertions, 130 deletions
diff --git a/o3d/documentation/build_docs.py b/o3d/documentation/build_docs.py
index 3022922..8d56d43 100755
--- a/o3d/documentation/build_docs.py
+++ b/o3d/documentation/build_docs.py
@@ -96,65 +96,6 @@ def MakeCommandName(name):
return name
-def UpdateGlobals(dict):
- """Copies pairs from dict into GlobalDict."""
- for i, v in dict.items():
- GlobalsDict.__setitem__(i, v)
-
-
-def GetCallingNamespaces():
- """Return the locals and globals for the function that called
- into this module in the current call stack."""
- try: 1/0
- except ZeroDivisionError:
- # Don't start iterating with the current stack-frame to
- # prevent creating reference cycles (f_back is safe).
- frame = sys.exc_info()[2].tb_frame.f_back
-
- # Find the first frame that *isn't* from this file
- while frame.f_globals.get("__name__") == __name__:
- frame = frame.f_back
-
- return frame.f_locals, frame.f_globals
-
-
-def ComputeExports(exports):
- """Compute a dictionary of exports given one of the parameters
- to the Export() function or the exports argument to SConscript()."""
-
- loc, glob = GetCallingNamespaces()
-
- retval = {}
- try:
- for export in exports:
- if isinstance(export, types.DictType):
- retval.update(export)
- else:
- try:
- retval[export] = loc[export]
- except KeyError:
- retval[export] = glob[export]
- except KeyError, x:
- raise Error, "Export of non-existent variable '%s'"%x
-
- return retval
-
-
-def Export(*vars):
- """Copies the named variables to GlobalDict."""
- for var in vars:
- UpdateGlobals(ComputeExports(vars))
-
-
-def Import(filename):
- """Imports a python file in a scope with 'Export' defined."""
- scope = {'__builtins__': globals()['__builtins__'],
- 'Export': Export}
- file = open(filename, 'r')
- exec file in scope
- file.close()
-
-
def Execute(args):
"""Executes an external program."""
# Comment the next line in for debugging.
@@ -366,11 +307,11 @@ def main(argv):
externs_path = MakePath('externs', 'externs.js')
o3d_extra_externs_path = MakePath('externs', 'o3d-extra-externs.js')
- Import(js_list_filename)
- Import(idl_list_filename)
+ js_list = eval(open(js_list_filename, "r").read())
+ idl_list = eval(open(idl_list_filename, "r").read())
- idl_files = AppendBasePath(idl_list_basepath, GlobalsDict['O3D_IDL_SOURCES'])
- o3djs_files = AppendBasePath(js_list_basepath, GlobalsDict['O3D_JS_SOURCES'])
+ idl_files = AppendBasePath(idl_list_basepath, idl_list)
+ o3djs_files = AppendBasePath(js_list_basepath, js_list)
# we need to put base.js first?
o3djs_files = (
@@ -380,7 +321,7 @@ def main(argv):
docs_js_files = [os.path.join(
docs_js_outpath,
os.path.splitext(os.path.basename(f))[0] + '.js')
- for f in GlobalsDict['O3D_IDL_SOURCES']]
+ for f in idl_list]
DeleteOldDocs(MakePath(docs_outpath))
BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath)
diff --git a/o3d/documentation/documentation.gyp b/o3d/documentation/documentation.gyp
index fbba4a6..1d697e0 100644
--- a/o3d/documentation/documentation.gyp
+++ b/o3d/documentation/documentation.gyp
@@ -75,6 +75,14 @@
],
},
],
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/samples/o3djs',
+ 'files': [
+ '<(PRODUCT_DIR)/docs/documentation/base.js',
+ ],
+ },
+ ],
},
],
},
diff --git a/o3d/documentation/get_docs_files.py b/o3d/documentation/get_docs_files.py
index 90fcefc..c138bc1 100644
--- a/o3d/documentation/get_docs_files.py
+++ b/o3d/documentation/get_docs_files.py
@@ -10,86 +10,24 @@ import sys
import types
-GlobalsDict = { }
-
-
-def UpdateGlobals(dict):
- """Copies pairs from dict into GlobalDict."""
- for i, v in dict.items():
- GlobalsDict.__setitem__(i, v)
-
-
def AppendBasePath(folder, filenames):
"""Appends a base path to a ist of files"""
return [os.path.join(folder, filename) for filename in filenames]
-def GetCallingNamespaces():
- """Return the locals and globals for the function that called
- into this module in the current call stack."""
- try: 1/0
- except ZeroDivisionError:
- # Don't start iterating with the current stack-frame to
- # prevent creating reference cycles (f_back is safe).
- frame = sys.exc_info()[2].tb_frame.f_back
-
- # Find the first frame that *isn't* from this file
- while frame.f_globals.get("__name__") == __name__:
- frame = frame.f_back
-
- return frame.f_locals, frame.f_globals
-
-
-def ComputeExports(exports):
- """Compute a dictionary of exports given one of the parameters
- to the Export() function or the exports argument to SConscript()."""
-
- loc, glob = GetCallingNamespaces()
-
- retval = {}
- try:
- for export in exports:
- if isinstance(export, types.DictType):
- retval.update(export)
- else:
- try:
- retval[export] = loc[export]
- except KeyError:
- retval[export] = glob[export]
- except KeyError, x:
- raise Error, "Export of non-existent variable '%s'"%x
-
- return retval
-
-
-def Export(*vars):
- """Copies the named variables to GlobalDict."""
- for var in vars:
- UpdateGlobals(ComputeExports(vars))
-
-
-def Import(filename):
- """Imports a python file in a scope with 'Export' defined."""
- scope = {'__builtins__': globals()['__builtins__'],
- 'Export': Export}
- file = open(filename, 'r')
- exec file in scope
- file.close()
-
-
def GetIdlFiles():
idl_list_filename = os.path.join('..', 'plugin', 'idl_list.manifest')
idl_list_basepath = os.path.dirname(idl_list_filename)
- Import(idl_list_filename)
- idl_files = AppendBasePath(idl_list_basepath, GlobalsDict['O3D_IDL_SOURCES'])
+ files = eval(open(idl_list_filename, "r").read())
+ idl_files = AppendBasePath(idl_list_basepath, files)
return idl_files
def GetJsFiles():
js_list_filename = os.path.join('..', 'samples', 'o3djs', 'js_list.manifest')
js_list_basepath = os.path.dirname(js_list_filename)
- Import(js_list_filename)
- o3djs_files = AppendBasePath(js_list_basepath, GlobalsDict['O3D_JS_SOURCES'])
+ files = eval(open(js_list_filename, "r").read())
+ o3djs_files = AppendBasePath(js_list_basepath, files)
return o3djs_files