[Pyxpcomext] Display and Rendering Question
nhamiel at gmail.com
Thu Feb 25 09:38:34 PST 2010
I have a couple of questions about the display and rendering of HTML using
XUL with Python. For example in my XULrunner application, I want to
construct a request using httplib or httplib2 and display the return data in
both HTML source as well as rendered HTML.
So I would have something like so:
urlval = "http://python.org"
handler = httplib2.Http()
resp, content = handler.request(urlval, "GET")
I have some tabpanels set up with vbox's on them. What I would like to do
after the request for this content is made is take the content value, which
contains the HTML of the return response, and on one panel display the HTML
source (preferably syntax highlighted) and on other panel render the HTML.
It shouldn't matter how the HTML is retrieved though since at some point it
may be pulled from something such as a SQLite database or other storage
I am not sure of the best way to go about this. If there are any examples or
documentation anyone can point me to, it would be greatly appreciated. Sorry
if the answer is painfully obvious and there is something I am just not
I have even tried to use the browser object by instantiating it like so:
In my XUL file I have:
<browser id="browser" src="about:blank" flex="1" />
In my .py file I have:
browser = document.getElementById("browser")
However, when trying to use this an to say reload an error like so happens:
XPCOM component '<unknown>' has no attribute 'reload'
Anyway, I am stumped and I figured I would ask for help. Please let me know
if I need to provide more detail and I will gladly do so. Thanks in
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pyxpcomext