[OpenLayers-Commits] r12268 - trunk/openlayers/tools

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Aug 22 06:10:48 EDT 2011


Author: bartvde
Date: 2011-08-22 03:10:46 -0700 (Mon, 22 Aug 2011)
New Revision: 12268

Modified:
   trunk/openlayers/tools/closure.py
Log:
fix closure build on Windows, p=jorix, r=me, thanks to mprins and scaddenp, I've verified that the build still works on OSX (closes #3158)

Modified: trunk/openlayers/tools/closure.py
===================================================================
--- trunk/openlayers/tools/closure.py	2011-08-22 06:56:28 UTC (rev 12267)
+++ trunk/openlayers/tools/closure.py	2011-08-22 10:10:46 UTC (rev 12268)
@@ -2,20 +2,21 @@
 import os
 import tempfile
 
-path = os.path.abspath(os.path.join(os.path.dirname(__file__), "closure-compiler.jar"))
+path = "../tools/closure-compiler.jar"
 if not os.path.exists(path):
     raise Exception("No closure-compiler.jar at %s; read README.txt!" % path)
 
 def minimize(code):
-    ntf = tempfile.NamedTemporaryFile()
+    ntf = tempfile.NamedTemporaryFile(delete=False)
     ntf.write(code)
     ntf.flush()
 
-    ntf2 = tempfile.NamedTemporaryFile()
+    ntf2 = tempfile.NamedTemporaryFile(delete=False)
+    ntf.close()
+    ntf2.close()
 
     os.system("java -jar %s --js %s --js_output_file %s" % (path, ntf.name, ntf2.name))
-    ntf2.seek(0)
-    data = ntf2.read()
-    ntf.close()
-    ntf2.close()
+    data = open(ntf2.name).read()
+    os.unlink(ntf.name)
+    os.unlink(ntf2.name)
     return data



More information about the Commits mailing list