""" print "Content-Type: text/html" print import cgitb cgitb.enable() import RunBatch import cgi import subprocess import sys form = cgi.FieldStorage() if form.has_key("job_id"): import subprocess job_id = int(form["job_id"].value) run = {"job_id":job_id} RunBatch.KillOne(run) print""" <html><head><title>Job %(job_id)d killed</title></head> <body>Job %(job_id)d killed </body> </html> """%(globals()) elif form.has_key("batch_id"): batch_id = int(form["batch_id"].value) RunBatch.KillBatch(batch_id) url = "ViewBatch.py?batch_id=%d"%(batch_id) print "<html><head>" print "<meta http-equiv='refresh' content='0; URL=%(url)s' />"%(globals()) print "</head>" print "<body>This page should be redirected to <a href='%(url)s'/>%(url)s</a></body>"%(globals())