yoga1290

Youssef Gamil / Shared class between AppEngine reqests :)!

Feb 5th, 2011
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. from google.appengine.ext import webapp
  2. from google.appengine.ext.webapp.util import run_wsgi_app
  3. class data:
  4.     s=''
  5. class test(webapp.RequestHandler):
  6.     d=data  # d.s Stores data!...smth like CALL-BY-REFERENCE?!
  7.     s=''    # s resets on every run
  8.     def get(self):
  9.         self.response.out.write(self.d.s+'\t\t'+self.s+"<br>")
  10.         self.d.s=self.s=self.request.remote_addr
  11.         self.response.out.write(self.d.s+'\t\t'+self.s)
  12. application = webapp.WSGIApplication(
  13.                                      [('/', test)],
  14.                                      debug=True)
  15. def main():
  16.     run_wsgi_app(application)
  17. if __name__ == "__main__":
  18.     main()
Advertisement
Add Comment
Please, Sign In to add comment