[Twisted-Python] on template processing

Kevin Mcintyre kebin70 at gmail.com
Sat Dec 26 17:08:05 MST 2015


1) Is template block processing done top to bottom sequentially?  I've
included example.py - it's interesting that by having a blocking call first
the second request is blocked, but having the blocking call after a
non-blocking call the second request is not.  I would've thought it would
behave as a deferred list, but looking at _flattenTree and guessing not.
Maybe related to wait_for_it example?

2) Is it possible for a Resource to act as an Element too?  I've included a
non-working elementresource.py.  I'm a total hack, but I would think that
if an instance had a loader attr it could be processable.

3) Is it possible to include xmlns:t="
http://twistedmatrix.com/ns/twisted.web.template/0.1" not in a tag itself?
Or perhaps have a tag like 'render-block' that could be transparent-like?

4) Is it possible to have xmlns:t="
http://twistedmatrix.com/ns/twisted.web.template/0.1" in multiple places in
a template?  I have some cases with inline scripts that bonk out with > or
< characters.  This is very much related to #3.

5) Is it possible for a render element to return something like "<~sometag
t:render>..." and process recursively?

6) Is there any examples of connection keep-alive long polling?

7) Examples of request based scoping would be great.  All the examples on
http://twistedmatrix.com/documents/13.0.0/web/howto/twisted-templates.html
have flatten(None... -  I've included request_scope.py

8) The wait_for_it example, is that meant as a chunked transfer example?
It would be cool to have an example I could open in a browser.  Trying to
wrap my head around this and subviews in the meantime.

Happy holidays.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20151226/70b99511/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.py
Type: text/x-python
Size: 2089 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20151226/70b99511/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elementresource.py
Type: text/x-python
Size: 1015 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20151226/70b99511/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: request_scope.py
Type: text/x-python
Size: 2048 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20151226/70b99511/attachment-0002.py>


More information about the Twisted-Python mailing list