[Swift-commit] r7618 - SwiftApps/swift-galaxy/swift
ketan at ci.uchicago.edu
ketan at ci.uchicago.edu
Mon Feb 24 22:34:37 CST 2014
Author: ketan
Date: 2014-02-24 22:34:37 -0600 (Mon, 24 Feb 2014)
New Revision: 7618
Modified:
SwiftApps/swift-galaxy/swift/swiftforeachrange.py
Log:
fixes in python version
Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.py
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.py 2014-02-25 03:34:45 UTC (rev 7617)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.py 2014-02-25 04:34:37 UTC (rev 7618)
@@ -2,7 +2,7 @@
import subprocess
import sys
-import rpy
+#import rpy
import os
#echo $@ > /tmp/args.txt
@@ -24,7 +24,8 @@
logfile=sys.argv[10]
stringargs=sys.argv[11]
except:
- rpy.stop_error('Wrong number or type of args')
+ #rpy.stop_error('Wrong number or type of args')
+ sys.exit(1)
#workout the array only if user adds args else make it blank
if stringargs:
@@ -38,15 +39,14 @@
#workout the array only if user adds file args else make it blank
if fileargs:
- filearrayexpr='file fileargs[]='+str(fileargs)';'
- else
+ filearrayexpr='file fileargs[]='+str(fileargs)+';'
+ else:
filearrayexpr='file fileargs[];'
- fi
- wdir=setwdir()
+ wdir=setwdir().rstrip()
#Build Swift source code
f=open(wdir+"/script.swift", 'w');
- f.write(type file;)
+ f.write('type file;')
f.write('app (file _out, file _err) anapp(file _exec, int _i, string _stringargs[], file _fileargs[]){')
f.write(' '+interpreter+' @_exec _i _stringargs @_fileargs stdout=@_out stderr=@_err;')
@@ -96,3 +96,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