Re: default permission overriding

2011-02-24 Thread Michael Merickel
For the record, I mentioned that constant in the interfaces.py the other day and Chris didn't realize it was there... it's also undocumented. He went so far as to suggest removing it. If there's going to be a constant anywhere, I'd imagine it should be in pyramid.security. Michael On Tue, Feb

Re: computing url for view registered by name

2011-03-01 Thread Michael Merickel
I noticed in your example you aren't specifying a context= or for_= in the view_config, implying you maybe intended to use route_name instead of name with url dispatch. If you are using traversal your application basically assumes a resource tree, and so to get the url you provide a resource

Re: computing url for view registered by name

2011-03-05 Thread Michael Merickel
, 'history'). request.root is the root context, thus the context used for views hanging off of /. Michael On Fri, Mar 4, 2011 at 12:56 PM, Chris Withers ch...@simplistix.co.ukwrote: On 02/03/2011 00:48, Michael Merickel wrote: I noticed in your example you aren't specifying a context= or for_

Re: Setting cookies in Pyramid for @action()s or HTTPFound redirects?

2011-03-12 Thread Michael Merickel
Going through the trouble of creating a webob response is much more complicated than simply adding a response_callback. def _set_cookie(request, response): response.set_cookie() request.add_response_callback(_set_cookie) Michael -- You received this message because you are

Re: Help with creating view functions

2011-03-12 Thread Michael Merickel
What is the exact error? I noticed you're using @view_config on the blog_view that isn't working, with only a renderer argument. This makes me think that you might believe that code will do the same as render_to_response(..) in your pages_view. In fact, @view_config is a different way of doing

Re: What's the best way to optimize database connections in Pyramid?

2011-03-13 Thread Michael Merickel
I've been a fan of tacking the connection onto the request object using @reify, thus if your request never calls request.db it doesn't have any db overhead. Thanks to reify, it reuses the same connection throughout that request. If you want to ensure that the connection is closed at the end of

Re: Terminology Change - Template to Skeleton

2011-03-22 Thread Michael Merickel
I'd imagine we can update Paste to support an alias for templates? paster create --list-scaffolding paster create --scaffold pyramid_starter paster create -s pyramid_routesalchemy Maybe the actual templates commands could even be hidden from the help and simply supported if ran with a

Re: [Paste] [WebError] where are the docs/source and who's maintaining now?

2011-04-12 Thread Michael Merickel
WebError's codebase was moved to the Pylons Project's github account. https://github.com/Pylons/weberror AFAIK Ben is still the active maintainer. Michael On Tue, Apr 12, 2011 at 4:10 AM, Chris Withers ch...@simplistix.co.ukwrote: Hi All, Is https://bitbucket.org/bbangert/weberror

Re: Pyramid authentication options

2011-05-30 Thread Michael Merickel
The velruse.yaml config, minus the private keys (which is why it's not source controlled) looks like this: Probably obvious, but you might want to go ahead and version control an example yaml file with placeholders for the keys. -- Michael -- You received this message because you are

Improving URL Dispatch

2011-07-18 Thread Michael Merickel
Hey people, I've been looking into ways to resolve some of the most common complaints with URL Dispatch. The few that I have seen more than once in the past are: 1) I have a lot of placeholders in this URL, generating it is a pain and I'd like to supply some defaults so that when using route_url

Re: JSON-RPC support

2011-09-05 Thread Michael Merickel
Just as a followup, I thought I'd mention that we released pyramid_rpc 0.3 last week which revamped the API completely. When using add_jsonrpc_endpoint you can specify a factory which will be used for security. That factory can then set the ``__acl__`` based on the ``request.rpc_method`` property,

Re: Instance level authorization in Pyramid

2011-09-05 Thread Michael Merickel
Brian, I just want to clarify some points from your original email. Specifying the ``factory`` on the route is telling the traversal system how to get the root of your resource tree for that specific route. Thus in your example you might do: def PageFactory(request): pagename =

Re: Instance level authorization in Pyramid

2011-09-05 Thread Michael Merickel
It's not incorrect, I just merged two thoughts which probably made it unclear. If he doesn't specify a ``traverse`` parameter then traversal will not happen, which will use a similar RootFactory to what I showed except that he might want to raise a HTTPNotFound if the ``page`` is None. The rest of

Re: Invoking a class method using json rpc

2011-09-05 Thread Michael Merickel
The JSONRpcViewMapper was never supported for classes. However in pyramid_rpc 0.3 which was released last week it ships with a default view mapper that works well with classes, as well as a whole new API for defining the views that allows other things such as permissions. -- Michael -- You

Re: How to run the paste server process as a daemon?

2011-10-24 Thread Michael Merickel
If you're using paster in production, it's usually smart to launch it via supervisor so that it can restart the app if it crashes and generally provide a better way to monitor the process. An example of doing this is in the cookbook.

Re: Implementing custom Mako template lookup

2011-11-01 Thread Michael Merickel
You can add or override a renderer via the config.add_renderer() directive here: http://docs.pylonsproject.org/projects/pyramid/1.2/narr/renderers.html#adding-and-changing-renderers Renderers have access to the request object so accessing the current language shouldn't be an issue. -- Michael

Re: pyramidtut

2011-11-16 Thread Michael Merickel
I'm unaware of another situation where this error shows up other than using Python 2.5. I'd ensure that you are in fact on 2.7 before chasing other solutions. If easy_install is pulling down the 2.5 egg then it means you're on 2.5. On Wed, Nov 16, 2011 at 9:00 AM, czam grossep...@googlemail.com

Re: howto access session from jinja2

2011-11-30 Thread Michael Merickel
Sorry, is this a question about jinja2? If so there's another mailing list for that. If you are asking about pyramid_jinja2, for use in conjunction with pyramid then the request is already exposed in the template, so you can simply do request.session['mykey'] to deal with the session. On Wed,

Re: howto access session from jinja2

2011-11-30 Thread Michael Merickel
to for pyramid_jinja2 is: http://docs.pylonsproject.org/projects/pyramid_jinja2/en/latest/index.html# Thanks Evan On 2011-12-1, at 上午3:35, Michael Merickel wrote: Sorry, is this a question about jinja2? If so there's another mailing list for that. If you are asking about pyramid_jinja2

Re: Closing SQLAlchemy session in SQLAlchemy + URL Dispatch Wiki Tutorial

2012-01-20 Thread Michael Merickel
First of all, this should be posted to pylons-discuss, not pylons-dev. The tutorial is configured to use the pyramid_tm package which is a transaction manager that effectively wraps the request in a transaction and will call session.close() on any sessions that were configured with

Re: Authentication - How to adapt to Single Sign On Environment (siteminder)

2012-02-07 Thread Michael Merickel
This would be done in unauthenticated_userid of a custom authentication policy. You just need to follow the interface described here: http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/security.html#creating-your-own-authentication-policy On a side note, your apache plugin should

Re: Documentation Suggestions for Subscribers or Debug

2012-05-15 Thread Michael Merickel
What? Pyramid doesn't have a debug code path, minus emitting some log messages. Do you mean that the debugtoolbar is doing something to the response? On Tue, May 15, 2012 at 5:57 PM, Jonathan Vanasco jonat...@findmeon.com wrote: I ran into an issue a few months ago regarding a NewResponse

Re: Documentation Suggestions for Subscribers or Debug

2012-05-15 Thread Michael Merickel
I'll need to see an example. I can't think of anything except an exception view that can replace the response object. Even the toolbar only mutates the body of the response. On Tue, May 15, 2012 at 9:43 PM, Jonathan Vanasco jonat...@findmeon.com wrote: On May 15, 7:33 pm, Michael Merickel

Re: Suggestion for Request namespace provisioning

2012-10-30 Thread Michael Merickel
On Tue, Oct 30, 2012 at 3:34 PM, Jonathan Vanasco jonat...@findmeon.com wrote: That pattern / functionality is great. I'm just talking about proactively saying this name space is reserved for plugins, this namespace for projects - you can rest assured that as Pyramid grows and new

Re: how are the pyramid docs managed ?

2013-02-08 Thread Michael Merickel
support to RTD, knock yourself out! On Fri, Feb 8, 2013 at 11:52 AM, Tshepang Lekhonkhobe tshep...@gmail.comwrote: On Fri, Feb 8, 2013 at 7:29 PM, Michael Merickel mmeri...@gmail.com wrote: The URL format is /major.minor-branch, with 1.4 as /latest the latest stable, and /master as master

Re: question about design decision on pyramid's core

2013-03-27 Thread Michael Merickel
None of those are public APIs so it probably just wasn't a big concern. Pyramid's source in general is entirely flat aside from the config subpackage. Scaffolds and scripts are things you would never import in your own code. On Wed, Mar 27, 2013 at 12:44 PM, Jonathan Vanasco

Re: Simple request history

2013-06-24 Thread Michael Merickel
I think that if you use a NewResponse subscriber instead of NewRequest that will be good enough to get what you want. pyramid_beaker commits the session changes in the response callbacks which happen immediately after the NewResponse event. So you're probably running into some ordering issue

Re: Newbie moving from Webapp2 to Pylons/Pyramids quick questions

2013-07-25 Thread Michael Merickel
Well pyramid scales down very easily. If you just ignore the stuff you don't need you will get very far in using it as a minimalist framework. Pyramid at its lowest levels simply dictates the use of webob's request/response objects and a particular routing mechanism to get urls to code (url

Re: (Help!) small bugs everywhere with polymorphic class-based views

2013-08-04 Thread Michael Merickel
Huh? Where do you describe the error you're seeing??? You should probably be calling __init__ on your parent via super or explicitly but it's not actually a bug since you duplicated the code in both __init__s. On Sun, Aug 4, 2013 at 1:01 AM, John Cadigan johnpaulcadi...@gmail.comwrote: I'm

Re: some tests fail for pyramid_handlers 0.5

2013-08-05 Thread Michael Merickel
actually https://github.com/Pylons/pyramid_handlers/issues On Mon, Aug 5, 2013 at 7:19 PM, Steve Piercy steve.piercy@gmail.comwrote: On 8/5/13 at 11:57 PM, h...@urpla.net (Hans-Peter Jansen) pronounced: Dear Chris, don't know your favorite way to be informed about such issues:

Re: [pylons-devel] Should pyramid.request.Request.route_path() work for external routes?

2013-10-06 Thread Michael Merickel
The discussion on raising an exception has was done in https://github.com/Pylons/pyramid/issues/611 and its subsequent pull requests https://github.com/Pylons/pyramid/pull/1101 and https://github.com/Pylons/pyramid/pull/1103. The issue had to do with the contract defined by route_path, in that

Re: [pylons-devel] Probelms with wairtress in Python 2.7.7

2014-06-05 Thread Michael Merickel
On Thu, Jun 5, 2014 at 11:40 AM, Chris McDonough chr...@plope.com wrote: On 06/05/2014 11:49 AM, Bert JW Regeer wrote: https://github.com/Pylons/webob/pull/150 Is an outstanding pull request to fix this in from_file() in WebOb, would this solve the problem? Probably not. More like here:

Re: [pylons-devel] Bugs in SessionAuthenticationPolicy

2014-08-06 Thread Michael Merickel
It sounds like you are not using the `pyramid.security.remember(request, userid)` API to store the user in the session. If you would like to store the userid directly you may but you are circumventing the pyramid authentication APIs. As far as the authenticated_userid, this will invoke your

Re: [pylons-devel] static_url usage

2014-08-16 Thread Michael Merickel
You'll want to avoid changing the path in your usage of static_url. Fortunately, Pyramid supports overriding static assets, so you can make a dummy path and override that with your dev or production real asset path. config.add_static_view('images', 'p_started:webapp/images')

Re: [pylons-devel] Re: pcreate: Uppercase version of the package name?

2014-11-25 Thread Michael Merickel
AFAIK all of the things you are asking for are possible using the (documented) scaffolding API. You basically just subclass ``PyramidTemplate`` and override ``pre`` to mutate the ``vars`` and add what you like. http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/scaffolding.html

Re: [pylons-devel] Adding custom files to be watched by pserve --reload

2014-12-09 Thread Michael Merickel
pyramid.scripts.pserve.watch_file and pyramid.scripts.pserve.add_file_callback exist for this purpose. Unfortunately it doesn't look like they are in the docs atm but I think you can expect them to stick around. See

Re: [pylons-devel] debugtoolbar - panel/toolbar API-- feedback wanted.

2014-12-16 Thread Michael Merickel
I started to lay the groundwork for this in https://github.com/Pylons/pyramid_debugtoolbar/pull/182 by making the panel name a unique identifier that can be used in more places. This work probably needs to be completed but I did it on that panel activation branch which has some real problems

Re: [pylons-devel] Paste #urlmap and console scripts don't seem to be working correctly.

2015-07-22 Thread Michael Merickel
Pyramid has no way to know which pyramid app you are referring to in bootstrap unless you specify the section. As pyramid at a fundamental level supports running multiple apps in the same process you have to handle this yourself outside if you need to load a specific app for your script to run.

Re: [pylons-devel] Paste #urlmap and console scripts don't seem to be working correctly.

2015-07-22 Thread Michael Merickel
to a dictionary {(domain, path): loader, ...} and we all know and love the unordered natured of Python dicts. -C On Wednesday, July 22, 2015 at 4:53:40 PM UTC-4, Michael Merickel wrote: Pyramid has no way to know which pyramid app you are referring to in bootstrap unless you specify

Re: [pylons-devel] Knob for ACLAuthorizationPolicy?

2015-07-17 Thread Michael Merickel
It seems to me that allowing this to be modified is fairly harmless. Would you expect it to fallback to __acl__ if it doesn't find the custom method/attribute? Or would you expect it to be changed wholesale? The issue in changing it wholesale and still calling it the ACLAuthorizationPolicy is that

Re: [pylons-devel] Re: wsgi server of choice?

2015-10-20 Thread Michael Merickel
On Tue, Oct 20, 2015 at 12:29 PM, Chris Withers wrote: > What does pserve use? pserve is a generic runner. It uses whatever server is pointed to in the [server:main] section by default. This is taken care of by PasteDeploy as part of loading the ini file. - Michael --

Re: [pylons-devel] including debugtoolbar support in plugins

2015-12-08 Thread Michael Merickel
I already added the initial hook for this via debugtoolbar.includes. In theory you could add extra panel packages that defined an includeme(config) and they can do whatever they want. development.ini --- debugtoolbar.includes = myapp.debug.custom_panel myapp/debug/custom_panel.py --- def

[pylons-devel] github pages for pylons project sites

2016-01-02 Thread Michael Merickel
Hey everyone, I'm starting the discussion (which I hope is very quick) about what to do with our public websites. Right now we have: - docs.pylonsproject.org (docs, hosted on rtd) - docs.pylonsproject.org/projects (hosted on rtd) - www.pylonsproject.org (ppo, hosted somewhere controlled by

Re: [pylons-devel] github pages for pylons project sites

2016-01-02 Thread Michael Merickel
R and make sure we don't > publish unfinished work on master. > > On Saturday, January 2, 2016 at 4:28:29 PM UTC-5, Steve Piercy wrote: >> >> On 1/2/16 at 3:11 PM, mmer...@gmail.com (Michael Merickel) pronounced: >> >> >Hey everyone, I'm starting the discussio

Re: [pylons-devel] github pages for pylons project sites

2016-01-02 Thread Michael Merickel
e to write down some procedure and > workflow about this. > > > On Saturday, January 2, 2016 at 4:54:28 PM UTC-5, Michael Merickel wrote: >> >> Okay, I was unaware of any on-going changes on the sites which is a >> little silly for someone with my level of involvement in the pr

Re: [pylons-devel] PasteDeploy in the Pylons GitHub org?

2016-03-08 Thread Michael Merickel
On Tue, Mar 8, 2016 at 5:55 PM, Marc Abramowitz wrote: > > To be honest, I'm not sure I want to be solely responsible for it myself > either. I was hoping that if it was under the Pylons project, that would > allow more people to chip in, as needed. > The Pylons Project

Re: [pylons-devel] Re: request context for Sentry

2016-03-19 Thread Michael Merickel
I'm missing something here probably but the raven docs have pretty straightforward support for configuring it via the ini file. Have you tried this? https://docs.getsentry.com/hosted/clients/python/integrations/pyramid/#pastedeploy-filter On Sat, Mar 19, 2016 at 5:44 PM, Zsolt Ero

Re: [pylons-devel] Make Pyramid 1.7 scaffolds ready for naïve usage of py.test and tox in new projects?

2016-05-05 Thread Michael Merickel
Hey Vincent, thanks for working on this. It would be very helpful if you could open an issue or a PR on github as it's much easier to discuss things there. I will say up front that a couple of these decisions are made already. 1) no tox. This is an app, not a library and we've already had a

Re: [pylons-devel] i18n state of affairs

2017-02-08 Thread Michael Merickel
On Wed, Feb 8, 2017 at 11:36 AM, Hans-Peter Jansen wrote: > As a consequence, all these packages will depend on lingua then.. > Do the packages actually need to depend on lingua? I see that your PR to deform doesn't add it, however deform expects it to in the dev environment

Re: [pylons-devel] i18n state of affairs

2017-02-08 Thread Michael Merickel
/en/latest/narr/i18n.html On Wed, Feb 8, 2017 at 3:31 PM, Hans-Peter Jansen <h...@urpla.net> wrote: > Hi Michael, > > On Mittwoch, 8. Februar 2017 12:22:27 Michael Merickel wrote: > > On Wed, Feb 8, 2017 at 11:36 AM, Hans-Peter Jansen <h...@urpla.net> > wrote: &g

Re: [pylons-devel] i18n in deformdemo dysfunctional

2017-02-08 Thread Michael Merickel
The issue is *usually* that the TranslationString instance hasn't been run through `request.localizer.translate(..)`. Now, why not? I haven't dug in to try and figure that out yet. On Wed, Feb 8, 2017 at 3:55 PM, Hans-Peter Jansen wrote: > Hi, > > I've used a good part of the

Re: [pylons-devel] i18n in deformdemo dysfunctional

2017-02-08 Thread Michael Merickel
er(renderer) > +deform.renderer.configure_zpt_renderer(("deformdemo:custom_widgets",)) > config.add_static_view('static_deform', 'deform:static') > config.add_static_view('static_demo', 'deformdemo:static') On Wed, Feb 8, 2017 at 4:19 PM, Michael Merickel

Re: [pylons-devel] i18n in deformdemo dysfunctional

2017-02-08 Thread Michael Merickel
I noticed that the renderer is not being used. The `deform.Form.set_default_renderer(render)` is commented out. Uncommenting it doesn't solve the problem but it's definitely an issue as the zpt_renderer isn't actually being used as a result. On Wed, Feb 8, 2017 at 4:14 PM, Michael Merickel <mm

Re: [pylons-devel] i18n state of affairs

2017-02-09 Thread Michael Merickel
On Thu, Feb 9, 2017 at 6:02 AM, Hans-Peter Jansen wrote: > There's one decision to make as the next step: > > Does the involved parties agree to leave the translation procedures > somewhat > outside the normal workflow and supply a i18n.sh script, accompanied with a > default