check trunk. I removed it. I am sure we can do better. On Jun 5, 2011, at 9:26 PM, Ryan Seto wrote:
> Thank you very much for your prompt response. > > It looks like the file gluon/template.py does pull in some extra > dependencies, however. > > It tries to import restricted on line 20 and import globals on line 863. > > The restricted module dependency may be easy to remove, since it > appears that it only uses it for raising exceptions. However, it > looks like the Response object is used from the globals module. > > On Sun, Jun 5, 2011 at 9:12 PM, Massimo Di Pierro > <massimo.dipie...@gmail.com> wrote: >> >> >> On Jun 4, 7:58 pm, Ryan Seto <mr.werew...@gmail.com> wrote: >>> I really like how elegant and simple it is to create views in web2py. >>> Would it be possible to use the view/template engine in a standalone >>> application? >> >> yes. >> >> you only need the file gluon/template.py >> >> look at the example inside. You only the render function. >> >>> >>> I'm writing a desktop application to view formatted text, like >>> markdown, using PyQT's QtWebKit to render the generated html, and I >>> would like to integrate web2py's method for generating views into my >>> project. >>> >>> I've been looking through web2py's source and the mailing list, and it >>> seems that response.render( view_text, dict() ) might be the closest >>> thing to what I'm looking for. However, it looks like there's a lot >>> of dependencies wrapped around it and the objects weren't made to be >>> used in the context of another application. >>> >>> If this is the case, would it make sense to compartmentalize the parts >>> for rendering a view into it's own module so they can be used in a >>> standalone application, similar to the dal? I would be willing to >>> come up with a patch for this, if I could get some hints on where to >>> start.