Ian Bicking | 8 May 16:35 2007

Re: [pyxpcom] PyXPCOM viability and OLPC

edward baafi wrote:
> This is interesting.. I use PyXpcom along with Xulrunner and currently
> have a B2 XO for development..

Well then, this may be leading in an obvious direction...

> In terms of a stripped down Firefox vs. PyXPCOM, I don't see why this
> would be an either/or as Firefox can be built with PyXPCOM support..
> Of course you need a stripped down browser in terms of memory
> footprint (the B2 only has 128MB of ram and the production version
> should have 256) and you need to add extra functionality and tie it in
> as a "Sugar Activity" so you should of course use python..
> So you can build a stripped down Firefox with PyXpcom support and add
> features and tie into sugar with python, or you can build a Xulrunner
> based browser from scratch with PyXpcom support.. Actually these
> aren't too different as Firefox 3 was supposed to just be an app
> running on top of Xulrunner although this feature shows up as "At
> Risk" in the Firefox3 features list:
> http://wiki.mozilla.org/Firefox3/Product_Requirements_Document#Gecko.2FPlatform 
> Given that there isn't much to the current "Web Browser Activity" on
> the XO, I would think that you could build a Xulrunner based version
> of that pretty quickly and then add features as needed (using PyXpcom
> if you like) rather than starting with all the features of Firefox and
> figuring out where to nip and tuck..  I like the Xulrunner plus
> PyXpcom approach as it would allow others to write Xul apps rather
> than use py/GTK which is probably too low level for many "Activity"
> developers..
(Continue reading)

Kenneth McDonald | 27 Jul 07:58 2006

-lpython2.4 build error (but I think I'm close!)

After installing a couple of libraries needed for the build, I think I'm 
very close to getting my moz/pyxpcom build working. Here is output 
before and reporting the error:

c++ -o xpcom.o -c  -DMOZILLA_INTERNAL_API -DOSTYPE=\"Darwin8.7.1\" 
-DOSARCH=\"Darwin\" -DBUILD_ID=0000000000 
-I../../../../dist/include/xpcom -I../../../../dist/include/string 
-I../../../../dist/include/pyxpcom -I../../../../dist/include 
-I../../../../dist/include/nspr       -fPIC   -fno-rtti -fno-exceptions 
-Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual 
-Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long 
-fpascal-strings -no-cpp-precomp -fno-common -fshort-wchar 
-I/Developer/Headers/FlatCarbon -pipe  -DNDEBUG -DTRIMMED -O   
-DMOZILLA_CLIENT -include ../../../../mozilla-config.h 
-Wp,-MD,.deps/xpcom.pp xpcom.cpp
rm -f lib_xpcom.dylib
c++  -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith 
-Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy 
-Wno-non-virtual-dtor -Wno-long-long -fpascal-strings -no-cpp-precomp 
-fno-common -fshort-wchar -I/Developer/Headers/FlatCarbon -pipe  
-DNDEBUG -DTRIMMED -O -fPIC  -o lib_xpcom.dylib  ErrorUtils.o PyGBase.o 
PyGModule.o PyGStub.o PyGInputStream.o PyGWeakReference.o PyIClassInfo.o 
PyIComponentManager.o PyIComponentManagerObsolete.o PyIInputStream.o 
PyIEnumerator.o PyIID.o PyIInterfaceInfo.o PyIInterfaceInfoManager.o 
PyISimpleEnumerator.o PyISupports.o PyIVariant.o Pyxpt_info.o 
TypeObject.o VariantUtils.o dllmain.o xpcom.o      -Wl,-dead_strip 
-dynamiclib -install_name  <at> executable_path/lib_xpcom.dylib 
-compatibility_version 1 -current_version 1 -L../../../../dist/bin 
-lxpcom -lxpcom_core -L../../../../dist/bin -L../../../../dist/lib 
(Continue reading)

Yingbo Qiu | 26 Jul 12:29 2006

few xpcom component can be createInstance

I have build a pyxpcom from thunderbird's source. and I want access
TB's addressbook from XPCOM.

I can use " <at> mozilla.org/supports-float;1" component
>>> f=components.classes[" <at> mozilla.org/supports-float;1"].createInstance(components.interfaces.nsISupportsFloat)
>>> f.data = '3.1415926'
>>> f.toString()
I get '3.141593', it looks great.

but when I try createInstance of ' <at> mozilla.org/addressbook;1', it
report "No such component ...."
>>>components.classes.has_key(' <at> mozilla.org/addressbook;1')
bool value is 'True'
>>>components.classes[' <at> mozilla.org/addressbook;1'].createInstance()
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in ?
    components.classes[' <at> mozilla.org/addressbook;1'].createInstance()
  File "C:\Python24\lib\site-packages\xpcom\components.py", line 191,
in createInstance
    raise xpcom.COMException(details.errno, "No such component '%s'" %
Exception: 0x-7ffbfeac (No such component ' <at> mozilla.org/addressbook;1')

then. i find in all 926 components, there are only 72 components can
be create instance successfully

why? howto enable other components ??
Kenneth McDonald | 25 Jul 22:24 2006

Checking on some basic concepts...

First, looks like Jed and I are coming from a similar place. Jed, are 
you interested on working together to try to get nsdom/pyxpcom compiled, 
and then figuring out how to actually use it?

Previous posts and responses have let me to believe I should check my 
understanding of some basic concepts. Here are some things I _think_ I 
know (and don't know). If I'm wrong, please correct me.

1) pyxpcom is what allows Python to call xpcom components. nsdom, on the 
other hand, is what allows Python to manipulate the DOM directly (and is 
what I'm interested in--I only want to be able to manipulate the DOM and 
catch and process mouse and keyboard events from python.) nsdom requires 
pyxpcom, but makes pyxpcom invisible to the nsdom programmer.

2) nsdom  presumably has a Pythonic version of the same API that JS uses 
to manipulate the DOM. nsdom is currently at a point where it is "pretty 
good" for actual use.

3) In order to build a version of FF with both pyxpcom and nsdom 
support, I need to download a current "trunk" release of Moz, do the 
mozconfig file thing adding whatever flags are needed to include 
pyxpcom/nsdom support into the build. The current trunk does not appear 
to be available as a tarball, according to the Moz site, so I'll need 
CVS to grab it. Can anyone direct me to a page giving CVS instructions 
for DLing Moz? Also, should I download the absolute most recent trunk, 
or is there a presumably more stable version I should DL instead?

4) Mark has provided a script that seems to aim at building 
pyxpcom/nsdom support against an already existing binary. But I don't 
know if it'll work against FF2, or if I need a build that already has 
(Continue reading)

Kenneth McDonald | 25 Jul 05:16 2006

Firefox 3? What? Can I build pyxpcom w/ FF2?

I (literally) just start d/ling FF2b1 source, and came across this in a 
recent pyxpcom message:

    >  *) Does anyone know what the state of pyxpcom is with Firefox 3.0
    >  or XULRunner?

    The state on the trunk is - umm - "good" :)

Heck, I didn't even know there _was_ a FF3 being worked on yet. At the moment, I'm just trying to do a build with
pyxpcom included--will the current v.2 be sufficient, or should I go to 3?


Kenneth McDonald | 24 Jul 22:03 2006

Repost of Mark Hammond's build script

Mark sent this to me in relation to my question about the build script, 
and since there's now at least one other person interested, I thought 
I'd just repost it in case yet more people wanted it. Might save a bit 
of emailing back and forth :-)


-------- Original Message --------
Subject: 	FW: Python binaries for mozilla
Date: 	Sun, 23 Jul 2006 04:11:40 +1000
From: 	Mark Hammond <mhammond <at> skippinet.com.au>
To: 	<kenneth.m.mcdonald <at> sbcglobal.net>

here you go.  Please forward back any worthwhile changes you make!



-----Original Message-----
From: Mark Hammond [mailto:mhammond <at> skippinet.com.au]
Sent: Saturday, 17 June 2006 1:51 PM
To: 'pyxpcom <at> listserv.ActiveState.com'
Subject: Python binaries for mozilla

I've been thinking about and playing with ways to create a Python XPI for
Mozilla.  As I've mentioned before, this XPI needs to bundle Python itself
along with the 'pyxpcom' and new 'nsdom' packages.  We don't want to rely on
a pre-installed Python (that places too much burden on the end user and too
much scope for error), but at the same time we want to co-exist with any
(Continue reading)

Jed Brown | 24 Jul 20:39 2006

Two pyxpcom requests and 1 question


1) Trent, could you also email me the script from the thread about 
building XPI's?
    I just signed up to this list and seem to have missed it by a day 
(and the archive doesn't have the attachments)

2) Jim, I would be very very interested in how you were able to build 
Firefox 1.5.x with python support and your installer.


*) Does anyone know what the state of pyxpcom is with Firefox 3.0 trunk 
or XULRunner?
    Will it be part of the default install? I'd really love to start 
writing extension in Python, however right now seems lik packaging is 
the huge issue.

Thank you so much


Jim wrote:
> Welcome to the pyxpcom <at> listserv.ActiveState.com mailing list!
> Well, I finally broke down and took all this stuff to my work computer. 
> It worked the first time - including the regression tests . So there is 
> something flaky with my Win XP - no idea what. Sounds like I'll be doing 
> a fresh reinstall of the OS this weekend :-(
(Continue reading)

Cyril Giraudon | 23 Jul 10:24 2006

Share objects without interfaces.


I'd like to know if it's possible to return an object (python, C++ 
instance) as a neutral pointer.
The pyxpcom object would implement the proper interface.

Javascript couldn't handle this object but could keep this "reference".

Then javascript could call an other xpcom method waiting for this object 
of a kind.

Conceptually speaking, is it a nonsense ?

For instance :
Imagine 2 xpcom (pyxpcom) objects A and B.
Given a python object c.

I'd like to do something  like this in javascript :

var a = Components.classes["A"].createInstance();
var b = Components.classes["B"].createInstance();

var c = a.getPythonObject();


If it's not possible, the second possibility would be to return a string 
reference of the python object since all pyxpcom objects share the same 
(Continue reading)

Kenneth McDonald | 22 Jul 07:02 2006

Where to find Mark Hammond's script to build XPI version of pyxpcom?

I hadn't yet joined the mailing list when the thread about building 
XPIs, and containing the script, was mailed out. I suspect I could 
probably learn some worthwhile buildy things from reading the script, so 
if anyone can send me a copy, I'd appreciated it.

Daniele Rizzo | 21 Jul 18:44 2006

pyxpcom & mplayerplug-in

i'm newby in mozilla and xpcom (pyxpcom) matters. I'd like with python 
(or javascript) the mplayerplug-in via-xpcom. Is it possible this? I've 
found a file mplayerplug-in.xpt in components file of my firefox 
browser. Is it possible create instance of this component via python?
Kenneth McDonald | 21 Jul 00:09 2006

Some beginner questions about pyxpcom/pydom.

I'd like to get pyxpcom and/or pydom setup, with the goal of writing 
some libraries to easy DOM manipulation, and writing some promised 
documentation for Mark. Since I'm not a "hardcore" (i.e. 
C/C++/make/svn/cvs...) programmer, I'm hoping to get some basic advice 
on getting this stuff working. Plus a few other questions.

First, what do we call the DOM-agnostic python :-) ? pydom?

On to the more serious stuff...

1) I'm on Mac OS X (Intel), so if anyone has comments about building on 
that platform, please feel free to offer them.
2) Do pydom and pyxpcom provide the same API to the DOM? Are there 
things that can be done with one but without the other? Given that pydom 
is likely to be "the future", I'd like to go to that way, but the choice 
may be dictated by current availability of features.
3) Can pydom or pyxpcom only be built against Mozilla, or can I build 
against Firefox for a "lighter" compile process?
4) What current branch should I download to compile? And if anyone can 
remember the proper svn command to download that branch, that'd be a 
help :-)

I attempted to compile Mozilla once before, as a precursor to getting 
this stuff installed, but the build failed and I didn't have time to 
track down the problem. As I say, I'm not much good with build issues, 
so I suspect that I'll be posting a few in the future...

(Continue reading)