aboutsummaryrefslogtreecommitdiff
path: root/scripts/steuermann_report.cgi
diff options
context:
space:
mode:
authorsienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d>2011-08-31 13:55:26 -0400
committersienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d>2011-08-31 13:55:26 -0400
commit7adeddaa0f345149d9747596fff9573197c65b10 (patch)
tree76e6e41d559e047877488ab858eee558f12cc043 /scripts/steuermann_report.cgi
parente5733929096f35f37001c572ddde42bbda893870 (diff)
downloadsteuermann-7adeddaa0f345149d9747596fff9573197c65b10.tar.gz
checkpoint
git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@388 d34015c8-bcbb-4646-8ac8-8ba5febf221d
Diffstat (limited to 'scripts/steuermann_report.cgi')
-rw-r--r--scripts/steuermann_report.cgi36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/steuermann_report.cgi b/scripts/steuermann_report.cgi
new file mode 100644
index 0000000..fb82b89
--- /dev/null
+++ b/scripts/steuermann_report.cgi
@@ -0,0 +1,36 @@
+#! python
+
+import cgi
+import cgitb
+
+cgitb.enable()
+
+form = cgi.FieldStorage(keep_blank_values=1)
+cginame = os.getenv("SCRIPT_NAME")
+
+import sqlite3
+
+if not 'action' in form :
+ print 'content-type: text/html'
+ print ''
+ db = sqlite3.connect('db.sr')
+ c = db.cursor()
+ c.execute('SELECT DISTINCT run FROM status ORDER BY run ASC')
+ for run, in c :
+ print "<a href=%s?action=report&run=%s>%s</a><br>"%(cginame, run, run)
+ return
+
+action = form['action'].value
+
+if action == 'report' :
+ import steuermann.report
+ print 'content-type: text/html'
+ print ''
+ run = form['run'].value
+ print steuermann.report.report_html( db, run )
+ return
+
+print 'content-type: text/html'
+print ''
+print 'no action?'
+