interesting.

On Jul 13, 1:52 pm, Yarko Tymciurak <yark...@gmail.com> wrote:
> On Mon, Jul 13, 2009 at 11:25 AM, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > Functionally you can achieve the same, as you know, with
>
> > FORM(
> >    DIV(
> >        INPUT(_type='submit') ,
> >        _class='test'),
> >    _action='',_method='post')
>
> > Syntactically I do not think it is possible to implement the syntax
> > you suggest because there is no "with" in Python.
>
> Actually, there is:  PEP 343 introduced it.  As of Python 2.5, it's
> available with:
>
> from __future__ import with_statement;
>
> As of Python 2.6 "with" and "as" are always keywords.
>
> Check out  *Writing Context
> Managers*<http://docs.python.org/3.0/whatsnew/2.6.html#new-26-context-managers>and
> *The contextlib
> module*<http://docs.python.org/3.0/whatsnew/2.6.html#new-module-contextlib>
> .
>
> - Yarko
>
>
>
> > Massimo
>
> > On Jul 13, 11:12 am, "mr.freeze" <nat...@freezable.com> wrote:
> > > I'm a .net developer by trade.  I embed IronPython into a lot of my
> > > apps.  One nice thing I can do with it is build XML using the 'with'
> > > statement.
> >http://langexplr.blogspot.com/2009/02/writing-xml-with-ironpython-xml...
>
> > > How hard would this be to implement a similar context protocol for
> > > web2py's HTML helpers?  This is what I am picturing:
>
> > > with FORM(_action='',_method='post'):
> > >     with DIV(_class='test'):
> > >         INPUT(_type='submit')
>
> > > Would produce this:
>
> > > <form enctype="multipart/form-data" action="" method="post">
> > >   <div class="test">
> > >     <input type="submit" />
> > >   </div>
> > > </form>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to