-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates to tornado 3.1 , also separates hellotornado.py from app.py
- Loading branch information
Showing
91 changed files
with
13,205 additions
and
4,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,4 @@ | |||
#!/bin/bash | #!/bin/bash | ||
# The logic to stop your application should be put in this script. | # 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 | kill `ps -ef | grep hellotornado | grep -v grep | awk '{ print $2 }'` > /dev/null 2>&1 | ||
exit 0 | exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,23 +1,9 @@ | |||
#!/usr/bin/env python | #!/usr/bin/env python | ||
import os | import os | ||
|
cwd = os.path.dirname(os.path.abspath(__file__)) | ||
here = os.path.dirname(os.path.abspath(__file__)) | os.environ['PYTHON_EGG_CACHE'] = os.path.join(cwd, '..', 'misc/virtenv/lib/python2.6/site-packages') | ||
os.environ['PYTHON_EGG_CACHE'] = os.path.join(here, '..', 'misc/virtenv/lib/python2.6/site-packages') | virtualenv = os.path.join(cwd, '..', 'misc/virtenv/bin/activate_this.py') | ||
virtualenv = os.path.join(here, '..', 'misc/virtenv/bin/activate_this.py') | |||
execfile(virtualenv, dict(__file__=virtualenv)) | execfile(virtualenv, dict(__file__=virtualenv)) | ||
|
|
||
import tornado.ioloop | import app | ||
import tornado.web | app.main(os.environ['OPENSHIFT_DIY_IP']) | ||
|
|||
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() |
3 changes: 3 additions & 0 deletions
3
misc/virtenv/lib/python2.6/site-packages/concurrent/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
from pkgutil import extend_path | |||
|
|||
__path__ = extend_path(__path__, __name__) |
18 changes: 18 additions & 0 deletions
18
misc/virtenv/lib/python2.6/site-packages/concurrent/futures/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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.