[llvm-commits] [zorg] r146224 - /zorg/trunk/lnt/lnt/lnttool/create.py

Daniel Dunbar daniel at zuster.org
Thu Dec 8 17:21:11 PST 2011


Author: ddunbar
Date: Thu Dec  8 19:21:11 2011
New Revision: 146224

URL: http://llvm.org/viewvc/llvm-project?rev=146224&view=rev
Log:
lnt/lnttool create: Embed the path to the python binary used to create the
instance in the .wsgi file by default, and make it executable.
 - Makes things even easier when using a virtualenv that hasn't been activated.

Modified:
    zorg/trunk/lnt/lnt/lnttool/create.py

Modified: zorg/trunk/lnt/lnt/lnttool/create.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/lnttool/create.py?rev=146224&r1=146223&r2=146224&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/lnttool/create.py (original)
+++ zorg/trunk/lnt/lnt/lnttool/create.py Thu Dec  8 19:21:11 2011
@@ -1,5 +1,6 @@
 import os
 import platform
+import sys
 
 ###
 
@@ -60,7 +61,7 @@
 """
 
 kWSGITemplate = """\
-#!/usr/bin/env python2.6
+#!%(python_executable)s
 # -*- Python -*-
 
 from lnt.viewer import app
@@ -121,6 +122,7 @@
 
     hosturl = "http://%s/%s" % (hostname, hostsuffix)
 
+    python_executable = sys.executable
     db_dir_path = os.path.join(basepath, db_dir)
     cfg_path = os.path.join(basepath, config)
     db_path = os.path.join(db_dir_path, default_db)
@@ -139,6 +141,7 @@
     wsgi_file = open(wsgi_path, 'w')
     wsgi_file.write(kWSGITemplate % locals())
     wsgi_file.close()
+    os.chmod(wsgi_path, 0755)
 
     db = lnt.db.perfdb.PerfDB('sqlite:///' + db_path)
     db.commit()
@@ -151,7 +154,7 @@
     print '  host URL          : %s' % hosturl
     print
     print 'You can execute:'
-    print '  python %s' % wsgi_path
+    print '  %s' % wsgi_path
     print 'to test your installation with the builtin server.'
     print
     print 'For production use configure this application to run with any'





More information about the llvm-commits mailing list