diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 19:01:37 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 19:01:37 +0000 |
commit | f8d51c6f1a9c629dfc7fd65a72639398addf245d (patch) | |
tree | e9165e8b3e6863932940da82f64dd91fa69ddf98 /o3d/documentation/build_docs.py | |
parent | d50d9dbb65e6ebce429fcbdab5c04e5a76b32f9b (diff) | |
download | chromium_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/build_docs.py')
-rwxr-xr-x | o3d/documentation/build_docs.py | 69 |
1 files changed, 5 insertions, 64 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) |