Re: [Repoze-dev] Apparent rendering bug in Chameleon Genshi templates.

2010-11-05 Thread Chris McDonough
Hi Ceri,

This message was discarded (apparently because you're not a member of
the repoze-dev maillist).  I'm forwarding it on your behalf, but you'll
need to sign up at http://lists.repoze.org to reply.

- C

On Sat, 2010-11-06 at 14:10 +0900, Ceri Storey wrote:
> Hi there.
> 
> 
> I think there was a bug introduced between chameleon 1.2.1--1.2.2; in
> that content included from a py:def statement will be followed by a
> "None". Looking into the internals (although please forgive me if this
> is unhelpful), it looks like when the py:def is translated into a
> function definition; it naturally returns None; and somehow; that's
> not being caught by the translation code. It looks like it should be;
> looking at the output from GenshiTemplate.compile() in 1.2.13; but I
> couldn't quite figure out what was going wrong. 
> 
> 
> Please find a test case below. I've bolded the erroneous "None" and
> versions for clarity.
> 
> rhk:chameleon cez$ ipython
> Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) 
> Type "copyright", "credits" or "license" for more information.
> 
> 
> IPython 0.10 -- An enhanced Interactive Python.
> ? -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help  -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints
> more.
> 
> 
> In [1]: from chameleon.genshi.template import *;
> GenshiTemplate("""http://www.w3.org/1999/xhtml";
> xmlns:py="http://genshi.edgewall.org/";
> xmlns:xi="http://www.w3.org/2001/XInclude";>  function='fish'>HalibutThe fish of the day is
> ${fish()}. """).render()
> Out[1]: u'http://www.w3.org/1999/xhtml";> The fish of
> the day is Halibut. '
> 
> 
> In [2]: import chameleon; chameleon.__file__
> Out[2]:
> '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Chameleon-1.2.1-py2.5.egg/chameleon/__init__.pyc'
> 
> 
> In [3]: 
> Do you really want to exit ([y]/n)? 
> rhk:chameleon cez$  
> 
> 
> And now our failing case:
> 
> 
> rhk:chameleon cez$ ipython
> Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) 
> Type "copyright", "credits" or "license" for more information.
> 
> 
> IPython 0.10 -- An enhanced Interactive Python.
> ? -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help  -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints
> more.
> 
> 
> In [1]: import chameleon; chameleon.__file__
> Out[1]:
> '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Chameleon-1.2.2-py2.5.egg/chameleon/__init__.pyc'
> 
> 
> In [2]: from chameleon.genshi.template import *;
> GenshiTemplate("""http://www.w3.org/1999/xhtml";
> xmlns:py="http://genshi.edgewall.org/";
> xmlns:xi="http://www.w3.org/2001/XInclude";>  function='fish'>HalibutThe fish of the day is
> ${fish()}. """).render()
> Out[2]: u'http://www.w3.org/1999/xhtml";> The fish of
> the day is HalibutNone. '
> 
> 
> In [3]: 
> Do you really want to exit ([y]/n)? 
> rhk:chameleon cez$ 
> 
> 
> I can hack around this for now by providing an alternative translation
> function; a-la:
> 
> 
> In [4]: from chameleon.genshi.template import *;
> GenshiTemplate("""http://www.w3.org/1999/xhtml";
> xmlns:py="http://genshi.edgewall.org/";
> xmlns:xi="http://www.w3.org/2001/XInclude";>  function='fish'>HalibutThe fish of the day is
> ${fish()}. """, translate=lambda x, **kwargs: x is not
> None and x or '').render()
> Out[4]: u'http://www.w3.org/1999/xhtml";> The fish of
> the day is Halibut. '
> 
> 
> In [5]: import chameleon; chameleon.__file__
> Out[5]:
> '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Chameleon-1.2.2-py2.5.egg/chameleon/__init__.pyc'
> 
> 
> In [6]: 
> 
> This also works on 1.2.13. Although; in that case; if I pass
> 'translate' to a GenshiTemplateLoader; I can't see that __init__ for
> chameleon.core.loader:TemplateLoader will do anything with it. It
> doesn't appear to pass it to the loaded GenshiTemplate instances
> (read; I still get "None" in my output).
> 
> 
> Thanks in advance,
> 
> 
> ps. I sent this over to the month last month, but I didn't get
> nay response, nor does it show up in the list archives. Perhaps I've
> missed something.
> -- 
> Ceri Storey


___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] DummyRequest breaks GET/POST API

2010-11-05 Thread Chris McDonough
I suppose my issue with adding getall to the thing: if getall needs to
behave like it does in a normal webob request and multiple values for
each key need to be kept around, you might as well just use a normal
one.  Or, as Fergus did, subclass.

- C

On Fri, 2010-11-05 at 22:23 +, Fergus Doyle wrote:
> I ended up subclassing DummyRequest to add the functionality where i needed 
> it (I had a number of other aspects to add to the class due to the app setup, 
> so it wasn't too painful)
> 
> I suppose it can't be a bad thing to resemble webob.Request as closely as 
> possible?
> 
> On 4 Nov 2010, at 12:40, Wichert Akkerman wrote:
> 
> > Since the issue tracker on bfg.repoze.org is still broken I'm posting 
> > this here.
> > 
> > I ran into a little problem today: I was adding some tests for a 
> > function which uses request.POST.getall(), but it turns out that 
> > repoze.bfg.testing.DummyRequest uses a plain dict for POST instead of a 
> > WebOb multidict, so .getall() is not available.
> > 
> > Wichert.
> > ___
> > Repoze-dev mailing list
> > Repoze-dev@lists.repoze.org
> > http://lists.repoze.org/listinfo/repoze-dev
> 
> ___
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev
> 


___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] DummyRequest breaks GET/POST API

2010-11-05 Thread Fergus Doyle
I ended up subclassing DummyRequest to add the functionality where i needed it 
(I had a number of other aspects to add to the class due to the app setup, so 
it wasn't too painful)

I suppose it can't be a bad thing to resemble webob.Request as closely as 
possible?

On 4 Nov 2010, at 12:40, Wichert Akkerman wrote:

> Since the issue tracker on bfg.repoze.org is still broken I'm posting 
> this here.
> 
> I ran into a little problem today: I was adding some tests for a 
> function which uses request.POST.getall(), but it turns out that 
> repoze.bfg.testing.DummyRequest uses a plain dict for POST instead of a 
> WebOb multidict, so .getall() is not available.
> 
> Wichert.
> ___
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] repoze.bfg is now Pyramid

2010-11-05 Thread Fergus Doyle

On 5 Nov 2010, at 21:16, Martin Aspeli wrote:

> On 5 November 2010 19:50, Chris McDonough  wrote:
>> Personally, I couldn't be happier about this.  I'm proud of
>> the work we've done so far, and I'm extremely optimistic
>> about the future of Pyramid and the Pylons Project.
> 
> Can I just say this is an almost unheard of degree of maturity and
> pragmatism for a framework author to display. I'm very impressed, and
> this is surely a good thing. Congratulations. :)

I concur! True collaboration at the highest level...

> 
> Martin
> ___
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] repoze.bfg is now Pyramid

2010-11-05 Thread Martin Aspeli
On 5 November 2010 19:50, Chris McDonough  wrote:
> Personally, I couldn't be happier about this.  I'm proud of
> the work we've done so far, and I'm extremely optimistic
> about the future of Pyramid and the Pylons Project.

Can I just say this is an almost unheard of degree of maturity and
pragmatism for a framework author to display. I'm very impressed, and
this is surely a good thing. Congratulations. :)

Martin
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] repoze.bfg is now Pyramid

2010-11-05 Thread Thomas G. Willis
HOORAY!
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] repoze.bfg is now Pyramid

2010-11-05 Thread Shane Hathaway
On 11/05/2010 02:11 PM, Casey Duncan wrote:
> Congrats! Great to see synergy, particularly amongst Python web frameworks!

+1 :-)

Shane
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] repoze.bfg is now Pyramid

2010-11-05 Thread Casey Duncan
I will be disappointed if the Pyramid logo is anything less than the eye of 
providence ;^)

Congrats! Great to see synergy, particularly amongst Python web frameworks!

-Casey

On Nov 5, 2010, at 12:50 PM, Chris McDonough wrote:

> Denials
> ---
> 
> Hopefully these will help clear up any misunderstandings
> about Pyramid: http://docs.pylonshq.com/denials/pyramid.html

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] repoze.bfg is now Pyramid

2010-11-05 Thread Chris McDonough
Wha?


The repoze.bfg web framework has now become "Pyramid",
managed under the Pylons Project.  See
http://docs.pylonshq.com/

For more detail, please read http://docs.pylonshq.com/#faq .
If you're too busy for my personal blather, the FAQ should
tell you everything you need to know.  Otherwise, please
read on.

Personal Perspective


Over the last few months, I've been collaborating pretty
meaningfully with Ben Bangert, the lead developer of the
Pylons (http://pylonshq.com) web framework.  This
collaboration started because Ben and I have "competing" web
frameworks, both written in Python.  Our repoze.bfg and
Ben's Pylons share almost exactly the same scope.  They are
both "lightweight" web frameworks.  They use similar models
for mapping URLs to code.  They appeal to roughly the same
sort of people.

In the meantime, it's clear that there is a limited amount
of oxygen in the Python web framework world: only the
frameworks which are clear winners will prosper and survive
long-term.  A potential Python web developer just doesn't
have the time to evaluate 20 separate web frameworks.  Even
if he or she did, to a truly impartial evaluator, it would
be extremely difficult to make a choice between two
frameworks as similar as Pylons and repoze.bfg.

Ben and I, as well as other folks including Paul Everitt,
Mark Ramm, and Chris Rossi met in Las Vegas a few weeks ago
to talk about merging Pylons and repoze.bfg.  To everyone's
surprise, consensus was pretty easy: not only should it be
done, it should be done swiftly.  We agreed to collapse the
crowded Python web framework world a bit in order for there
to be slightly more oxygen for the Python web world to
breathe.

Thus, BFG has now become Pyramid
(http://docs.pylonshq.com/pyramid/dev/), and is now part of
the Pylons Project.  "The Pylons Project" is the project
name for a collection of related technologies.  Pyramid is
the first "new" package which is part of the Pylons Project.
Other packages to the collection will be added over time,
likely including higher-level components such as
applications and other frameworks which rely on a particular
persistence mechanism (Pyramid does not).  The first release
of Pyramid 1.0a1 was made today to PyPI.  See
http://docs.pylonshq.com/pyramid/dev/narr/install.html for
install instructions.

Personally, I couldn't be happier about this.  I'm proud of
the work we've done so far, and I'm extremely optimistic
about the future of Pyramid and the Pylons Project.

repoze.bfg 1.3 (made November 1, 2010) will be its last
major release.  Minor updates will be made for critical bug
fixes (and so there may be a 1.3.1, 1.3.2, etc), but new
feature development will take place in Pyramid.  repoze.bfg
won't see a 1.4 release (at least one made by me).  While
Pyramid is technically backwards incompatible with
repoze.bfg, you won't have to do much to use your existing
repoze.bfg applications on Pyramid.  There's automation
which will change most of your import statements and ZCML
declarations.  See
http://docs.pylonshq.com/pyramid/dev/tutorials/bfg/index.html

The Repoze project will continue to exist.  Plenty of Repoze
software exists that has nothing to do with repoze.bfg.  The
Pylons 1.0 web framework, Ben tells me, will be shifted into
legacy status once Pyramid has a non-alpha release.

Existing BFG developers might consider joining the #pylons
IRC channel on freenode.net and the Pylons-devel maillist at
.  Discussion
about the framework-previously-known-as-BFG is meant to take
place in these locations.

The Pyramid code is now kept at
https://github.com/organizations/Pylons.  Unfortunately,
existing contributor agreements arranged with Agendaless for
the Repoze repository don't carry over to the new version
control location.  We don't currently have the machinery in
place to accept new contributor agreements that will allow
folks to check in directly to the Pyramid trunk and other
Pyramid-related code, so, for now at least, we'll be making
use of the "distributedndess" of Git: if you want to
contribute something, make a fork of the code on GitHub and
send a pull request.

Denials
---

Hopefully these will help clear up any misunderstandings
about Pyramid: http://docs.pylonshq.com/denials/pyramid.html


___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev