~cbehrens/nova/lp844160-build-works-with-zones

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/web/examples/report.rpy.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.web.resource import Resource
 
2
 
 
3
 
 
4
class ReportResource(Resource):
 
5
 
 
6
    def render_GET(self, request):
 
7
        path = request.path
 
8
        _, host, port = request.getHost()
 
9
        url = request.prePathURL()
 
10
        uri = request.uri
 
11
        secure = (request.isSecure() and "securely") or "insecurely"
 
12
        return ("""\
 
13
<HTML>
 
14
    <HEAD><TITLE>Welcome To Twisted Python Reporting</title></head>
 
15
 
 
16
    <BODY><H1>Welcome To Twisted Python Reporting</H1>
 
17
    <UL>
 
18
    <LI>The path to me is %(path)s
 
19
    <LI>The host I'm on is %(host)s
 
20
    <LI>The port I'm on is %(port)s
 
21
    <LI>I was accessed %(secure)s
 
22
    <LI>A URL to me is %(url)s
 
23
    <LI>My URI to me is %(uri)s
 
24
    </UL>
 
25
    </body>
 
26
</html>""" % vars())
 
27
 
 
28
resource = ReportResource()