Fix async to use the new argfiles method (wrapping brain around rock, really must write module development guide)

This commit is contained in:
Michael DeHaan
2012-03-14 19:57:56 -04:00
parent aeea46678d
commit 696b67f935
5 changed files with 38 additions and 46 deletions

View File

@@ -30,32 +30,10 @@ import traceback
import shlex
import os
if len(sys.argv) == 1:
print json.dumps({
"failed" : True,
"msg" : "the command module requires arguments (-a)"
})
sys.exit(1)
argfile = sys.argv[1]
if not os.path.exists(argfile):
print json.dumps({
"failed" : True,
"msg" : "Argument file not found"
})
sys.exit(1)
args = open(argfile, 'r').read()
args = shlex.split(args)
if not len(args):
print json.dumps({
"failed" : True,
"msg" : "the command module requires arguments (-a)"
})
sys.exit(1)
startd = datetime.datetime.now()
try: