From bd51b6d625a770224e3f00b030ae7e2579e7cf4a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 9 Oct 2010 18:15:26 -0400 Subject: [PATCH] Compile all Closure CSS files into a generated file to cut down on HTTP requests. --- build.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 52e2bec..b2a3a0a 100755 --- a/build.py +++ b/build.py @@ -112,12 +112,14 @@ def Main(): print ' COPY ' + resource shutil.copy(os.path.join(FE_PATH, resource), fe_resources) fd = open(os.path.join(fe_resources, 'closure.css'), 'w+') + fd.write('/*=== Generated Resources for Closure Library ===*/') for resource in RESOURCES_CLOSURE: - dest_name = 'closure_' + resource - print ' COPY ' + dest_name - shutil.copy(os.path.join(CLOSURE_DEST, 'closure', 'goog', 'css', resource), - os.path.join(fe_resources, dest_name)) - fd.write('@import url(/fe/' + dest_name + ');\n') + print ' COPY closure/' + resource + respath = os.path.join(CLOSURE_DEST, 'closure', 'goog', 'css', resource) + ofd = open(respath, 'r') + fd.write('\n\n/*=== File: ' + respath.replace(ROOT, '/') + ' ===*/\n') + fd.writelines(ofd.readlines()) + ofd.close() fd.close() # Version -- 2.43.5