I've looked a lot at chatola, and it's been a really good learning experience. But, chatola, as shipped is broke - at least on firefox 2 on OS X.

The problem occurs because athena is not correctly escaping quotes in the filled stan templates. So, if any of your messages contain single quotes, you get a javascript error. Also - any use of the change nick or change topic automatically includes single quotes into a message string, and thus breaks when interpreted as javascript.

A stupid simple fix is to simply change the %r interpolation on lines 90 and 98 of chatola.py to something like %s:

self.content(changer, 'changed the topic to %r.' % (topic, )))

becomes

self.content(changer, 'changed the topic to %s.' % (topic, )))

or even

self.content(changer, 'changed the topic to "%s"' % (topic, )))

Now at least, you're not breaking automatically whenver changing topic or nickname.

And then I could write custom code to properly escape the quotes in the stan template. But this violates some cental ideas that at least some of you have - namely that you don't want the application developer escaping quotes. And I assume if I do this, it could easily break in the future.

I can explain in greater detail, but am throwing this out as is so that it's not too long to read ;) I can also send a code snippet if you don't want to use the chatola code.

Dav Clark
917-544-8408





Dav Clark
917-544-8408



_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to