On Mon, 09 Apr 2012 13:49:05 +0300, k4ml <[email protected]> wrote:
class PHPApplication(object):
def __init__(self):
self.out = []
self.counter = 0
self.counter += 1
self.out.append(str(self.counter))
def printx(self, out):
self.out.append(out)
def __call__(self, environ, start_response):
start_response('200 OK', [('Content-type', 'text/html')])
for out in self.out:
yield out
from php import PHPApplication
php = PHPApplication()
php.printx("hello world")
application = php
But it look like the application object is
created on each requests since the counter always stayed at 1 even
after refreshing my browser few times. What I'm missing here ?
The only place where you do increase counter is in __init__ and you do it
only right after setting counter to 0. So counter will always be 1, no
matter what. Perhaps you should move self.counter += 1 to __call__ method?
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en.