On Jan 11, 11:47 am, Bret Taylor <btay...@gmail.com> wrote:
> The folks at Brizzly (http://brizzly.com/) use Tornado, and they have
> contributed a number of patches, which I just integrated into the main
> branch of Tornado. You can see the full change here:http://github.com/facebook/tornado/commit/7014417608d03e7af2c7aba58ba...
>
> Among the changes:
>
> - KQueue support for Mac OS X and BSD
> - Support for named URLs and reverse URLs (more on that below)
> - Add a method to RequestHandler that can be used to detect when the
> connection has been closed by the client. Useful for long-lived connections
> so you know when to clean up resources. Just override on_connection_close in
> your request handler, which will be called when the connection is closed for
> any reason.
> - Some tweaks to IOLoop to make it easier to run unit tests with
> asynchronous code
> - Bug fixes to the WSGI code (which is used to run Django on Tornado and
This is great! Thank you and thanks to Brizzly. Since quite a few features have been added since 0.2 came out, when can we expect 0.3 to become official? What needs to be done before 0.3 is ready?
It's based on your change. I think the only thing I changed was to
make Application aware of URLSpecs instead of making URLSpecs pretend
to be tuples. The actual regex reversing code is yours - thanks for
the contribution.
-Ben
Great! I'm glad this change made it in so that I can avoid having a
fork that differs so much. I made URLSpecs look like tuples to for
better compatibility, but I didn't think too much about it.
I guess the biggest problem then is that the regex reversing isn't
very robust, as you may have noticed. It'll work fine for simple
things, but you can't nest parens or anything like that.
One thing I've been considering recently, is to drop the regex
completely and use an extended routes approach. So, instead of /(\d+)/
you might do /:digits/, or in the case of named groups /:digits<num>/
which would then just get converted to the appropriate regex at
instantiation time. But, I'm not sure if this adds anything or not...
No problem! Tornado is fun to play with, so I'm happy to
contribute--even without attribution :). I asked, not because I was
upset that I wasn't attributed, but more to see if my tree was still
compatible.
Thanks,
Andrew
Are there any chance you can look at the problem mentioned in this
thread?
http://groups.google.com/group/python-tornado/browse_thread/thread/276059a076593266
It looks like there is some number of users who experience the
problem. Essentially, the problem might be a show-stopper for those
who do experience it. Or it might get reduced to some simple exception-
handling changes. It could be an artifact of a particular platform
configuration. Is there any chance that somebody with enough knowledge
in that specific area can get involved?
Thanks,
Sergey
class MyTest(unittest.TestCase):
def testFoo(self):
server = HTTPServer(...)
server.listen(9999)
client = AsyncHTTPClient()
client.fetch("http://localhost:9999/foo", callback=self.handle_response)
IOLoop.instance().start()
def handle_response(self, response):
self.assertEquals(...)
IOLoop.instance().stop()
Most of our tests don't use the full http server/client machinery, but
we do have a few end-to-end tests like this.
-Ben
I was having issues running multiple end-to-end tests like that one due to socket left open.
http://groups.google.com/group/python-tornado/browse_thread/thread/867cfb2665ea10a9/6778dd6654c5acda
This is what I did. Did you need to do this? How do you run your tests? python-nose?
http://groups.google.com/group/python-tornado/msg/6778dd6654c5acda
-Elias
-Ben
I would like to find the tornado function which can get the client
IP , HTTP_USER_AGENT(browser type) and more information from client
side. So please give me some hints.
Thanks.
Steven
So, for example, if you want to get the User's browser information, you would use self.request.headers.get('User-Agent', None) (the none is the 'default' if User-Agent is not set, you should always be prepared for a header to not be set by a browser)
Hope that helps a little. If you're really new to Python, Django may be a good place to start, as some of the pieces of Tornado are 'Djangoic' and Django itself is a great intro to Python web programming and has great documentation and a great community. If the GFW doesn't block Django for its use of magic.
Steven
--
Человек, убегающий от ужасов нищеты, должен вовремя оста-
новиться, чтобы по инерции не попасть в кошмар богатства.
в Рядом с богатством нищета вдвойне тяжела.Хвала Аллаху, молитвы и да пребудет Его пророков и посланников
Исламистского повестке дня все, что вы можете думать о
Мы успешно завершили эту программу, в том числе различные функции, представляющие интерес для братьев-мусульман по всему миру
Они могут теперь услышать призыв на время молитвы и знания, особенно в не-мусульманин, который не снимается в ушах.
в Тот, кто хотел и не смог разбогатеть – должен подальше держать-
ся от состоятельных людей, чтобы не травмировать себя.Самые несчастные среди бедных те, у кого жадные богатые
родственники. Из-за них им не только не помогают другие, так
еще от них ждут помощи. Мало того, на них еще и распростра-
няются недоверие, зависть, злость, ненависть…
МЫ ОБЯЗАТЕЛЬНО ВАМ ОТВЕТИМ В БЛИЖАЙШЕЕ ВРЕМЯ .НЕ ПРИСЫЛАЙТЕ СПАММ ВАЖНЫЕ ПИСЬМА ОТМЕЧАЙТЕ ЗВЕЗДОЧКОЙ. С УВ СОЛОХИН АЛЕКСАНДР
СОЛОХИНА ТАТЬЯНА ДРУГИХ В ЭТОМ ПОЧТОВОМ ЯЩИКЕ НЕТ! ЭТО ЭЛЕКТРОННЫЙ ЯЩИК СЕМЬИ СОЛОХИНЫХ!