The python script I used to test can be found here.
Just before running this I did the tail /dev/zero trick (with swap turned off) to "flush" the kernel cache.
As the graph quite clearly states, bonobo-activation-server is spending about one second listing directories, reading and parsing .server (xml) files. The gconfd-2 startup is probably not so bad (it used to be a lot worse), but I do wonder why it takes so long time to import gnomevfs.
When can we have DTrace for Linux?
18 May 2005 (updated 18 May 2005 at 12:49 UTC) »
import bank
import Poppler
doc = Poppler.Document('test.pdf', '')
pages = doc.getNPages()
print 'Document has', pages, 'pages.'
which prints out:
Document has 247 pages.
The Poppler module is built completely from the introspection information, the Document class and all its methods are created in runtime (not lazily yet though). The constructor maps to a C function, poppler_document_new_from_file which is invoked in runtime, with help of libffi, the reference is saved and sent to getNPages which calls poppler_document_get_n_pages.
Poppler is a pdf library, which I used as a testcase because that's the only library available which has introspection information written down, all thanks to jrb.
This stuff looks really good, it's a bit more complex then manually created bindings for python, but once it's finish it'll be a lot less work. We anticipate that the python bindings, in which most of the work can be done in runtime, will be dramatically reduced, perhaps to 20-25% of the size it has today.
If you're interested to look at this stuff, it can be found in the pybank module in gnome cvs.
There is not a lot too see yet though, unless you're also developing a language binding
Perhaps it's worth designing the python bindings after features found in recent python versions such as generators and decorators, which wingo wrote about a couple of days ago. You might also want to take a look at xmlrpclib, which is very easy to use, thanks to excessive getattr usage. Not sure if you want to walk down that road for D-BUS, but it's definitely worth looking at.
7 Jan 2005 (updated 7 Jan 2005 at 19:51 UTC) »
25 Oct 2004 (updated 25 Oct 2004 at 23:58 UTC) »
>>> obj = watch_directory('/apps/metacity/general)
>>> obj.get_property('theme')
'Metabox'
notify:: if you want to get notification if any/some properties changes. In Python, all it takes to get notifications for a directory is this:
>>> def notify_cb(obj, pspec):
... print obj, pspec.name, obj.get_property(pspec.name)
...
>>> obj.connect('notify', notify_cb)
As jamesh points out, I should probably separate the type creation and instantiation of the object, so it can be possible to point the type against a schema directory and instantiate over several different configuration directories.
The code can be found here, unfortunately it requires gconf from gnome-python CVS HEAD, due to some missing functions. If there is enough interest I might port this to C, because I think it would be useful to have it, in for example GConf itself.
PyGTK now supports all the beauties of GtkUIManager and GtkFileChooser. So start updating your code!
Over the last few days I've been writing bindings for the "new" nautilus extension API introduced a while ago. It can be checked out from gnome cvs, the module name is nautilus-python. I'd say that its a lot nicer than the old bonobo/corba based one. I also wrote a couple of examples, which can be found here I specially like the "Use as background image" context menu plugin. I wonder if we're going to see a new g-scripts site now..
27 Sep 2004 (updated 27 Sep 2004 at 21:53 UTC) »
pipeline = gst.parse_launch('{ cdparanoia ! osssink }')
pipeline.connect('eos', lambda p: gst.main_quit())
pipeline.set_state(gst.STATE_PLAYING)
gst.main()
The beauty of abstracting things away...
Great progress recently, you can do most normal things and some not so common. The GstPlay class is wrapped, so now can actually write a simple movie player in just 8 lines of code:
import sys, gst, gst.play
play = gst.play.Play()
play.set_data_src(gst.Element('filesrc'))
play.set_audio_sink(gst.Element('osssink'))
play.set_video_sink(gst.Element('xvimagesink'))
play.set_location(sys.argv[1])
play.set_state(gst.STATE_PLAYING)
gst.main()
If you have gst-ffmpeg installed, this is enough to play mpegs, avis, qts etc.
Hope I'll be able to do a release within the next couple of days.
2.2.0 was released the other week, lots of good stuff done recently by Xordoquy, Gustavo, Christian and Lorenzo. Feels like we finally have a bunch of stable developers. Some work to merge in the new widgets from Gtk+ 2.4 has already started. Hopefully it won't take another 6 months be fore PyGTK 2.4.0 can be released.Note that the three links for setting the source and sinks will probably go away as soon as I wrap the GConf stuff.
15-18 degrees and sun strongly shining sun for the last couple of days. I'm certainly not complaining.
27 Jan 2004 (updated 27 Jan 2004 at 22:04 UTC) »
I'm also in the way of integrating a nice little hack from glyph into PyGTK that makes life easier on win32. Unfortunately it'll only work for people using the Dropline installer. While investigating things a bit further with lgs, we found there are at least 3 different kind of installers for windows, kinda sad. Let's see if something can be done about that.
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!