harlo/UnveillanceViewer — pull request #9 by newgiin (2014-04-01 21:44:56+00:00)
Title: Fixed URL routing. Use urlparse to parse query string. Remove unused rou...

...te fields from handlers.

Removed self.route from RequestHandlers as they weren't doing anything, the routes are automatically passed as parameters into the get() method based in the order they're captured in the regex (http://stackoverflow.com/a/10726702/873472).

Fixed potential bug in the URL routing configuration. At line 474 in original index.py, it was actually just checking if the first letter wasn't contained in \[^...\] (i.e.not 'w', 'e', 'b', '/', etc.), not if the value was not the entire word as intended. So if in the future we created a route containing an 's', e.g.
(r"/([^s_word/web/|login/|...][a-zA-Z0-9/]*/$)?", RouteHandler, dict(route=None)),
it would stop /submissions/ from going to RouteHandler.

I just moved RouteHandler to the end as a catch-all since tornado tries to match the URL's
in order:
(http://www.tornadoweb.org/en/stable/web.html#application-configuration)
"The constructor for this class takes in a list of URLSpec objects or (regexp, request_class) tuples. When we receive requests, we iterate over the list in order and instantiate an instance of the first request class whose regexp matches the request path."