summaryrefslogtreecommitdiff
path: root/pyramid
AgeCommit message (Collapse)Author
2015-02-22Merge pull request #1563 from Pylons/fix.idempotent-render-to-responseMichael Merickel
update render_to_response to prevent renderers from mutating request.response
2015-02-19Fix asset override with packageMarc Abramowitz
`AssetsConfiguratorMixin.override_asset` does: ```python __import__(override_package) to_package = sys.modules[override_package] override_source = PackageAssetSource(to_package, override_prefix) ``` so it's assuming that the `package` argument to `PackageAssetSource.__init__` takes a module object. But then `PackageAssetSource` had a bunch of methods that did stuff like: - `pkg_resources.resource_exists(self.package, path)` - `pkg_resources.resource_filename(self.package, path)` - `pkg_resources.resource_stream(self.package, path)` and all these `pkg_resources` functions need their `package_or_requirement` argument to be a **string**; not a module - see https://pythonhosted.org/setuptools/pkg_resources.html#basic-resource-access, which says: > the `package_or_requirement argument` may be either a Python package/module > name (e.g. `foo.bar`) or a `Requirement` instance. This causes errors when overriding assets -- e.g.: I am using Kotti and Kotti has this code (https://github.com/Kotti/Kotti/blob/master/kotti/__init__.py#L251): ```python for override in [a.strip() for a in settings['kotti.asset_overrides'].split() if a.strip()]: config.override_asset(to_override='kotti', override_with=override) ``` A Kotti add-on called kotti_navigation does this (https://github.com/Kotti/kotti_navigation/blob/master/kotti_navigation/__init__.py#L12): ```python settings['kotti.asset_overrides'] += ' kotti_navigation:kotti-overrides/' ``` The above code is all legit as far as I can tell and it works fine in pyramid 1.5.2, but it fails with pyramid master with the following: ```pytb File "/Users/marca/python/virtualenvs/kotti_inventorysvc/lib/python2.7/site-packages/pkg_resources.py", line 959, in resource_filename self, resource_name File "/Users/marca/dev/git-repos/pyramid/pyramid/config/assets.py", line 31, in get_resource_filename filename = overrides.get_filename(resource_name) File "/Users/marca/dev/git-repos/pyramid/pyramid/config/assets.py", line 125, in get_filename result = source.get_filename(path) File "/Users/marca/dev/git-repos/pyramid/pyramid/config/assets.py", line 224, in get_filename if pkg_resources.resource_exists(self.package, path): File "/Users/marca/python/virtualenvs/kotti_inventorysvc/lib/python2.7/site-packages/pkg_resources.py", line 948, in resource_exists return get_provider(package_or_requirement).has_resource(resource_name) File "/Users/marca/python/virtualenvs/kotti_inventorysvc/lib/python2.7/site-packages/pkg_resources.py", line 225, in get_provider __import__(moduleOrReq) TypeError: __import__() argument 1 must be string, not module ``` This was a little tricky to resolve because the `override_asset` function wants to pass a module object to `PackageAssetSource.__init__`, but there are a number of tests in `pyramid/tests/test_config/test_assets.py` that assume that it takes a string. So I ended up making it legal to pass either one, so that I don't have to change as much calling code. See https://github.com/Kotti/kotti_navigation/issues/13
2015-02-19Enhance test_assets to expose #1580Marc Abramowitz
This enhances existing tests so that they detect the issue in #1580. Then I'm going to fix the issue in PR #1587. See #1580
2015-02-17pserve -b will always open 127.0.0.1Michael Merickel
2015-02-17appease coverageChris McDonough
2015-02-17dammit, forgot to revert importMichael Merickel
2015-02-17add functest for config reentrancyChris McDonough
2015-02-17expose public config phases in pyramid.configMichael Merickel
2015-02-17fix merge conflictsChris McDonough
2015-02-17use super with mixins... for reasonsMichael Merickel
2015-02-17remove the token from the ICacheBuster apiMichael Merickel
This exposes the QueryStringCacheBuster and PathSegmentCacheBuster public APIs alongside the md5-variants. These should be more cleanly subclassed by people wishing to extend their implementations.
2015-02-16docstring on apply_propertiesMichael Merickel
2015-02-16add InstancePropertyHelper and apply_request_extensionsMichael Merickel
2015-02-13Merge pull request #1578 from davisagli/fix.docsMichael Merickel
Fix a couple minor documentation issues
2015-02-12remove obsolete note about raise_keyboard_interrupt that's left over from pasteDavid Glick
2015-02-12Add workaround to make sure echo is enabled after reload (refs #689)David Glick
Also add myself to CONTRIBUTORS.txt
2015-02-10Default to an empty string instead of NoneDonald Stufft
2015-02-10Prevent timing attacks when checking CSRF tokenDonald Stufft
2015-02-07Merge pull request #1498 from sontek/allow_class_method_directlyMichael Merickel
Alert the user if they are using an unbound class methods to `add_view`
2015-02-07Fix py32 supportJohn Anderson
2015-02-07Remove `native_` import, not used anymoreJohn Anderson
2015-02-07Raise error at configuration timeJohn Anderson
2015-02-07Merge branch 'master' of https://github.com/Pylons/pyramid into ↵John Anderson
allow_class_method_directly Conflicts: pyramid/compat.py
2015-02-07Merge branch 'master' of https://github.com/Pylons/pyramid into ↵John Anderson
catch_bad_request_method_name
2015-02-07Merge pull request #1566 from bertjwregeer/feature/pcreate-helpMichael Merickel
When running pcreate without scaffold, list scaffolds
2015-02-07Add test for no scaffold no project nameBert JW Regeer
This test at least makes sure that if there is no scaffold and no project name that the command exists with error 2
2015-02-07Use hammer to fix holeBert JW Regeer
2015-02-07move the IResponseFactory into the public apiMichael Merickel
2015-02-07Fix failing testBert JW Regeer
2015-02-07Show help if missing argumentsBert JW Regeer
This will print the full help, followed by the available scaffolds if the user just calls pcreate without any arguments/flags at all.
2015-02-07Update usage line to show required -sBert JW Regeer
2015-02-07When running pcreate without scaffold, list scaffoldsBert JW Regeer
This fixes #1297
2015-02-06add a respones arg to render_to_responseMichael Merickel
2015-02-06Add NO COVER pragmasJeff Dairiki
2015-02-06Prevent DeprecationWarning from setuptools>=11.3Jeff Dairiki
2015-02-06moar docsMichael Merickel
2015-02-06Revert "moar docs"Michael Merickel
This reverts commit db6280393d6f87f391b3c12a23c65fe803556286.
2015-02-06moar docsMichael Merickel
2015-02-06update changelog and docsMichael Merickel
2015-02-06update render_to_response to prevent renderers from mutating request.responseMichael Merickel
fixes #1536
2015-02-06Merge branch 'master' into feature.re-entrant-configMichael Merickel
2015-02-06Merge pull request #1561 from Pylons/fix.jsonp-without-requestMichael Merickel
fix #1535 by avoiding the request if it's None
2015-02-06fix #1535 by avoiding the request if it's NoneMichael Merickel
2015-02-06Merge pull request #1487 from bertjwregeer/documentation/acceptMichael Merickel
Documentation/accept
2015-02-05Remove all signs of predicateBert JW Regeer
While this is somewhat a predicate, it really isn't for all intents and purposes because it is treated special. Make sure we document it that way.
2015-02-06fix typoMichael Merickel
2015-02-05Update add_route accept to non-predicateBert JW Regeer
2015-02-05Move documentation for accept to non-predicateBert JW Regeer
While accept is partially documented as a predicate, it is actually NOT a predicate in that the view machinery has all kinds of special cases for it. This also means that `not_` will not function on it correctly since it is not actually a predicate.
2015-02-05fix coverageMichael Merickel
2015-02-05Merge pull request #1547 from msabramo/tighten_test_call_eventsendsMichael Merickel
Tighten test_call_eventsends