[OLPC-Games] [OLPC library] Curly Logo / OLPC
Don Hopkins
dhopkins at DonHopkins.com
Wed Nov 28 16:16:42 EST 2007
Erik Blankinship wrote:
>
> The parts for interacting with the journal and sharing could be
> written
> in python. With pyxpcom, a xpcom component could be written that
> gives
> access to JS to all the services in sugar.
>
>
> Is pyxpcom installed? Is there an example of this running right now?
That's a great idea: making a bridge between JavaScript and Sugar with
pyxpcom, so you can host JavaScript/DHTML/AJAX applications in Sugar,
Python can call JavaScript code and manipulate the DOM tree in the web
browser component, and JavaScript can call Python code to interact wit
the Sugar libraries.
That would be extremely useful for the eBook reader, and would also make
it much easier to package AJAX applications like Curly Logo into Sugar
activities.
There's been some interesting discussion about it on the pyxpcom and
sugar mailing lists:
Start of the thread:
http://aspn.activestate.com/ASPN/Mail/Message/pyxpcom/3474458
Ian Bicking wrote:
http://blog.ianbicking.org/what-im-up-to-jun07.html
"I didn't do any of it, but PyXPCOM
<http://developer.mozilla.org/en/docs/PyXPCOM> is in the Sugar browser
now (Sugar is the OLPC UI). This excites me, except then I looked at the
code and I couldn't figure out how to get access to any interesting
XPCOM objects (the DOM in particular) -- XPCOM seems very indirect. Oh
well, at least now it's /possible/ and I just have to figure out the
details. I hope/want/am-optimistic that OLPC will have a great browser
experience. It doesn't yet."
OLPC News:
http://lists.laptop.org/pipermail/community-news/2007-May/000058.html
17. Ebook: Josh Gay and Ian Bicking spent two days at OLPC working
through our infrastructure for recording and aggregating comments.
Josh is currently finishing a port of Stet, the 'heat map'-style
commenting system used for the GPLv3 draft, which will be usable for
commenting on any web page(See
http://gplv3.fsf.org/comments/gplv3-draft-3.html). Ian is looking into
a simple reader interface that renders any HTML page, not only those
that have been preprocessed, as a way of integrating our current
book-reader concept more neatly with the browser. Marco Gritti and Ian
suggested pyxpcom might be the right way to proceed, with some success
(See http://mailman.laptop.org/pipermail/sugar/2007-May/002396.html).
http://mailman.laptop.org/pipermail/sugar/2007-May/002396.html
[sugar] Pyxpcom
*Marco Pesenti Gritti* mpg at redhat.com
<mailto:sugar%40laptop.org?Subject=%5Bsugar%5D%20Pyxpcom&In-Reply-To=>
/Thu May 10 19:34:11 EDT 2007/
* Previous message: [sugar] Obtaining Buddy objects as contacts are
encountered
<http://lists.laptop.org/pipermail/sugar/2007-May/002404.html>
* Next message: [sugar] Pyxpcom
<http://lists.laptop.org/pipermail/sugar/2007-May/002397.html>
* *Messages sorted by:* [ date ]
<http://lists.laptop.org/pipermail/sugar/2007-May/date.html#2396>
[ thread ]
<http://lists.laptop.org/pipermail/sugar/2007-May/thread.html#2396>
[ subject ]
<http://lists.laptop.org/pipermail/sugar/2007-May/subject.html#2396>
[ author ]
<http://lists.laptop.org/pipermail/sugar/2007-May/author.html#2396>
------------------------------------------------------------------------
Hello,
so, Mark Hammond answer to the thread on the pyxpcom mailing list is
*very* encouraging.
http://aspn.activestate.com/ASPN/Mail/Message/pyxpcom/3474458
I think we should really try it. The potential is big (being able to
access the whole mozilla API directly from python open a tons of
possibilities).
Without having played with it a lot, my feeling is that the technology
is mostly there. It just needs to be used and documented to get more
mature and accessible.
The first step is to get it building on the trunk. Bridging it to
gtkmozembed looks trivial then.
Anyone feels like giving this a try? I don't have a lot of time these
days but I'd be glad to give some guidance. Getting this to work might
provide an awesome piece of infrastructure to the project, without a lot
effort!
Marco
http://lists.laptop.org/pipermail/sugar/2007-May/002402.html
[sugar] Pyxpcom
*edward baafi* edwardbaafi at gmail.com
<mailto:sugar%40laptop.org?Subject=%5Bsugar%5D%20Pyxpcom&In-Reply-To=c823aafb0705101808v720f27a5k5a3ab09328c77ead%40mail.gmail.com>
/Fri May 11 00:41:48 EDT 2007/
* Previous message: [sugar] Pyxpcom
<http://lists.laptop.org/pipermail/sugar/2007-May/002397.html>
* Next message: [sugar] Pyxpcom
<http://lists.laptop.org/pipermail/sugar/2007-May/002403.html>
* *Messages sorted by:* [ date ]
<http://lists.laptop.org/pipermail/sugar/2007-May/date.html#2402>
[ thread ]
<http://lists.laptop.org/pipermail/sugar/2007-May/thread.html#2402>
[ subject ]
<http://lists.laptop.org/pipermail/sugar/2007-May/subject.html#2402>
[ author ]
<http://lists.laptop.org/pipermail/sugar/2007-May/author.html#2402>
------------------------------------------------------------------------
Marco,
[...geeky technical stuff...]
Try that and you should build just fine.. I'm happy that you've
decided to do the right thing.. Remember that we can't judge Mark's
extensions based on the platform that he develops on top of.. I may
not like Windows but all of Mark and Thomas Heller's extensions make
it a breeze to work there (I'm just glad I don't have to build Vista)
Anyway, now that we've gotten building the trunk out of the way, can
you describe what you're trying to do with gtkmozembed? There are a
lot of players involved (sugar services, xpcom, pyxpcom, gecko, gtk,
gtkmozembed, pygtk, the python gtkmozembed wrappers, nsiWebBrowser,
etc) and I don't have a clear picture of what you're trying to do
-Ed
http://lists.laptop.org/pipermail/sugar/2007-May/002403.html
[sugar] Pyxpcom
*Don Hopkins* dhopkins at DonHopkins.com
<mailto:sugar%40laptop.org?Subject=%5Bsugar%5D%20Pyxpcom&In-Reply-To=c823aafb0705102141r6b13d516t47011440bdda65c1%40mail.gmail.com>
/Fri May 11 02:14:37 EDT 2007/
* Previous message: [sugar] Pyxpcom
<http://lists.laptop.org/pipermail/sugar/2007-May/002402.html>
* Next message: [sugar] Pyxpcom
<http://lists.laptop.org/pipermail/sugar/2007-May/002415.html>
* *Messages sorted by:* [ date ]
<http://lists.laptop.org/pipermail/sugar/2007-May/date.html#2403>
[ thread ]
<http://lists.laptop.org/pipermail/sugar/2007-May/thread.html#2403>
[ subject ]
<http://lists.laptop.org/pipermail/sugar/2007-May/subject.html#2403>
[ author ]
<http://lists.laptop.org/pipermail/sugar/2007-May/author.html#2403>
------------------------------------------------------------------------
>/ Then it builds just fine!
/>/
/Right on!!!
>/ Try that and you should build just fine.. I'm happy that you've
/>/ decided to do the right thing.. Remember that we can't judge Mark's
/>/ extensions based on the platform that he develops on top of.. I may
/>/ not like Windows but all of Mark and Thomas Heller's extensions make
/>/ it a breeze to work there (I'm just glad I don't have to build Vista)
/>/
/Mark Hammond's win32com Python OLE/ActiveX integration stuff is top
notch quality, excellent hard core code -- an industrial strength tour
de force! Its deep scope and the wide range of complex Windows COM
interfaces that it covers is truly amazing. You can actually use it to
implement ActiveX controls (OLE/COM servers) in Python, embed JScript
interpreters via IScriptingEngine, and other tricky stuff like that.
I've used it to integrate Python with Internet Explorer on Windows, so
Python can reach in and mess around with the DOM tree via OLE
Automation. Much easier and more powerful than trying to do everything
by remote control via http/xml/ajax/etc. It works quite well, and is
extremely magical, but of course it's a sausage factory inside. (That
comes with the territory.)
The fact that Mark Hammond is the person behind pyxpcom is why I can
trust that pyxpcom is good solid technology, because he knows what he's
doing and has been down that road before. (There aren't a lot of other
people in the world with his experience and track record.) I think it
would be a great idea and an excellent investment to use and develop
pyxpcom for the OLPC project.
>/ Anyway, now that we've gotten building the trunk out of the way, can
/>/ you describe what you're trying to do with gtkmozembed? There are a
/>/ lot of players involved (sugar services, xpcom, pyxpcom, gecko, gtk,
/>/ gtkmozembed, pygtk, the python gtkmozembed wrappers, nsiWebBrowser,
/>/ etc) and I don't have a clear picture of what you're trying to do
/>/
/>/ -Ed
/>/
/Just to be able to go browser.document.body.innerHTML = '<p>Hello
World!</p>' would be a great start! Even better would be a way for
Python to handle unsolicited events from JavaScript.
-Don
http://lists.laptop.org/pipermail/sugar/2007-May/002416.html
[sugar] Pyxpcom
*Marco Pesenti Gritti* mpgritti at gmail.com
<mailto:sugar%40laptop.org?Subject=%5Bsugar%5D%20Pyxpcom&In-Reply-To=464409CD.2090409%40DonHopkins.com>
/Sun May 13 10:17:04 EDT 2007/
* Previous message: [sugar] Pyxpcom
<http://lists.laptop.org/pipermail/sugar/2007-May/002415.html>
* Next message: [sugar] [PATCH hardware-manager] Allow setting the
DCON source.
<http://lists.laptop.org/pipermail/sugar/2007-May/002398.html>
* *Messages sorted by:* [ date ]
<http://lists.laptop.org/pipermail/sugar/2007-May/date.html#2416>
[ thread ]
<http://lists.laptop.org/pipermail/sugar/2007-May/thread.html#2416>
[ subject ]
<http://lists.laptop.org/pipermail/sugar/2007-May/subject.html#2416>
[ author ]
<http://lists.laptop.org/pipermail/sugar/2007-May/author.html#2416>
------------------------------------------------------------------------
On Thu, 2007-05-10 at 23:14 -0700, Don Hopkins wrote:
>/ Just to be able to go browser.document.body.innerHTML = '<p>Hello
/>/ World!</p>' would be a great start! Even better would be a way for
/>/ Python to handle unsolicited events from JavaScript.
/
Right, this is exactly what I want.
I think I figured out a way to do it, it seem to work well too :) I
should be able to integrate it in sugar this week.
Marco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/games/attachments/20071128/ec9ea55b/attachment-0001.htm
More information about the Games
mailing list