I want to update logfile as soon as a request comes. I have a class
variable event_logging_enabled which is initialised to TRUE. and in
the POST() function I check the value of event_logging_enabled.
Now at run time, I modify the value of this flag to FALSE for
subsequent requests. But It remains TRUE.
During debugging, I found that when a request is received, a new
object get created to handle each request, so, will pick initialized
value i.e.TRUE.
This is not the case for other functions like getlogEnabled() of same
class.
Can you please suggest any work around.
import web
import threading
class webServer(threading.Thread):
port = "1234"
event_logging_enabled = "True"
def getlogEnabled(self):
print "Stub getlogEnabled(): ",self.event_logging_enabled
def __init__(self):
threading.Thread.__init__(self)
""" Logging """
print "Init------------------------",self.event_logging_enabled
self.event_logging_filename = "ueLogs.log"
def run(self):
urls = (
'/','webServer',
)
app = web.application(urls,globals())
sys.argv.append(webServer.port)
app.run()
def POST(self):
print "in POST"
print "Stub POST(): Logging Enabled :
",self.event_logging_enabled
--
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en.