summaryrefslogtreecommitdiff
path: root/pecan
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Fix a routing bug for generic subcontrollers."Jenkins2014-10-142-1/+38
|\
| * Fix a routing bug for generic subcontrollers.Ryan Petrello2014-09-262-1/+38
| | | | | | | | | | Change-Id: I3764da98f19f02c1f28a29377c6d24238d869930 Fixes-bug: 1361728
* | Merge "Resolve a bug that mixes up argument order for generic functions."Jenkins2014-10-142-3/+96
|\ \
| * | Resolve a bug that mixes up argument order for generic functions.Ryan Petrello2014-09-282-3/+96
| |/ | | | | | | | | | | | | | | | | When context locals are disabled, the order of arguments passed explicitly to generic controller handlers is incorrect (and causes the user to interact with e.g., a Response object, when they're really getting a Request object). Fixes-bug: 1374683 Change-Id: I5922b0a441f1ebae032d5b0d64c9ee0f4cf018e0
* | Merge "Remove `assert` for flow control; it can be optimized away with ↵Jenkins2014-09-265-7/+10
|\ \ | |/ |/| | | `python -O`."
| * Remove `assert` for flow control; it can be optimized away with `python -O`.Ryan Petrello2014-09-255-7/+10
| | | | | | | | | | Change-Id: Iaa3b9e5d6234db0c2a68992c8ef17dd90de59e40 Fixes-bug: 1373538
* | For HTTP POSTs, map JSON request bodies to controller keyword arguments.Ryan Petrello2014-09-252-0/+107
|/ | | | | Fixes-bug: 1336943 Change-Id: I2e59e5d43d87a5279c41b155188ebe3281de0e11
* Merge "Improve argspec detection and leniency for wrapped controllers."Jenkins2014-09-256-7/+111
|\
| * Improve argspec detection and leniency for wrapped controllers.Ryan Petrello2014-09-246-7/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pecan makes abundant use of `inspect.getargspec`, but unless you're very meticulous in the decorators you wrap your controllers with, the original argspec is not persisted (and pecan functionality can break in various ways). When a controller is decorated in a way that breaks argspec, we should instead attempt to locate the *actual* argspec for the method (not the wrapped function) and use it. Additionally, when controllers are missing **kwargs in the method signature to map optional GET and POST arguments, we shouldn't consider that a non-routable offense (an HTTP 400); instead, we should just *not* pass extraneous arguments to the function. Change-Id: I47fe0496ff6aa105359ee8e5b99f6c80476cc2e9
* | Merge "When detecting non-content for HTTP 204, properly catch ↵Jenkins2014-09-242-3/+17
|\ \ | |/ |/| | | UnicodeDecodeError."
| * When detecting non-content for HTTP 204, properly catch UnicodeDecodeError.Ryan Petrello2014-09-232-3/+17
| | | | | | | | | | Fixes-bug: 1373003 Change-Id: I7761004c047976195a680bfb2ca23fe92516f3a6
* | When path arguments are incorrect for RestController, return HTTP 404, not 400.Ryan Petrello2014-09-242-10/+12
|/ | | | | | | | | When RestController encounters a mismatch between function signatures and positional URL chunks (e.g., /authors/books vs /authors/1/books), it shouldn't raise an HTTP 400; the issue is a nonexistant URL path, not the structure of the request/body itself. Change-Id: I6637f88b7da4f09497f905ebafa7bf1e3788151a
* Fix a bug in generic function handling when context locals are disabled.Ryan Petrello2014-09-222-6/+59
| | | | | | Fixes bug 1364113 Change-Id: I192c75b73ae95338dc2f1ea019e83a42fb8da87b
* Merge "Configure the root logger properly"Jenkins2014-08-272-2/+2
|\
| * Configure the root logger properlyStanislaw Pitucha2014-08-272-2/+2
| | | | | | | | | | | | | | | | The documentation and project template showed logging configuration which sets level INFO for module called 'root' rather than the root logger. Configure the root (default) logger instead. Change-Id: I172d06dc6b81a31c5b698e43be50ab6302d54984
* | Merge "Refactor 204 handling."Jenkins2014-08-271-14/+20
|\ \
| * | Refactor 204 handling.Ryan Petrello2014-07-281-14/+20
| | | | | | | | | | | | | | | | | | | | | Place the HTTP 204 handling in a `finally` at the bottom of the WSGI __call__ to ensure we catch *all* changes to `state.response`. Change-Id: Id150205f295a3c0ca9c73ad897a41d4790476811
* | | Catch an edge case in RestController routing and properly return an HTTP 400.Ryan Petrello2014-08-252-15/+136
| |/ |/| | | | | Change-Id: I0e57cf719a2c3372ebc61efe71a832b0482a0a3e
* | Fix an infinite recursion error in PecanHook application.Ryan Petrello2014-08-152-1/+50
| | | | | | | | | | | | | | | | | | | | Subclassing both `rest.RestController` and `hooks.HookController` results in an infinite recursion error in hook application (which prevents your application from starting). Fixes bug 1357540 Change-Id: I6e26c6d8771b4b35943bfb85bf41e73d0982e74c
* | Provide `pecan.state.arguments` for inspecting controller call argumentsRyan Petrello2014-07-282-13/+384
|/ | | | Change-Id: Ibbd8b2f075a875b109c7309bc42e0d1f1d5ae610
* Don't (mistakenly) set HTTP 204 on controllers which set `response.body_file`.Ryan Petrello2014-07-092-2/+105
| | | | | | Fixes bug 1339121 Change-Id: I70785315837b3907b63bb10565f3ccdf07559e8d
* Merge "Be gracious in deprecation of method signatures related to ↵Jenkins2014-06-262-9/+57
|\ | | | | | | threadlocal removal."
| * Be gracious in deprecation of method signatures related to threadlocal removal.Ryan Petrello2014-06-252-9/+57
| | | | | | | | | | | | | | | | | | | | Certain OpenStack projects that use pecan have overridden private methods of `pecan.rest.RestController` for custom behavior, and these method signatures are changing in the next release of pecan to support optional threadlocals. As good citizens, let's give these projects a deprecation period to get their implementations back in sync with upstream pecan. Change-Id: I02823c7fb79488aea0dd8ad3266aa7f0024bc4a0
* | For an HTTP 405 on generic methods, attempt to specify an Allow header.Ryan Petrello2014-06-263-1/+32
|/ | | | Change-Id: I726d698fc014c21cc1e43a09a129384fa1f1235f
* Merge "Serialize WebOb errors as JSON if the client requests it via an ↵Jenkins2014-06-252-3/+55
|\ | | | | | | Accept header."
| * Serialize WebOb errors as JSON if the client requests it via an Accept header.Ryan Petrello2014-06-252-3/+55
| | | | | | | | | | Change-Id: I32040eff4259daf7a0e58b81ce861758d1d14bd9 Fixes bug 1324134
* | Merge "Add support for specifying custom request and response implementations."Jenkins2014-06-253-14/+65
|\ \ | |/ |/|
| * Add support for specifying custom request and response implementations.Ryan Petrello2014-06-253-14/+65
| | | | | | | | | | | | | | | | I noticed that people using pecan have taken to writing custom webob req/resp subclasses and monkeypatching onto `pecan.request` and `pecan.response`. Let's give them what they need to do this properly. Change-Id: If0ac953e381cec3a744388000a3b3afc0ea2525c
* | Merge "Added inheritance for hooks from parent classes"Jenkins2014-06-252-2/+83
|\ \
| * | Added inheritance for hooks from parent classesTihomir Trifonov2014-06-172-2/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | also added hook inheritance from mixins, and adding hooks to child controllers, added as sub-controllers. Fixes bug 1330673 Change-Id: I709cece7bcce26943b254b15dc8ddac5613b1202
* | | Fix a bug that broke `default_renderer = json`.Ryan Petrello2014-06-252-1/+16
| |/ |/| | | | | | | Change-Id: Ie57feadb6efe664c1bc3c39debcb21c3355f210c Fixes bug 1332501
* | Add support for Pecan *without* thread local request/response objectsRyan Petrello2014-05-286-124/+1589
|/ | | | Change-Id: I5a5a05e1f57ef2d8ad64e925c7ffa6907b914273
* Allow controllers to return an explicit `webob.Response` object.Ryan Petrello2014-05-192-0/+20
| | | | Change-Id: I5e827eed73962a0a6f5d879224759a4d13888751
* Merge "Fix a broken scaffold test."Jenkins2014-04-241-1/+1
|\
| * Fix a broken scaffold test.Ryan Petrello2014-04-241-1/+1
| | | | | | | | | | | | Related to bug 1311629 Change-Id: Ic442457c501d598814f492e7aab4d885bdcf0711
* | Do not include Content-Type on 204 and 304 status codesJulien Danjou2014-04-242-3/+6
|/ | | | Change-Id: Iec7e5e0a7d5f10bf264a2e8e0a01cdaf2d73fd86
* Work around another obscure RestController edge case that should raise a 404.Ryan Petrello2014-04-232-0/+49
| | | | | | Fixes bug 1311147 Change-Id: I3dd0986c458902b03ed140872fc1938b06e75f4b
* Merge "If an exposed method returns nothing, reply with an HTTP 204."Jenkins2014-04-232-3/+5
|\
| * If an exposed method returns nothing, reply with an HTTP 204.Ryan Petrello2014-04-232-3/+5
| | | | | | | | | | Fixes-bug: 1311629 Change-Id: I06259adc76631d88777d1747c09dae3a67692a39
* | Merge "color logging support"Jenkins2014-04-014-3/+114
|\ \
| * | color logging supportAlfredo Deza2014-04-014-3/+114
| | | | | | | | | | | | Change-Id: Ic88b41e4032d6c97e020485341d375c196a1a1c0
* | | Revert "Fix a Py3 compatability issue with WebTest > 1.3.1 < 2.0"Ryan Petrello2014-03-271-1/+1
|/ / | | | | | | | | | | | | | | | | | | This reverts commit 9ce0a79866fc4aee0b0988b5b75ce2432c97d0ee. This was originally an attempted workaround for: https://github.com/Pylons/webtest/commit/38137ee4b4afb300ab1a8bbf13f66e1a8238b1b8#diff-f8658b710075968677d52c7d013ec098R240 but is an inappropriate fix (that causes a bug of its own). Change-Id: I3f957a0fff1985596974f51fa154f5de652dc7c5
* | pep8 fixesRyan Petrello2014-03-273-6/+6
| | | | | | | | Change-Id: If592949bb1dedfc3674d939d5244f5efd4a02eb3
* | Merge "Pass arbitrary keyword args to load_test_app"Jenkins2014-03-252-4/+4
|\ \
| * | Pass arbitrary keyword args to load_test_appJim Rollenhagen2014-03-182-4/+4
| |/ | | | | | | | | | | | | | | | | Applications can be written with arbitrary keyword arguments in `setup_app`. The test app builder should support this by allowing arbitrary keyword args to be passed to `load_test_app`, and pass those along to `load_app`. Change-Id: Icb3d5c39d0bf147c1e58732be3199a30a7539f6f
* | Merge "Remove the logo tagline."Jenkins2014-03-251-0/+0
|\ \
| * | Remove the logo tagline.Ryan Petrello2014-03-251-0/+0
| |/ | | | | | | Change-Id: I05e9343236be0c3a59a8b6f0ed40de462bd34a78
* | Merge "Close the fieldset tag for scaffold index"Jenkins2014-03-201-1/+1
|\ \
| * | Close the fieldset tag for scaffold indexChad Lung2014-03-091-1/+1
| |/ | | | | | | Change-Id: I480cb2569277ce5ee2dbf63cae557e39f74583e1
* | Delay the `threading.local` import to allow for eventlet/gevent monkeypatching.Ryan Petrello2014-03-191-3/+11
|/ | | | | | Fixes bug 1294177 Change-Id: I51482148602d85e40230547d0e19cf0c2a0c6d8a