Re: [pyxpcom] Python ScriptingComponent/PyXPCOMInterprocessCommunication
by Ryan Sturmer other posts by this author
Jul 10 2007 10:35PM messages near this date
view in the new Beta List Site
Re: [pyxpcom] Python ScriptingComponent/PyXPCOMInterprocessCommunication
|
[pyxpcom] Is it possible to override AddRef / Release for a PyXPCOM component?
So if I understand correctly, from my little python environment, there is
essentially *no* way of communicating data back to the javascript
environment that created it, other than 1) returning a value, say from my
pyshell.executePythonCode() function, or 2) modifying attributes of the
pyshell object that can later be read back from (ie: executing code that
modifies pyshell.stdOut, and exposing that attribute through my xpcom
interface so that it can be probed by my javascript code.)
I effectively cannot in any way set up javascript functions or members that
can be invoked or accessed from my insulated python exec() environment.
That sucks, but I am much further along in my understanding of this stuff!
Thanks!
-R
On 7/11/07, Mark Hammond <mhammond@[...].au> wrote:
>
> > Is there a mechanism by which I can selectively expose to him (via
> > the specification of specially crafted locals or globals to exec())
> > a means of accessing functionality in that parent javascript
> > environment. An example might be, I'd like to allow my user code
> > to exercise the javascript alert() function, or say, change the
> > text of a button in my user interface, or change the window title,
> etc...
>
> Not currently, no. Although if the 'document' and 'window' objects are
> available, many interesting things can still be done in Python via XPCOM.
> Non-XPCOM variables can't be referenced, and even for the XPCOM
> interfaces,
> some functions are implemented in a way that only make sense for JS, and
> can't be called by Python. IIRC, alert() is one example of that.
>
> The work I recently did on 'nsdom' gets us a little closer to that goal -
> you can use Python directly in XUL - but I don't think that will appear in
> firefox releases for some time.
>
> Mark
>
>
--
"The preceding program contained violent scenes of a graphic nature. Time
travelers with nervous dispositions may wish to listen to something else for
the past half hour."
-John Marsh
"The Hitchhikers Guide to the Galaxy"
Ryan Sturmer
ryansturmer@[...].com
http://www.gogglemarks.net/
Thread:
Ryan Sturmer
Mark Hammond
Ryan Sturmer
Mark Hammond
Ryan Sturmer
Mark Hammond
Ryan Sturmer
Mark Hammond
Ryan Sturmer
|