Changes between Version 195 and Version 196 of WikiStart


Ignore:
Timestamp:
11/21/2011 02:44:57 PM (7 years ago)
Author:
Itamar Turner-Trauring
Comment:

Persistent state is ard

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v195 v196  
    7474class HelloResource(resource.Resource):
    7575    isLeaf = True
     76    numberRequests = 0
     77
    7678    def render_GET(self, request):
     79        self.numberRequests += 1
    7780        request.setHeader("content-type", "text/plain")
    78         return "Hello, world!"
     81        return "I am request #" + str(self.numberRequests)
    7982
    8083reactor.listenTCP(8080, server.Site(HelloResource()))