~ntt-pf-lab/nova/monkey_patch_notification

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/doc/web/examples/hello.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
# This is a resource file, which generates some useful
 
2
# information
 
3
# To use it, rename it to "hello.rpy" and put it in the path of
 
4
# any normally-configured Twisted web server.
 
5
 
 
6
from twisted.web import static
 
7
import time
 
8
 
 
9
now = time.ctime()
 
10
 
 
11
d = '''\
 
12
<HTML><HEAD><TITLE>Hello Rpy</TITLE>
 
13
 
 
14
<H1>Hello World, It is Now %(now)s</H1>
 
15
 
 
16
<UL>
 
17
''' % vars()
 
18
 
 
19
for i in range(10):
 
20
    d += "<LI>%(i)s" % vars()
 
21
 
 
22
d += '''\
 
23
</UL>
 
24
 
 
25
</BODY></HTML>
 
26
'''
 
27
 
 
28
resource = static.Data(d, 'text/html')