suggestions/hints on dummy.kid and some Template variables

0 views
Skip to first unread message

Jorge Vargas

unread,
Jun 20, 2006, 4:04:24 PM6/20/06
to Discussion on the kid template language (comments, suggestions, bugs, idea, whatever)., turbo...@googlegroups.com
Hello everyone.

I'm developing a app with someone else and he is doing the frontend, so I decided to create a dummy.kid that will let me add and test stuff so later he will add the template.

my idea is that dummy.kid will display *all* variables from the template, so I did

    <p py:for="var in locals()">
    <span py:content="var">X</span>
    </p>

this will let me check if the output is ok, but it's showing some internal variables this lead me to two questions

1- how can I strip those internal variables from the output
2- what is all that?
I got a total of 19 variables
 std
_cont
ancestors
assume_encoding
tg_js_bodytop
value_of
defined
self
current
tg_css
tg_js_head
_p
content
tg_flash
initialize
tg
_u
serializer
tg_js_bodybottom

I know the ones that start with tg are from turbogears but what about all the others?
will one of those give me an answer to #1 ?

David Stanek

unread,
Jun 20, 2006, 5:04:49 PM6/20/06
to turbo...@googlegroups.com
On 6/20/06, Jorge Vargas <jorge....@gmail.com> wrote:
> my idea is that dummy.kid will display *all* variables from the template, so

That's one of those ideas that make me wonder why I haven't done it
long ago. Very cool.

At least some of the others, like _cont, self, defined,etc., are just
variables within the Kid template. Is it essential to filter those
out? If so you may just have to keep a list of them around and update
it as the Kid internals change. Right now I don't think there is a
pattern for filtering them out.

One thing I have thought of doing for another reason in making a
magical __kidbuiltins__ variable that contains the things Kid
magically puts in a template's score. This still would not contain
things like _cont, which are local variables in the generated Python
code.

David Stanek

--
http://www.traceback.org

Reply all
Reply to author
Forward
0 new messages