Changes between Version 202 and Version 203 of WikiStart


Ignore:
Timestamp:
11/30/2011 01:35:05 PM (7 years ago)
Author:
Itamar Turner-Trauring
Comment:

Restore stateful web example

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v202 v203  
    162162class HelloResource(resource.Resource):
    163163    isLeaf = True
     164    numberRequests = 0
     165
    164166    def render_GET(self, request):
     167        self.numberRequests += 1
    165168        request.setHeader("content-type", "text/plain")
    166         return "Hello, world!"
     169        return "I am request #" + str(self.numberRequests)
    167170
    168171reactor.listenTCP(8080, server.Site(HelloResource()))