Permalink
Browse files

updates to tornado 3.1 , also separates hellotornado.py from app.py

  • Loading branch information...
1 parent dcb11d6 commit dc49b9b8d8b43f0f6accf3877425fd56ef8fb3a4 @gfidente committed Jun 30, 2013
Showing with 13,205 additions and 4,416 deletions.
  1. +1 −1 .openshift/action_hooks/stop
  2. +7 −20 README.creole
  3. +18 −0 diy/app.py
  4. +5 −19 diy/hellotornado.py
  5. +3 −0 misc/virtenv/lib/python2.6/site-packages/concurrent/__init__.py
  6. +18 −0 misc/virtenv/lib/python2.6/site-packages/concurrent/futures/__init__.py
  7. +574 −0 misc/virtenv/lib/python2.6/site-packages/concurrent/futures/_base.py
  8. +101 −0 misc/virtenv/lib/python2.6/site-packages/concurrent/futures/_compat.py
  9. +363 −0 misc/virtenv/lib/python2.6/site-packages/concurrent/futures/process.py
  10. +138 −0 misc/virtenv/lib/python2.6/site-packages/concurrent/futures/thread.py
  11. +19 −0 misc/virtenv/lib/python2.6/site-packages/futures-2.1.4-py2.6.egg-info/PKG-INFO
  12. +16 −0 misc/virtenv/lib/python2.6/site-packages/futures-2.1.4-py2.6.egg-info/SOURCES.txt
  13. 0 .../site-packages/{tornado-2.4.1-py2.6.egg-info → futures-2.1.4-py2.6.egg-info}/dependency_links.txt
  14. +24 −0 misc/virtenv/lib/python2.6/site-packages/futures-2.1.4-py2.6.egg-info/installed-files.txt
  15. +1 −0 misc/virtenv/lib/python2.6/site-packages/futures-2.1.4-py2.6.egg-info/not-zip-safe
  16. +2 −0 misc/virtenv/lib/python2.6/site-packages/futures-2.1.4-py2.6.egg-info/top_level.txt
  17. +24 −0 misc/virtenv/lib/python2.6/site-packages/futures/__init__.py
  18. +1 −0 misc/virtenv/lib/python2.6/site-packages/futures/process.py
  19. +1 −0 misc/virtenv/lib/python2.6/site-packages/futures/thread.py
  20. +0 −11 misc/virtenv/lib/python2.6/site-packages/tornado-2.4.1-py2.6.egg-info/PKG-INFO
  21. +135 −0 misc/virtenv/lib/python2.6/site-packages/tornado-3.1-py2.6.egg-info/PKG-INFO
  22. +18 −5 ...b/python2.6/site-packages/{tornado-2.4.1-py2.6.egg-info → tornado-3.1-py2.6.egg-info}/SOURCES.txt
  23. +1 −0 misc/virtenv/lib/python2.6/site-packages/tornado-3.1-py2.6.egg-info/dependency_links.txt
  24. +30 −6 ...2.6/site-packages/{tornado-2.4.1-py2.6.egg-info → tornado-3.1-py2.6.egg-info}/installed-files.txt
  25. 0 ...python2.6/site-packages/{tornado-2.4.1-py2.6.egg-info → tornado-3.1-py2.6.egg-info}/top_level.txt
  26. +5 −5 misc/virtenv/lib/python2.6/site-packages/tornado/__init__.py
  27. +519 −335 misc/virtenv/lib/python2.6/site-packages/tornado/auth.py
  28. +56 −38 misc/virtenv/lib/python2.6/site-packages/tornado/autoreload.py
  29. +265 −0 misc/virtenv/lib/python2.6/site-packages/tornado/concurrent.py
  30. +86 −46 misc/virtenv/lib/python2.6/site-packages/tornado/curl_httpclient.py
  31. +0 −238 misc/virtenv/lib/python2.6/site-packages/tornado/database.py
  32. +97 −68 misc/virtenv/lib/python2.6/site-packages/tornado/escape.py
  33. +210 −59 misc/virtenv/lib/python2.6/site-packages/tornado/gen.py
  34. +218 −163 misc/virtenv/lib/python2.6/site-packages/tornado/httpclient.py
  35. +158 −108 misc/virtenv/lib/python2.6/site-packages/tornado/httpserver.py
  36. +196 −70 misc/virtenv/lib/python2.6/site-packages/tornado/httputil.py
  37. +478 −326 misc/virtenv/lib/python2.6/site-packages/tornado/ioloop.py
  38. +432 −201 misc/virtenv/lib/python2.6/site-packages/tornado/iostream.py
  39. +125 −121 misc/virtenv/lib/python2.6/site-packages/tornado/locale.py
  40. +205 −0 misc/virtenv/lib/python2.6/site-packages/tornado/log.py
  41. +346 −230 misc/virtenv/lib/python2.6/site-packages/tornado/netutil.py
  42. +273 −215 misc/virtenv/lib/python2.6/site-packages/tornado/options.py
  43. +12 −1 misc/virtenv/lib/python2.6/site-packages/tornado/platform/auto.py
  44. +75 −0 misc/virtenv/lib/python2.6/site-packages/tornado/platform/caresresolver.py
  45. +7 −5 misc/virtenv/lib/python2.6/site-packages/tornado/platform/common.py
  46. +26 −0 misc/virtenv/lib/python2.6/site-packages/tornado/platform/epoll.py
  47. +6 −2 misc/virtenv/lib/python2.6/site-packages/tornado/platform/interface.py
  48. +92 −0 misc/virtenv/lib/python2.6/site-packages/tornado/platform/kqueue.py
  49. +5 −3 misc/virtenv/lib/python2.6/site-packages/tornado/platform/posix.py
  50. +76 −0 misc/virtenv/lib/python2.6/site-packages/tornado/platform/select.py
  51. +236 −23 misc/virtenv/lib/python2.6/site-packages/tornado/platform/twisted.py
  52. +1 −1 misc/virtenv/lib/python2.6/site-packages/tornado/platform/windows.py
  53. +151 −17 misc/virtenv/lib/python2.6/site-packages/tornado/process.py
  54. +189 −233 misc/virtenv/lib/python2.6/site-packages/tornado/simple_httpclient.py
  55. +229 −127 misc/virtenv/lib/python2.6/site-packages/tornado/stack_context.py
  56. +244 −0 misc/virtenv/lib/python2.6/site-packages/tornado/tcpserver.py
  57. +60 −57 misc/virtenv/lib/python2.6/site-packages/tornado/template.py
  58. +185 −24 misc/virtenv/lib/python2.6/site-packages/tornado/test/auth_test.py
  59. +330 −0 misc/virtenv/lib/python2.6/site-packages/tornado/test/concurrent_test.py
  60. +82 −8 misc/virtenv/lib/python2.6/site-packages/tornado/test/curl_httpclient_test.py
  61. +81 −63 misc/virtenv/lib/python2.6/site-packages/tornado/test/escape_test.py
  62. +566 −26 misc/virtenv/lib/python2.6/site-packages/tornado/test/gen_test.py
  63. +304 −24 misc/virtenv/lib/python2.6/site-packages/tornado/test/httpclient_test.py
  64. +375 −109 misc/virtenv/lib/python2.6/site-packages/tornado/test/httpserver_test.py
  65. +89 −56 misc/virtenv/lib/python2.6/site-packages/tornado/test/httputil_test.py
  66. +7 −21 misc/virtenv/lib/python2.6/site-packages/tornado/test/import_test.py
  67. +289 −9 misc/virtenv/lib/python2.6/site-packages/tornado/test/ioloop_test.py
  68. +201 −81 misc/virtenv/lib/python2.6/site-packages/tornado/test/iostream_test.py
  69. +23 −4 misc/virtenv/lib/python2.6/site-packages/tornado/test/locale_test.py
  70. +159 −0 misc/virtenv/lib/python2.6/site-packages/tornado/test/log_test.py
  71. +84 −0 misc/virtenv/lib/python2.6/site-packages/tornado/test/netutil_test.py
  72. +2 −0 misc/virtenv/lib/python2.6/site-packages/tornado/test/options_test.cfg
  73. +212 −110 misc/virtenv/lib/python2.6/site-packages/tornado/test/options_test.py
  74. +157 −83 misc/virtenv/lib/python2.6/site-packages/tornado/test/process_test.py
  75. +60 −2 misc/virtenv/lib/python2.6/site-packages/tornado/test/runtests.py
  76. +125 −88 misc/virtenv/lib/python2.6/site-packages/tornado/test/simple_httpclient_test.py
  77. +166 −14 misc/virtenv/lib/python2.6/site-packages/tornado/test/stack_context_test.py
  78. +1 −0 misc/virtenv/lib/python2.6/site-packages/tornado/test/static/dir/index.html
  79. +95 −73 misc/virtenv/lib/python2.6/site-packages/tornado/test/template_test.py
  80. +109 −8 misc/virtenv/lib/python2.6/site-packages/tornado/test/testing_test.py
  81. +98 −38 misc/virtenv/lib/python2.6/site-packages/tornado/test/twisted_test.py
  82. +19 −0 misc/virtenv/lib/python2.6/site-packages/tornado/test/util.py
  83. +143 −5 misc/virtenv/lib/python2.6/site-packages/tornado/test/util_test.py
  84. +862 −164 misc/virtenv/lib/python2.6/site-packages/tornado/test/web_test.py
  85. +87 −0 misc/virtenv/lib/python2.6/site-packages/tornado/test/websocket_test.py
  86. +27 −23 misc/virtenv/lib/python2.6/site-packages/tornado/test/wsgi_test.py
  87. +307 −137 misc/virtenv/lib/python2.6/site-packages/tornado/testing.py
  88. +198 −29 misc/virtenv/lib/python2.6/site-packages/tornado/util.py
  89. +856 −350 misc/virtenv/lib/python2.6/site-packages/tornado/web.py
  90. +277 −69 misc/virtenv/lib/python2.6/site-packages/tornado/websocket.py
  91. +51 −44 misc/virtenv/lib/python2.6/site-packages/tornado/wsgi.py
@@ -1,4 +1,4 @@
#!/bin/bash
# The logic to stop your application should be put in this script.
kill `ps -ef | grep hellotornado | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1
-exit 0
+exit 0
View
@@ -48,37 +48,24 @@ Activate your virtualenv and install the needed modules:
source misc/virtenv/bin/activate
pip install tornado
+pip install futures
pip install pycurl
}}}
-Now create your diy/hellotornado.py file:
+Now, assuming your app is in app.py, create your start file (diy/hellotornado.py):
{{{
#!/usr/bin/env python
import os
-
-here = os.path.dirname(os.path.abspath(__file__))
-os.environ['PYTHON_EGG_CACHE'] = os.path.join(here, '..', 'misc/virtenv/lib/python2.6/site-packages')
-virtualenv = os.path.join(here, '..', 'misc/virtenv/bin/activate_this.py')
+cwd = os.path.dirname(os.path.abspath(__file__))
+os.environ['PYTHON_EGG_CACHE'] = os.path.join(cwd, '..', 'misc/virtenv/lib/python2.6/site-packages')
+virtualenv = os.path.join(cwd, '..', 'misc/virtenv/bin/activate_this.py')
execfile(virtualenv, dict(__file__=virtualenv))
-import tornado.ioloop
-import tornado.web
-
-class MainHandler(tornado.web.RequestHandler):
- def get(self):
- self.write("Hello, world")
-
-application = tornado.web.Application([
- (r"/", MainHandler),
-])
-
-if __name__ == "__main__":
- address = os.environ['OPENSHIFT_DIY_IP']
- application.listen(8080, address=address)
- tornado.ioloop.IOLoop.instance().start()
+import app
+app.main(os.environ['OPENSHIFT_DIY_IP'])
}}}
View
@@ -0,0 +1,18 @@
+import tornado.ioloop
+import tornado.web
+
+class MainHandler(tornado.web.RequestHandler):
+ def get(self):
+ self.write("Hello, world")
+
+application = tornado.web.Application([
+ (r"/", MainHandler),
+])
+
+def main(address):
+ application.listen(8080, address)
+ tornado.ioloop.IOLoop.instance().start()
+
+if __name__ == "__main__":
+ address = "127.0.0.1"
+ main(address)
View
@@ -1,23 +1,9 @@
#!/usr/bin/env python
import os
-
-here = os.path.dirname(os.path.abspath(__file__))
-os.environ['PYTHON_EGG_CACHE'] = os.path.join(here, '..', 'misc/virtenv/lib/python2.6/site-packages')
-virtualenv = os.path.join(here, '..', 'misc/virtenv/bin/activate_this.py')
+cwd = os.path.dirname(os.path.abspath(__file__))
+os.environ['PYTHON_EGG_CACHE'] = os.path.join(cwd, '..', 'misc/virtenv/lib/python2.6/site-packages')
+virtualenv = os.path.join(cwd, '..', 'misc/virtenv/bin/activate_this.py')
execfile(virtualenv, dict(__file__=virtualenv))
-import tornado.ioloop
-import tornado.web
-
-class MainHandler(tornado.web.RequestHandler):
- def get(self):
- self.write("Hello, world")
-
-application = tornado.web.Application([
- (r"/", MainHandler),
-])
-
-if __name__ == "__main__":
- address = os.environ['OPENSHIFT_DIY_IP']
- application.listen(8080, address=address)
- tornado.ioloop.IOLoop.instance().start()
+import app
+app.main(os.environ['OPENSHIFT_DIY_IP'])
@@ -0,0 +1,3 @@
+from pkgutil import extend_path
+
+__path__ = extend_path(__path__, __name__)
@@ -0,0 +1,18 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Execute computations asynchronously using threads or processes."""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+from concurrent.futures._base import (FIRST_COMPLETED,
+ FIRST_EXCEPTION,
+ ALL_COMPLETED,
+ CancelledError,
+ TimeoutError,
+ Future,
+ Executor,
+ wait,
+ as_completed)
+from concurrent.futures.process import ProcessPoolExecutor
+from concurrent.futures.thread import ThreadPoolExecutor
Oops, something went wrong.

0 comments on commit dc49b9b

Please sign in to comment.