[Twisted-Python] wxreactor hack
Hi Folks, Attached is a hack of Itamar's wxreactor, which uses another wxTimer to implement reactor.callLater. I even tried using the oft mentioned(on the wxPy list) wxCallAfter for reactor.callFromThread. But it tends to lag behind a lot, which is very unsuitable. Hence, the standard runUntilCurrent from SelectReactor is slightly modified and used. Anyways, no performance guarantees. It works for me though :) Jeethu Rao
Hi All, It seems that Woven escapes on all text returned by wmfactory_ methods. Can this behavior be changed? I would like to build a model function that returns an XML fragment, but Woven applies microdom.escape() to the strings I return! Eric Radman theman@eradman.com article.py: ---------------------------------------------------- import os from twisted.web import microdom from twisted.web.woven import page from cStringIO import StringIO class MyPage(page.Page): · def getXMLDocument(self, request): · · global xmldoc · · · · try: · · · return xmldoc · · except: · · · code = request.args.get("code", [None])[0] · · · xmlfile = open(os.path.abspath("articles/%s.xml" % code), "r") · · · xmltext = xmlfile.read() · · · xmlfile.close() · · · xmldoc = microdom.parseString(xmltext) · · · return xmldoc · def wmfactory_Topic(self, request): · · return "Title" · · def wmfactory_Content(self, request): · · xmldoc = self.getXMLDocument(request) · · content = xmldoc.getElementsByTagName("content")[0] · · return content.toxml() · def wmfactory_Summary(self, request): · · return "Summary"
On Sat, 2004-01-10 at 15:10, Eric Radman wrote:
It seems that Woven escapes on all text returned by wmfactory_ methods. Can this behavior be changed? I would like to build a model function that returns an XML fragment, but Woven applies microdom.escape() to the strings I return!
1. Return a RawText widget. (twisted.web.woven.widgets.RawText("hello!") might work, IIRC.) 2. Woven is being replaced by nevow, sometime. 3. Please choose relevant subject for your emails. 4. twisted-web mailing list is probably better place for this question. -- Itamar Shtull-Trauring http://itamarst.org Looking for a job: http://itamarst.org/resume.html
1. Return a RawText widget. (twisted.web.woven.widgets.RawText("hello!") might work, IIRC.)
Woven seems to be expecting a string for a return value. This is what I
get:
2. Woven is being replaced by nevow, sometime.
I installed Twisted from CVS this evening and cannot find any library named 'nevow'. Is this still on the drawing board?
3. Please choose relevant subject for your emails.
OK
4. twisted-web mailing list is probably better place for this question.
Good point. Signed up to that list. Thanks for your help! E. Radman
On Sat, 2004-01-10 at 20:22, Itamar Shtull-Trauring wrote:
It seems that Woven escapes on all text returned by wmfactory_ methods. Can this behavior be changed? I would like to build a model function that returns an XML fragment, but Woven applies microdom.escape() to the strings I return!
Oh, wait, a model... Er. I'm not sure... maybe what I said works, maybe you need custom class with view of RawWidget set for it.
On Sat, Jan 10, 2004 at 08:10:37PM +0000, Eric Radman wrote:
Hi All,
Hi. Your mail client has decided that you are responding to a message in a thread about wxreactor. It probably did this because you had that message selected when you told it to compose mail, or because you selected reply rather than compose. Since your message is not actually about wxreactor, this is confusing and undesirable. In the future, please pay more attention to what you are asking your mail client to do, so that it is easier to find and understand the question you are asking. Thanks, Jp
On Fri, 2004-01-09 at 22:32, Jeethu Rao wrote:
Attached is a hack of Itamar's wxreactor, which uses another wxTimer to implement reactor.callLater. I even tried using the oft mentioned(on the wxPy list) wxCallAfter for reactor.callFromThread. But it tends to lag behind a lot, which is very unsuitable. Hence, the standard runUntilCurrent from SelectReactor is slightly modified and used.
Please add a "diff -u" to the bug tracker (twistedmatrix.com/bugs/), and I'll check it in when I have some time to look at it. -- Itamar Shtull-Trauring http://itamarst.org Looking for a job: http://itamarst.org/resume.html
participants (4)
-
Eric Radman
-
Itamar Shtull-Trauring
-
Jeethu Rao
-
Jp Calderone