[Swift-commit] r4819 - SwiftApps/GOSwift/pykoa/tools
jonmon at ci.uchicago.edu
jonmon at ci.uchicago.edu
Tue Jul 12 14:58:49 CDT 2011
Author: jonmon
Date: 2011-07-12 14:58:49 -0500 (Tue, 12 Jul 2011)
New Revision: 4819
Modified:
SwiftApps/GOSwift/pykoa/tools/koa_goswift.py
Log:
modified how input is read from stdin
Modified: SwiftApps/GOSwift/pykoa/tools/koa_goswift.py
===================================================================
--- SwiftApps/GOSwift/pykoa/tools/koa_goswift.py 2011-07-12 17:00:08 UTC (rev 4818)
+++ SwiftApps/GOSwift/pykoa/tools/koa_goswift.py 2011-07-12 19:58:49 UTC (rev 4819)
@@ -63,17 +63,13 @@
lines = []
index = 0
- while True:
- try:
- lines.append( raw_input() )
- except EOFError:
- break
+ lines = sys.stdin.readlines()
tc = extract_tc( lines )
sites_file = extract_sites( lines )
config = extract_config( lines )
script = extract_script( lines )
-
+
return ( tc, sites_file, config, script )
def extract_tc( lines ):
@@ -82,6 +78,8 @@
for line in lines:
+ line=line.rstrip()
+
if line == "# begin tc":
begin_tc = True
@@ -100,6 +98,8 @@
for line in lines:
+ line=line.rstrip()
+
if line == "# begin sites":
begin_sites = True
@@ -118,6 +118,8 @@
for line in lines:
+ line=line.rstrip()
+
if line == "# begin config":
begin_config = True
@@ -136,6 +138,8 @@
for line in lines:
+ line=line.rstrip()
+
if line == "# begin script":
begin_script = True
More information about the Swift-commit
mailing list