Re: view-callable class - request arg receives context object

2012-10-31 Thread Simon Yarde
tionally via introspection and not by name. The >>> calling convention is here: >>> >>> >>> http://pyramid.readthedocs.org/en/latest/narr/views.html#alternate-view-callable-argument-calling-conventions >>> >>> On Wed, Oct 31, 2012 at 11:02 AM,

view-callable class - request arg receives context object

2012-10-31 Thread Simon Yarde
Docs say you should expect to handle a request argument in a view-callable class. http://pyramid.readthedocs.org/en/latest/narr/views.html#defining-a-view-callable-as-a-class But I found I was getting a context object for the request arg. Does this mean context and request are being passed (in

Re: Using Pyramid with Nginx and uWSGI

2012-07-30 Thread Simon Yarde
When you have a working pyramid starter project, this might be helpful... http://projects.unbit.it/uwsgi/wiki/INIFiles And this.. http://pythonpaste.org/deploy/ You can init like this; $ uwsgi development.ini provided you have this line in your .ini [uwsgi] paste = config:/deve

Pyramid/Jinja2 Filter Caching Issue

2012-07-27 Thread Simon Yarde
Filter output gets cached/compiled if a filter has no arguments or the arguments are strings. I believe this is undocumented behaviour, but makes a lot of sense. However, this is problematic if the output is supposed to vary according to some aspect of the request; the matchdict in my case. The

Re: byte vs string issues with pyramid_viewgroup on python3

2012-07-21 Thread Simon Yarde
You'd probably want to walk the iterable and cast all elements to string? Then do your join operation with the empty unicode string. Your code only checks the first item and assumes all other elements are also strings - perhaps your code is working because there is only one element in the iterab

Re: Thank You, Chris!

2012-03-19 Thread Simon Yarde
The general view is that emacs is the more-powerful but slightly harder one, vim is the simpler more focussed one. Both good. I chose vim. This might help http://www.vim.org/about.php To answer your questions.. If you've never used a text editor in the terminal before, the official tutorial is

Re: py3.2 sysconfig.get_config_var('CC') wrong value returned

2012-03-02 Thread Simon Yarde
e Clang 3.0 (tags/Apple/clang-211.10.1)] on Darwin-11.3.0-x86_64-i386-64bit Confirm Pyramid and uWSGI working. I guess this isn't really a Python build issue as-such, but more of an issue with how uWSGI locates the compiler on Darwin, and that Apple have phased out gcc rather brutally. On

Re: py3.2 sysconfig.get_config_var('CC') wrong value returned

2012-02-29 Thread Simon Yarde
Thanks Graham and Marius, much appreciated. I'll get stuck into this tomorrow and report back. On 29 Feb 2012, at 17:42, Graham Higgins wrote: > On Wednesday, February 29, 2012 5:01:38 PM UTC, Marius Gedminas wrote: > It's looking for libpython3.2m.so in $LD_LIBRARY_PATH. > > At least that's

py3.2 sysconfig.get_config_var('CC') wrong value returned

2012-02-29 Thread Simon Yarde
Throwing this out there.. woes with Python 3.2 sysconfig and more.. I recently started migrating a Pyramid app to py3.2 and hit a uWSGI build issue with the python installer; sysconfig.get_config_var returns 'gcc-4.2', which doesn't exist on my system, but py2.7 reports 'llvm-gcc-4.2' correctly

Re: What are the files located in the AppName.egg-info used for?

2012-02-18 Thread Simon Yarde
Actually, you want this for the detail on eggs.. http://peak.telecommunity.com/DevCenter/EggFormats On 18 Feb 2012, at 17:24, Simon Yarde wrote: > http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/project.html#the-project-structure > > Hope that explains it! >

Re: What are the files located in the AppName.egg-info used for?

2012-02-18 Thread Simon Yarde
http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/project.html#the-project-structure Hope that explains it! On 18 Feb 2012, at 16:16, Tjelvar wrote: > Have just run: > > $ ./env/bin/pcreate --scaffold=starter AppName > $ cd AppName > $ ./env/bin/python setup.py develop > > Whi

Re: pylonsproject.chipin.com set up for docs overhaul pledge collections

2012-02-16 Thread Simon Yarde
Pledge made just now as promised. Confirm there is a slight delay on your payment showing-up, don't panic! Best Simon -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com. To un

Re: Raising 403 within traversal when the Forbidden context is already used to show the login page

2012-02-10 Thread Simon Yarde
hat trying to shoe horn http protocol into application exception logic is at the heart of the confusion the original poster is experiencing? On 10 Feb 2012, at 18:58, Michael Merickel wrote: > On Fri, Feb 10, 2012 at 11:24 AM, Simon Yarde wrote: > I might have come at it differently raisi

Re: Raising 403 within traversal when the Forbidden context is already used to show the login page

2012-02-10 Thread Simon Yarde
Sorry I should have added, but resisted as I felt my message was long enough.. Just because Pyramid (or your app) raises an http exception doesn't mean you have to return that view. As Michael describes you can intercept and downgrade the exception as you deem appropriate. The reason your code

Re: Raising 403 within traversal when the Forbidden context is already used to show the login page

2012-02-09 Thread Simon Yarde
I'm pretty sure you need to be using 401 for pages that require authorisation, and not 403. Maybe try to untangle your approach so that the login page is never throwing 401 (or 403). The protected resource should raise the exception and your app design handles it by issuing a redirect to login

Re: match_param as a dict

2012-02-07 Thread Simon Yarde
Nice! :) Sent from my iPhone On 7 Feb 2012, at 17:12, Michael Merickel wrote: > I patched 1.2-branch and 1.3-branch last night. match_param will now accept a > tuple. You can either use those branches or wait for a release. :-) > > On Tue, Feb 7, 2012 at 2:50 AM, Simon Yarde wro

Re: match_param as a dict

2012-02-07 Thread Simon Yarde
e > match_param will accept a tuple. > > > 2012/2/6 Simon Yarde > Hi Joel > > I have opened an issue #405 re your question. > > There is a quick and dirty hack if you must get this working right away and > are ok forking Pyramid. The issue is happening because re

Re: match_param as a dict

2012-02-06 Thread Simon Yarde
Hi Joel I have opened an issue #405 re your question. There is a quick and dirty hack if you must get this working right away and are ok forking Pyramid. The issue is happening because resolveConflicts stores the match_param in a tuple, and a string is hashable but a dict is not. Pyramid is pa

Re: need your help to overhaul docs

2012-02-05 Thread Simon Yarde
I would be happy to personally contribute $50 to the effort. Please add me to the list. Perhaps this is an amount other independents could put forward, and together another 18 of us might represent one of the $1000 company contributions? Best, S On 4 Feb 2012, at 12:32, Chris McDonough wrote:

Re: Caching Response Object

2012-01-31 Thread Simon Yarde
wrote: > Thanks Simon. Varnish is definitely worth exploring. > > I'm also very interested in your second approach, how can you tell if > the user has JS enabled by looking at her request? > > Jerry > > On Jan 31, 11:45 pm, Simon Yarde wrote: >> I wonder if th

Re: Caching Response Object

2012-01-31 Thread Simon Yarde
I wonder if this solves your issue with Varnish, or if it is too coarse: https://www.varnish-cache.org/docs/trunk/tutorial/cookies.html It would seem as a minimum you could identify logged-in-users from non-logged-in-users by a the presence of a specific auth-cookie. This would certainly accele

Re: route_prefix trailing-slash design issue?

2012-01-18 Thread Simon Yarde
_prefix=..) to indicate a "container" in which the suffixed '/' > is appropriate. Anyway I decided to document this on github rather than fully > explain it here for posterity: > > https://github.com/Pylons/pyramid/issues/406 > > On Wed, Jan 18, 2012 at 5:53 AM, Si

route_prefix trailing-slash design issue?

2012-01-18 Thread Simon Yarde
Please can we have the option to disable automatic slash for empty route-paths, in order for despatch-style design to be 'more modular'. Issue: - Let's say I want to exclude the '/article' prefix from the article module to make it 'more modular'; - I use a route_prefix to add the routes from t

Re: FAPWS / Gevent and Nginx

2011-12-14 Thread Simon Yarde
Thanks again Phillip. The uWSGI docs are certainly not of the calibre of Pyramid's docs :) -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, s

Re: FAPWS / Gevent and Nginx

2011-12-13 Thread Simon Yarde
On 13 Dec 2011, at 11:45, Philipp Dubrov wrote: > > > On Dec 12, 1:40 pm, Simon Yarde wrote: >> Thanks for the info. It's starting to become clear(er)! >> >> I've been perplexed by the multitude of ways you can configure a >> server/wsgi, and to be hon

Re: FAPWS / Gevent and Nginx

2011-12-12 Thread Simon Yarde
eploying-turbogears-21-application-with-nginx-and-uwsgi > it also applies to pyramid as well. > > i'd be very interested in docs about gevent & nginx. > > On Dec 9, 2:36 pm, Simon Yarde wrote: >> Hi All >> >> Anyone have any experience using of FAPWS or

FAPWS / Gevent and Nginx

2011-12-09 Thread Simon Yarde
Hi All Anyone have any experience using of FAPWS or Gevent and Nginx together that they would be interested in sharing? I understand uWSGI, Gevent, and FAPWS are highly capable, with FAPWS focussed in simplicity/speed and needing to be extended to add SSL support (which I'm interested in). The

Re: Pyramid Debug Toolbar: Issue #44

2011-11-14 Thread Simon Yarde
m 14.11.2011 11:02, schrieb Simon Yarde: >> A temporary patch/workaround would be really useful, other than turn off >> debugging :) > > Here is a patch for this issue, let us know how it works: > https://github.com/Pylons/pyramid_debugtoolbar/pull/43 > > -- Christoph

Pyramid Debug Toolbar: Issue #44

2011-11-14 Thread Simon Yarde
Hi All Does anyone have any information on progress for Pyramid Debug Toolbar issue #44? The issue causes the exception below when URI's contain accented characters (in my case 'ΓΌ'). Pyramid behaves normally without error when debug toolbar is turned off. A temporary patch/workaround would b

Re: Possible? Raise HTTPNotFound within Exception handler view

2011-11-14 Thread Simon Yarde
Many thanks again. It felt quite natural to handle/raise/re-raise exceptions in the exception view since this has become the exception handler so-to-speak. However, looking at the problem again, the code is much easier to follow as a result of placing all of the application's something-not-found

Possible? Raise HTTPNotFound within Exception handler view

2011-11-05 Thread Simon Yarde
Is it possible to raise an HTTPNotFound within an Exception handler view, and have the HTTPNotFound caught by a custom HTTPNotFound handler? Can anyone help? What I have... - An exception handler view which responds to a normal python Exception - works - I'm fielding the exception by either r

Re: Documentation: Configurator include route_prefix

2011-11-02 Thread Simon Yarde
Sorry about that.. looking at the wrong doc from a search and didn't spot the version in the URL http://docs.pylonsproject.org/projects/pyramid/1.2/api/config.html On 2 Nov 2011, at 11:36, Simon Yarde wrote: Should the route_prefix argument be documented under Configurator include stat

Documentation: Configurator include route_prefix

2011-11-02 Thread Simon Yarde
Should the route_prefix argument be documented under Configurator include statement? http://docs.pylonsproject.org/projects/pyramid/current/narr/introduction.html?highlight=route_prefix#configuration-extensibility No mention of route_prefix here.. http://docs.pylonsproject.org/projects/pyramid/