#!/usr/bin/python import sys import os import cgi import types import time import shutil import re import tarfile import glob from stat import ST_SIZE import cgitb cgitb.enable() ## zz: eliminar for real work? sys.stderr = sys.stdout ACE_MAX_time = 2 * 3600 ## 4 hours is max duration allowd for any process ### There are lots of ugly hacks here. Could turn into a module many of the ### functions below _if_ they took parameters (instead of just getting things ### from the global environment. def commonOutput(): print "Content-type: text/html\n\n" print """
This is an autorefreshing page; your results will eventually be displayed here.\n' print 'If your browser does not autorefresh, the results will be kept for five days at
' print '', 'http://adacgh2.bioinfo.cnio.es/tmp/'+ newDir + '/results.html.' print '
' def valueNumUpload(fieldName, testNumber = 'float', minValue = 0): """Upload and get the values and do some checking. For text and radio selections with positive numeric data. We assume there is an existing call to fs = cgi.FieldStorage()""" if not fs.has_key(fieldName): shutil.rmtree(tmpDir) commonOutput() print "", fieldName, "value required
" print "Please fill up the required fields and try again
" print "" sys.exit() if fs[fieldName].filename: shutil.rmtree(tmpDir) commonOutput() print "", fieldName, "should not be a file.
" print "Please fill up the required fields and try again
" print "