Author cito
Recipients
Date 2005-02-01.18:49:12
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=193957

Maybe I should explain my motivation for making this request.

In Kid [http://kid-template.sf.net], a xml templating
language, it is possible to set xml attributes with a
Pythonic syntax, like this:

<p py:attrs="class=myclass, bgcolor=mycolor, id=173" />

This expression is dynamically evaluated. If
myclass="aclass" and bgcolor="blue", then this would produce
the following:

<p class="aclass" bgcolor="blue" id="173">

Internally, this is of course realized by creating a
dictionary that contains the attributes of the tag, and then
creating an update statement with the string in py:attrs as
argument.

The problem arises when one of the attributes is a Python
keyword, "class" being a particularly embarassing example.

My current solution is to parse the py:attrs expression
manually and mangle the names. If Python could handle Python
keywords here, it would be a whole lot easier and faster.
History
Date User Action Args
2007-08-23 14:29:17adminlinkissue1113984 messages
2007-08-23 14:29:17admincreate