Doug Porter | 2 Apr 23:58 2006

minor bug in PEP 333 example

There is a minor bug in the middleware example in PEP 333.

--- pep-0333.txt.orig   Sun Apr  2 17:52:46 2006
+++ pep-0333.txt        Sun Apr  2 17:53:02 2006
 <at>  <at>  -352,7 +352,7  <at>  <at> 
         def __init__(self, application):
             self.application = application

-        def __call__(environ, start_response):
+        def __call__(self, environ, start_response):

             transform_ok = []

--

-- 
Doug Porter <dsp@...>
_______________________________________________
Web-SIG mailing list
Web-SIG@...
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org

Guido van Rossum | 3 Apr 21:06 2006

Re: minor bug in PEP 333 example

Thanks, fixed.

On 4/2/06, Doug Porter <dsp@...> wrote:
> There is a minor bug in the middleware example in PEP 333.
>
>
> --- pep-0333.txt.orig   Sun Apr  2 17:52:46 2006
> +++ pep-0333.txt        Sun Apr  2 17:53:02 2006
>  <at>  <at>  -352,7 +352,7  <at>  <at> 
>          def __init__(self, application):
>              self.application = application
>
> -        def __call__(environ, start_response):
> +        def __call__(self, environ, start_response):
>
>              transform_ok = []
>
>
>
> --
> Doug Porter <dsp@...>
> _______________________________________________
> Web-SIG mailing list
> Web-SIG@...
> Web SIG: http://www.python.org/sigs/web-sig
> Unsubscribe: http://mail.python.org/mailman/options/web-sig/guido%40python.org
>

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
(Continue reading)

Ian Bicking | 5 Apr 00:26 2006

html-gen-ish libraries; what's best?

Are there any opinions on the best HTML/XML generation libraries out there?

For example, HTMLGen being the original (but too eclectic).  Stan is 
often also sited (http://divmod.org/projects/nevow#stan).  I have an 
extension of ElementTree along these lines in FormEncode 
(http://svn.formencode.org/FormEncode/trunk/formencode/htmlgen.py).  I 
noticed http://markup.sourceforge.net/ today, which allows you to open a 
tag and close it later, which can be nice.

I'd like to put a Best Possible library in WebHelpers 
(http://pylonshq.com/WebHelpers/), that's both simple and easy to work 
with.  I would be nice if the same API could be used to generate both 
ElementTree nodes and strings; ElementTree itself can be a little picky, 
so *only* using ElementTree as the internal/intermediate representation 
(like formencode.htmlgen does) might be going too far.  HTML/XHTML 
validation might be interesting.  Smart indentation would be nice, at 
least optionally (i.e., indentation, but nothing that breaks the layout).

While the library would ideally have some (optional) knowledge of HTML, 
it would be out of scope to have it be a general page-builder (like 
HTMLGen, and a bit like markup.sf.net).  I'm more interested in just 
using it to build fragments.

Opinions?

--

-- 
Ian Bicking  /  ianb@...  /  http://blog.ianbicking.org
_______________________________________________
Web-SIG mailing list
Web-SIG@...
(Continue reading)

Brian Beck | 5 Apr 00:38 2006
Picon

Re: html-gen-ish libraries; what's best?

Ian Bicking wrote:
> While the library would ideally have some (optional) knowledge of HTML,
> it would be out of scope to have it be a general page-builder (like
> HTMLGen, and a bit like markup.sf.net).  I'm more interested in just
> using it to build fragments.

Never used it, but I came across XIST and it seems to include a pretty
'complete' way of doing that:
http://www.livinglogic.de/Python/xist/Examples.html

--
Brian Beck
Adventurer of the First Order

_______________________________________________
Web-SIG mailing list
Web-SIG@...
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org

Jacob Smullyan | 5 Apr 05:40 2006

Re: html-gen-ish libraries; what's best?

On Tue, Apr 04, 2006 at 05:26:28PM -0500, Ian Bicking wrote:
> Opinions?

I have an opinion about a related matter, namely, a convenience syntax
for generating nodes.  

One thing I like a lot about stan is its general thrust towards having
a concise, usable, sexp-ish syntax for this task that permits one to
view the document you are creating within Python almost as if it were
markup itself.  However, stan quite deliberately tortures Python
syntax with zany overloading, and while that can be enjoyed for its
own sake (I'd hardly want to discourage zaniness in general, we need
more of it), I don't consider it optimal.  For my work I sometimes use
a very simple module with which I can generate fragments like so:

   node=N('html', 
          A(xmlns='http://www.w3.org/1999/xhtml'),
          ('head',
           N('link', rel='stylesheet', href="styles.css"),
           ('title', 'This is a title')),
          ('body',
           ('p', A('class', 'major'), sometext)))

N is short for Node, A for Attribute; tuples are coerced to nodes, and
constructors are flexible so that attributes can be specified either
as keyword arguments, where convenient, or positionally (via the
Attribute class). 

My little implementation is a quick hack using elementtree's
SimpleXMLWriter as a back end; if anyone wants it I can post it, but
(Continue reading)

Luke Arno | 7 Apr 04:10 2006
Picon

Re: html-gen-ish libraries; what's best?

I wrote a little utility called 'pyfo' for just this purpose.

It works for generating any XML you like.

http://foss.cpcc.edu/pyfo/

this:
-------------------------------
markup = ('div',
                  [('h1', 'Example', {'class': 'heading'}),
                   ('p', 'No one expects The Spanish Inquisition!')])

print pyfo(markup, pretty=True)
-------------------------------

outputs:
-------------------------------
<div>
    <h1 class="heading">Example</h1>
    <p>No one expects The Spanish Inquisition!</p>
</div>
-------------------------------

This has turned out to be extremely convenient for me.
YMMV.

Cheers,
- Luke

http://lukearno.com/
(Continue reading)

Chad Whitacre | 12 Apr 08:04 2006

[ANN] httpy 0.9a2 -- a sane and robust HTTP server and library for Python

Greetings, program!

I am pleased to announce the second public release of httpy -- a sane 
and robust HTTP server and library for Python. Highlights in this release:

     - Responders may now return a Response object in addition to raising
       one.

     - Response headers may now be specified as a list of 2-tuples or a
       dictionary; either are converted to an email.Message.Message
       object by the constructor.

     - The module hierarchy is now more deeply nested to avoid importing
       unused modules.

     - httpy now logs access to stdout in the Combined Log Format, and
       errors to stderr.

Downloads and full documentation are available at:

   http://www.zetadev.com/software/httpy/

chad

_______________________________________________
Web-SIG mailing list
Web-SIG@...
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org

(Continue reading)

Ian Bicking | 17 Apr 17:39 2006

[Fwd: Summer of Code preparation]

Hi guys... looks like Google SoC is back on again.  I'm hoping we get 
some good web stuff going on, so people should start thinking.  Also 
there's two wiki pages where you can add project ideas: 
http://wiki.python.org/moin/SummerOfCode and the somewhat out-of-date 
(and needs cleaning) page from last year: 
http://wiki.python.org/moin/CodingProjectIdeas

-------- Original Message --------
Subject: [Python-3000] Summer of Code preparation
Date: Mon, 17 Apr 2006 00:43:33 -0700
From: Neal Norwitz <nnorwitz@...>

We've only got a short time to get setup for Google's Summer of Code.
We need to start identifying mentors and collecting ideas for students
to implement.  We have the SimpleTodo list
(http://wiki.python.org/moin/SimpleTodo), but nothing on the SoC page
yet (http://wiki.python.org/moin/SummerOfCode).

I can help manage the process from inside Google, but I need help
gathering mentors and ideas.  I'm not certain of the process, but if
you are interested in being a mentor, send me an email.  I will try to
find all the necessary info and post here again tomorrow.  Pass the
word!  I hope all mentors from last year will return again this year.

Can someone take ownership of drumming up mentors and ideas?  We also
need to spread the word to c.l.p and beyond.

Thanks,
n
_______________________________________________
(Continue reading)

Titus Brown | 17 Apr 18:30 2006
Picon

Re: [Fwd: Summer of Code preparation]

On Mon, Apr 17, 2006 at 10:39:59AM -0500, Ian Bicking wrote:
-> Hi guys... looks like Google SoC is back on again.  I'm hoping we get 
-> some good web stuff going on, so people should start thinking.  Also 
-> there's two wiki pages where you can add project ideas: 
-> http://wiki.python.org/moin/SummerOfCode and the somewhat out-of-date 
-> (and needs cleaning) page from last year: 
-> http://wiki.python.org/moin/CodingProjectIdeas

I'm thinking of proposing a project to build a JavaScript interpreter
interface for Python; the goal (for me) is to get twill/mechanize to
understand JavaScript.  I think the project has wider applications,
but I'm not sure what people actually want to do with JavaScript.
I could imagine server-side parsing of javascript, and/or integration of 
javascript and python code.  Thoughts?

--titus
_______________________________________________
Web-SIG mailing list
Web-SIG@...
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org

Ian Bicking | 17 Apr 18:47 2006

Re: [Fwd: Summer of Code preparation]

Titus Brown wrote:
> On Mon, Apr 17, 2006 at 10:39:59AM -0500, Ian Bicking wrote:
> -> Hi guys... looks like Google SoC is back on again.  I'm hoping we get 
> -> some good web stuff going on, so people should start thinking.  Also 
> -> there's two wiki pages where you can add project ideas: 
> -> http://wiki.python.org/moin/SummerOfCode and the somewhat out-of-date 
> -> (and needs cleaning) page from last year: 
> -> http://wiki.python.org/moin/CodingProjectIdeas
> 
> I'm thinking of proposing a project to build a JavaScript interpreter
> interface for Python; the goal (for me) is to get twill/mechanize to
> understand JavaScript.  I think the project has wider applications,
> but I'm not sure what people actually want to do with JavaScript.
> I could imagine server-side parsing of javascript, and/or integration of 
> javascript and python code.  Thoughts?

Do you mean like integrating Mozilla's Spidermonkey with Python?  That 
would be a very approachable and useful project, I think.  It even gets 
us a restricted execution environment ;)

I'm personally non-plussed by deeper integration, like parsing 
Javascript in Python or otherwise mingling the runtimes.  But I know 
other people find the idea of that sort of thing much more appealing 
than I do.  Regardless of motivation, I think the simpler Spidermonkey 
integration would be more useful *and* much easier.  Definitely an 
interesting idea -- and the more I think about the restricted execution 
aspect, the more plausibly useful that sounds.  (Rich templating 
languages using Javascript?)

I think Brett Cannon is doing something specifically related to Python 
(Continue reading)


Gmane