[Swift-commit] r7621 - SwiftApps/swift-galaxy/swift

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Thu Feb 27 09:43:08 CST 2014


Author: ketan
Date: 2014-02-27 09:43:06 -0600 (Thu, 27 Feb 2014)
New Revision: 7621

Modified:
   SwiftApps/swift-galaxy/swift/swiftforeachrange.py
Log:
site generation in python

Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.py
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.py	2014-02-26 21:34:23 UTC (rev 7620)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.py	2014-02-27 15:43:06 UTC (rev 7621)
@@ -5,12 +5,13 @@
 #import rpy
 import os
 
-#echo $@ > /tmp/args.txt
 def setwdir():
     return subprocess.check_output(["mktemp", "-d", "/tmp/swift-gal.XXXX"])
 
 # numeric range
 def main():
+    print "%d" % (len(sys.argv))
+    print "%s" % (sys.argv)
     try:
         sites=sys.argv[1] # comma separated list of sites
         swiftargs=sys.argv[2]
@@ -66,8 +67,13 @@
     swift=subprocess.check_output(["which", "swift"])
     
     #build site
-    basedir=os.path.dirname(sys.argv[0])
-    subprocess.call([basedir, "/buildsite.sh", "sites", "wdir"])
+    if os.path.dirname(sys.argv[0]):
+        basedir=os.path.dirname(sys.argv[0])
+    else:
+        basedir='.'
+        
+    print "%s %s %s" %(basedir, sites, wdir)
+    subprocess.call([basedir+"/buildsite.sh", sites, wdir])
     
     #build config
     f=open(wdir+"/cf", 'w');
@@ -81,12 +87,12 @@
     
 
     #build tc
-     
     f=open(wdir+"/tc", 'w');
     for site in sites.split():
         f.write(site+' '+interpreter+' '+interpreter)
     f.close()
 
+    '''
     exitcode=subprocess.call([swift, '-sites.file', wdir, '/sites.xml', '-tc.file', wdir, '/tc', '-config', wdir, '/cf', wdir, '/script.swift', swiftargs, '2>logfile'])
     
     #`for i in \`find $HOME/swift-sandbox -type f\`; do echo "\`basename $i\` $i"; done`
@@ -96,6 +102,6 @@
     f.write(i);
     f.close()
     #dum ditty dum ditty dum dum dum
-
+'''
 if __name__=='__main__':
     main()




More information about the Swift-commit mailing list