#!/usr/bin/env python # encoding: utf-8 """ marchive.py Created by Greg Kellogg on 2007-01-01. Tool to run zgrep through a CS-MARS archive """ __author__ = "Greg Kellogg (greg@dunechaser.org)" __version__ = "$Revision: 0.1 $" __date__ = "$Date: 1/1/07 11:14:34 $" __copyright__ = "Copyright (c) 2005 Greg Kellogg" __license__ = "BSD" import cgi, os, time, sys marsDir = "/nfs/mars-lc/" zgrep = '/usr/bin/zgrep -iP' configFile = "/var/www/cgi-bin/marchive.queries" # OS X Does not support -P in zgrep # Required header that tells the browser how to render the HTML. print "Content-Type: text/html\n\n" # Style sheet stuff print """ \n """ #Bootstrap application when called, load up the variables with directory information def bootstrap(): try: dateDirectories = os.listdir(marsDir) return dateDirectories except os.error, value: print value[0], value[1] # Here is the form that dynamically builds from the directory structure def buildForm(fileName,searchString='',startDate='',endDate=''): print '