~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/debuginfo/__init__.py

  • Committer: William Grant
  • Date: 2009-01-22 04:47:42 UTC
  • mfrom: (1080.1.93 storm)
  • Revision ID: grantw@unimelb.edu.au-20090122044742-sa8gnww0ma2bm2rv
Merge Storm branch. ivle.db is dead. Watch out for the schema change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
# Important: This application should be removed from a production system.
25
25
 
26
26
import os
 
27
import cgi
27
28
 
28
29
from ivle import util
29
30
import ivle.conf
70
71
        ("user", req.user),
71
72
        ("hostname", req.hostname),
72
73
    ])
73
 
    if req.user is not None:
74
 
        print_table(req, "req.user", dict(req.user).items(), "h4")
75
74
 
76
75
    # Violate encapsulation here to print out the hidden properties
77
76
    print_table(req, "Apache (Hidden) Request Properties", [
88
87
        getfieldvalues(req.get_fieldstorage().items()))
89
88
    session = req.get_session()
90
89
    print_table(req, "Session Variables", session.items())
91
 
    if 'user' in session:
92
 
        print_table(req, "session['user']", dict(session['user']).items(),
93
 
            "h4")
94
90
 
95
91
    print_table(req, "HTTP Request Headers",
96
92
        req.apache_req.headers_in.items())
124
120
    req.write("<%s>%s</%s>\n" % (head_elem, tablename, head_elem))
125
121
    req.write('<table border="1">\n')
126
122
    for (k,v) in mapping:
127
 
        req.write("<tr><th>%s</th><td>%s</td></tr>\n" % (str(k), repr(v)))
 
123
        req.write("<tr><th>%s</th><td>%s</td></tr>\n" %
 
124
                  (cgi.escape(str(k)), cgi.escape(repr(v))))
128
125
    req.write("</table>\n")
129
126