Re: 2.2 equivalents for transform.expr() and transform.dynamic()?
"Jonathan Ellis" <[email protected]> Mon, 09 Apr 2007 13:17:51 -0700
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 9 Apr 2007 13:18:24 -0400, "Philip Semanchuk" <[email protected]> said: > Thanks. I looked through the response module and I can see how this > works now that you've pointed me to it. I found that I had to add a > dummy flush() method to my class, too, so I ended up with something > like this: > > [[\ > class MyOut: > def __init__(self, out): > self.out = out > self.writeStatic = out.write > self.writeExpr = self.write > def write(self, s): > self.out.write(Utf8ify(ReplaceHtmlSpecials(s))) > def flush(self): > pass > > response.addFilter(MyOut) > ]] > > However this isn't the equivalent of what I'm doing with the transform > module. The filter above transforms *all* output whereas I only want to > run my functions on dynamic output. that should be the difference between writeStatic and writeExpr. If not it sounds like a bug. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV