Update of /cvsroot/monetdb/sql/src/test/Views/Tests
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16112/src/test/Views/Tests

Modified Files:
        Views.SQL.py 
Log Message:
propagated changes of Wednesday Oct 14 2009
from the Nov2009 branch to the development trunk

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2009/10/14 - sjoerd: src/test/Views/Tests/Views.SQL.py,1.5.8.2
  propagated changes of Wednesday Oct 14 2009
  from the Aug2009 branch to the Nov2009 branch
  
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2009/10/14 - sjoerd: src/test/Views/Tests/Views.SQL.py,1.5.6.1
    Cleanup subprocess use.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: Views.SQL.py
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/Views/Tests/Views.SQL.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Views.SQL.py        13 Oct 2009 14:11:38 -0000      1.6
+++ Views.SQL.py        14 Oct 2009 12:16:50 -0000      1.7
@@ -2,18 +2,17 @@
 import subprocess
 
 
-def client(cmd):
-    clt = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
-    sys.stdout.write(clt.stdout.read())
-    clt.stdout.close()
-    sys.stderr.write(clt.stderr.read())
-    clt.stderr.close()
+def client(cmd, infile):
+    clt = subprocess.Popen(cmd, shell=True, universal_newlines=True, 
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    out, err = clt.communicate(open(infile).read())
+    sys.stdout.write(out)
+    sys.stderr.write(err)
 
 
 def main():
-    clcmd = str(os.getenv('SQL_CLIENT')) + "< %s" % 
('%s/../views_restrictions.sql' % os.getenv('RELSRCDIR'))
+    clcmd = os.getenv('SQL_CLIENT')
     sys.stdout.write('Views Restrictions\n')
-    client(clcmd)
+    client(clcmd, os.path.join(os.getenv('RELSRCDIR'), '..', 
'views_restrictions.sql'))
     sys.stdout.write('step 1\n')
     sys.stdout.write('Cleanup\n')
     sys.stdout.write('step2\n')


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to