annotate clwapp/utils.py @ 0:196f241286f7

initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
author k0s <k0scist@gmail.com>
date Sun, 01 Nov 2009 18:24:35 -0500
parents
children a0816f433861
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
1 import subprocess
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
2
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
3 def shargs(args):
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
4 process = subprocess.Popen('for arg in %s; do echo $arg; done' % args,
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
5 shell=True, stdout=subprocess.PIPE)
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
6 output = process.communicate()[0]
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
7 output = output[:-1] # last line will be blank
196f241286f7 initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
k0s <k0scist@gmail.com>
parents:
diff changeset
8 return output.split('\n')