Commit Graph

18 Commits (bd65cf01fb0357cb5476025fa0c56c6b89441dd4)

Author SHA1 Message Date
Dustin 634c914f6d dispatch: routing: Remove Generator class 2015-04-25 13:54:42 -05:00
Dustin 86b19bb9e7 Whitespace cleanup 2015-04-15 19:45:17 -05:00
Dustin C. Hatch c69dbed7ee routing: Correctly redirect when path info is empty (fixes #7)
When the application path info is empty (e.g. the WSGI script is mounted
somewhere other than the root), appending a trailing slash and redirecting
causes the new location to be calculated incorrectly. This is because the part
of the request URL before the application path is not taken into account, so
the new path always ends up being a literal `/`. This commit changes the
behavior of the `redir` function that is returned by
`milla.dispatch.routing.Router.resolve` to calculate the new path info
correctly in the redirect response.
2015-02-19 19:58:03 -06:00
Dustin C. Hatch fed7d0fb3d Merge default into py3k
--HG--
branch : py3k
2012-12-19 15:38:36 -06:00
Dustin C. Hatch f5f7e76dae Added tests for Router's trailing slash handling options 2012-11-30 22:46:28 -06:00
Dustin C. Hatch f8e89d46c6 Merge default into py3k
--HG--
branch : py3k
2012-11-30 22:11:23 -06:00
Dustin C. Hatch c4e9397e8c Replace Request.relative_url with Request.create_url and friends 2012-11-30 22:02:28 -06:00
Dustin C. Hatch aba45a2107 Merge default into py3k
--HG--
branch : py3k
2012-11-27 19:12:59 -06:00
Dustin C. Hatch 4c06340cea Update URL Generator for compatibility with milla.Request and mark it deprecated 2012-11-03 19:04:26 -05:00
Dustin C. Hatch fa97bd7b03 py3k: Handle non-callable controllers in routes better
--HG--
branch : py3k
2012-11-03 11:26:01 -05:00
Dustin C. Hatch 6c034b88d3 py3k: Fix imports
--HG--
branch : py3k
2012-11-03 11:07:30 -05:00
Dustin C. Hatch 0ab44ed7ea router: Correctly generate application-relative URLs 2011-06-15 19:12:00 -05:00
Dustin C. Hatch 92ef80fd61 Copy more attributes from controller callables to partial wrappers 2011-04-15 21:04:24 -05:00
Dustin C. Hatch 92ba7c9387 Added special handling for mapped paths with trailing slashes 2011-04-10 19:19:57 -05:00
Dustin C. Hatch b11438b69c Alter URL generator to return URLs without host info by default 2011-04-07 23:25:38 -05:00
Dustin C. Hatch 0fba1c95b9 Added licensing information and boilerplate messages 2011-04-05 23:47:44 -05:00
Dustin C. Hatch ab4ca55620 Don't copy attributes that don't exist to partial instances
Classes don't have an `__name__` attribute, so when wrapping them in a `functools.partial` instance, don't try to copy it. Same goes for `__doc__`, but most objects should have that.
2011-03-27 14:52:17 -05:00
Dustin C. Hatch 6cf47a0339 Added a traversal dispatch method and cleaned up the router
* Created a dispatcher protocol for classes to implement for path resolution
* Implemented a traversal dispatcher
* Updated the router to implement the dispatcher protocol
* Added unit tests for both dispatchers
* Replaced the Controller class with an Application class
2011-03-26 23:35:31 -05:00