Posts Tagged ‘gnome

31
May

SOC Report: Week 1

Well the first week of summer of code has finished. This week I spend my time evaluating and testing the various options available to (semi)automatically wrap C code (libsyncml) so that it is accessible from Python. My priorities when evaluating the options go something like,

  1. Capability - the tool should be able to (semi) automatically wrap a large majority of the libsyncml api. Any customizations required in order to make the wrapping more complete should be readable and maintainable by people other than myself.
  2. Documentation availablitly. Follows from #1, can I actually learn and use the tool within the SOC duration.
  3. The wrapping tool is actively developed.
  4. Does not introduce additional runtime dependencies other than the library being wrapped.
  5. Minimal compile time dependencies when creating the bindings.
  6. Community service value (i.e does the selection and use of the tool bring a positive benefit to the FOSS ecosystem greater than the actual library being wrapped).

The following is a list of available options I looked at (see cython for more explanation)

  • Pyrex
    Produce very nice and clean C file, which you just compile to .so and that’s it. Allows to wrap almost any C and C++ code. IDL is python-ish.
  • Cython
    The same as Pyrex, but some new nice features added
  • SWIG
    The defacto standard I guess. SWIG is one of the oldest and most mature methods of wrapping C or C++ code into Python (SWIG works for other target languages as well). SWIG produces a C file from an IDL, which gets compiled to a .so, but then it also produces a Python wrapper on top of this. Because Python wrappers are written for you, if their design is not exactly what you want, you end up doing more work to create your final Python API.
  • SIP
    Similar to SWIG, but only aimed at wrapping C and C++ to Python. Unlike SWIG there is no Python wrapper. Used by PyQT and PyKDE.
  • Boost.Python
    Writes C++. Not evaluated due to the additional dependencies required.
  • Ctypes
    Ctypes is included standard in Python 2.5. The IDL is typically a python class hiding the ctypes calls, making the API more pythonic. It allows one to call library functions defined in shared object libraries directory from interpreted Python code.
  • Py++
    It generates Boost.Python wrappers. Not evaluated.
  • f2py
    It’s mostly for wrapping fortran files, but it can also wrap C files, even though it’s not a very well-known feature. Not evaluated
  • PyD
    This works like boost.python, but for the D language. Not evaluated.
  • Interrogate
    This works similar to SWIG. It created dynamic link libraries that can be used both from python and c++ via the Python C API. No other files are needed. Its not very well documented but is used in several commercial mmorpg’s and is native to the Panda3d engine. Not evaluated.
  • Robin
    Insufficient documentation to evaluate.Similar approact to swig, sans the intermediate IDL.
  • PyBindgen
    The IDL is itself python, and it generates clean readable dependency free C code. Designed for wrapping C++, but has some support for wrapping C libs.
  • pygobject (codegen.py and h2defs.py)
    The Gobject way, and the way I am most familiar. Unfortunately, in order to wrap the libsyncml library I would first need to wrape it in GObject.

Conclusions

The libsyncml library uses the Gobject mainloop, and custom error types. In order to integrate this with pygtk applications It would need to link to Pygobject/C, and propogate the error types to exceptions.

Somewhat unsurprisingly, the weak point in almost all of these approaches is there documentation. While I like the look of PyBindgen, it is a nightmare to build, and docs are sparse. The SWIG IDL is hairy, and one must also maintain pythonic wrappers to make a nice library. Pyrex and friends do not seem suited to the integration of libsyncml and pygobject without additional C glue

At this stage I am leaning towards SWIG, for community service value (others can come along after and make C# wrappers for instance), its availability of documentation, and even if the IDL is quirky, others are familiar with it.

Distributed Version Control Systems and visibility of development

My opinion on the ‘best’ DVCS is not relevant. What I am concerned about is that if GNOME does not pick one, and/or provide some sort of hosting or method to track other peoples development branches then the visible activity level, and subsequently health of the whole project will suffer.

The premise here is that centralized version control systems make it easy to follow what developers are working one, and the activity level of development, via the svn-commits mailing list for example.

I can only offer anecdotal evidence here, but I think that the visibility a projects development is just as important as the actual rate of development being done.

  • If developers cannot see what other people are hacking on, then there is the potential for duplication of work, or conflicting implementations.
  • If users do not see people actually doing work, then there is a tendency to assume the project is ‘abandoned’ or dead. The only thing worst than a ‘dead’ project is being proclaimed as such when one is not.

I consider the plethora of ways one can follow what developers are doing part of the problem, not part of the solution.

Who has time to follow planet, IRC, github, repo.or.cz, freedesktop git, launchpad.net bzr, mailing lists, twitter, $COMPANY gitweb, $PERSONAL gitweb, $DISTRO viewvc and gnome.org/$USER_HOME_DIRĀ  to see what people are working on.

This post is not meant to be Reductio ad absurdum, its just a slight generalization of why I read planet.gnome.org/svn-commits, etc, etc.

  • Part of the reason is to see what other hackers are up to.
  • Part is academic, to learn techniques and design from some of the great hackers on here.
  • Part is flagrant procrastination.
  • The small remaining part is the keep the voice in my head thats says “you should be using KDE, it appears to be more actively developed” at bay.

Conclusions, if any;

  • planet.ubuntu.com seems to have excellent visibility of active development, even if it doesn’t have as many developers as other distributions.
  • freedesktop (via planet.freedesktop.org and http://gitweb.freedesktop.org/) seems to have excellent visibility of development (many people put git branches in their home directories, which are subsequently picked up by gitweb).
  • I am not advocating activity over productivity (obviously we are all free to use the tools which allow us to be the most productive, not just appear the most active). I just think that public FOSS development is an interesting space, in many ways the developers of the products are the marketers of it.
  • GNOME used to have the balance of visibility about right, but I think we are losing that with all this dilution.

Change scares me. That is all.

16
Jan

Back To Reality

Conduit 0.3.5: Enough Excuses

I am a terrible project maintainer. It has been a full 3 months since the last Conduit release, and I have run out of excuses. First I got distracted by online desktop shenanigans, then by Opensync and Ubuntu things. I got caught up in moving Conduit to GNOME SVN. Then I got distracted by JHBuild on windows. Finally I lost my nerve and went on holiday, not touching a computer for 3 weeks. Enough is enough!

The good news however is that there is no doubt in my mind that this is the best Conduit release ever. I’m using Conduit on a daily basis for a variety of tasks, and its looking really solid. Yes there are still some bugs, but thats life. So, no screenshots this time, just a list of shiny new features. Over the next few weeks I will be doing a series of “look what you can do with conduit” type posts, as this is probably the best way to demonstrate to folks what they can accomplish with a generic sync+conversion framework, with a focus on integration with the desktop environment and great support of online services!

  • Release Notes
  • Download
  • Report Bugs
  • Whats New
    • Move to GNOME SVN and Bugzilla
    • In memory mapping DB has been replace with sqlite based one. Should reduce memory usage during large sync’s.
    • Restructure code layout to allow Conduit to be used as a library by other python programs.
    • Removed Gtk dependancy in core. Conduit command line can now be run without Gtk installed.
    • Added ‘always up to date’ infrastructure for automatic syncing.
    • Improved n800 support for syncing audio, video and photos to the device.
    • New AudioVideoConverter for transcoding media types (uses FFMPEG and/or mencoder)
    • Include Banshee support in configure.ac - from lool
    • Support data hashes in addition to mtimes as a means for detecting changes
    • Remove twisted dependency for network sync. Uses the built in python xmlrpc module
    • Use python logging module for better logging granularity
    • Make HAL easier to extend in dataprovider factories
    • Files that did not load correctly are shown in the preferences window to help debugging
    • Experimental maemo/hildon UI (Thomas)
    • Added iPod photos support
    • Write support in f-spot using its new dbus interface (Thomas)
    • Support tags in all datatypes (useful for images)
    • Incredible improvements in test coverage. 75% lines of core code tested (including close to 100% of the core sync engine)
    • RSS Feed source now supports video enclosures
    • Many many bug fixes as a result of test focus

As more people start to use conduit I am becoming more conservative and focusing a lot more on testing. One aspect of this is a machine I have set up that runs the test suite every time there is a commit. The other aspect is more regular releases. For the former look here, for the latter please test and give me feedback!

Team conduit is well poised for a 0.4.0 release to coincide with GNOME 2.22.

Holidays

It feels strange to be back at university after a solid 3 weeks of doing very little. I had the best summer holiday I have had in a long time. Considerable thanks must go to the weather in New Zealand, its great to finally have the good weather in December. Anyway here are some holiday snaps for those that are curious about what a summer Christmas/New Year in New Zealand looks like.

My Christmas Present
My Christmas Present

Relaxing on the Jetty
Relaxing on the Jetty

Sunset
Sunset at the Bay Of Many Coves

Diving
Hunter Gatherer

31
Oct

One Thousand

Conduit recently reached 1000 commits, and with it came together some functionality that has been brewing for a while.

  • Far far far improved nokia n800 support
    • You can now sync files, photos, music, and videos to your nokia n800 in an intelligent way (i.e. its not just a dumb file/folder sync).
    • The ability to transcode said data to the most appropriate format for the device. FFmpeg/Mencoder is used to transcode audio/video, and gtk.Pixbuf is used to convert photos. The converters use conduits built in dynamic modular plugin system, so if someone wants to write a audio video converter using GStreamer then please contact me.
    • Also, those that are familiar with FFmpeg/Mencoder/Transcoding please feel free to contribute preset encoding profiles (video codec, size, etc). Presets are stored here (video), here (audio) and here (photo).

Another one of those conduit screenshots that always look the same

  • Looser dependence on gtk. This means that conduit can be run from a console (-c command line switch) without gtk/goocanvas installed. This reduces the memory usage by about 10Mb!
  • Massive refactoring effort to aid more code sharing between dataproviders and the complete decoupling of the GUI from the core application. This allows other guis to written very independently of the rest of the application [1]. Stay tuned for a native hildon gui for nokian800 and/or ubuntu mobile.
  • Rhythmbox support. A simple dataprovider has been added that is able to sync rhythmbox static playlists with things. Initially this is used to test sync music with n800 (with the ability to transcode audio formats), but in my ideal world, sync with rhythmbox would involve
    • Improving rhythmboxes DBus interface to support adding/removing songs to the library and querying playlists (including smart playlists).
  • Remember because we are gnomevfs aware some cool things are possible. For instance, one can sync + transcode videos/music to/from their phone which is mounted using gnomevfs-obex.
  • Work is currently proceeding furiously on
    • Integrating with opensync
    • Removing the twisted dependence, and using pythons built in xml-rpc server for network synchronization
    • Replacing our current in memory database with one based on sqlite
    • Support for iPod photos
    • Test coverage andbug fixing.

Anyway, svn HEAD is pretty rocky at the moment, but please experiment. Once the database changeover has taken place things should stabilise for a 0.3.5 release. This will be a release candidate and then we will focus on bug fixing only.

Ideally we will release a stable 0.4.0 release at or before gnome.conf.au. As an aside, I would be interested in talking to any of the RH online desktop folks at linux.conf.au as I am unable to make it to any of the northern hemisphere conferences on account of me being poor and in New Zealand.

[1] Excluding a dependence on gnomevfs (yuck). Hopefully gio/gvfs will make all my dreams come true.

25
Sep

What Ever Happened To?

There are a number of lively discussions currently going on in desktop-devel with regard to new module proposals [1]. This reminded me of a few projects I used to follow that I have not heard from in a while. Hoping not to offend any of the developers I therefore ask,

What ever happened to?

  • Gnome Formatter
    A HAL pretty formatting utility, so I may finally easily format my USB keys. Description here, and here
  • GSmartMix + PulseAudio + LibSydney
    A dream bunch of projects providing policy for sound devices. GMartMix lives between gstreamer and pulseaudio (i hope…) to allow applications to mute, pause, and have per application volume control, although the latter may be the domain of Pulseaudio. LibSydney said to replace esd in GNOME (finally, down with cruft).

Anyway, its great to see the action on ddl, and the excitement surrounding GNOME again. I look forward to the next release. I will be releasing a Conduit 0.3.9 (the RC before 0.4.0) this weekend, and here is a hint about my next blog post: Conduit as a blessed GNOME dependancy, how can we integrate Sync into the desktop?

[1] I am also hoping that tracker and/or xesam gets proposed this cycle.

03
Sep

Expanding the Sync Space

No screenshots this time, but still good news. Conduit tries to be a good citizen, integrating itself with GNOME technologies. Recently the following hacking has been going on (not all items are complete)

  • A Eye Of Gnome plugin allowing photo upload/sync to Flickr, Picasa, SmugMug, Facebook (soon)
  • Gnome user documentation
  • Themable icons
  • Patches to improve FSpots DBus interface to allow two way syncs with photo sites
  • Continued work on OpenSync integration. We have limited support for arbitary opensync plugins!
  • Canola, n800, Rhythmbox and general music synchronization

There have also been some new contributions

  • Two way support for Flickr, Picasa and Smugmug. Now you can move your photos between sites (AKA move my data)
  • A youtube dataprovider (sync your fave videos each morning)
  • Google calendar support (sync evolution with google calendar, iPod, etc)

Anyway if you are looking to get involved with Conduit now is a great time. I have just updated the docs on how to write a dataprovider. Here are some ideas for dataproviders people may wish to write (hint hint)

There will be some new features landing in trunk soon that will allow arbitrary parameters during the conversion process, i.e. transcoding audio/video to another format, resizing photos, compressing files, etc. Watch this space, download conduit, and go tell people it rocks!

16
Aug

Conduit Is Online Desktop

After a short hacking hiatus, soul searching, and general uncertainty regarding Conduits place in the Gnome Online Desktop plan, we the Conduit developers have decided to keep doing what we do best; adding awesome features, and making Conduit into the best desktop synchronization service for the free desktop. I invite you all to spot the new features in the image below;

Conduits New Features

Going through the new features one by one;

  • The Network datasink - thats how you tell conduit to share data to other people on the network
  • The chad.local dataprovider - … and thats how you’ll choose to consume other peoples shared data
  • The evo2-sync dataprovider - before long you’ll be able to use opensync plugins in conduit
  • The f-spot dataprovider - before long that will be two-way and networkable, work is ongoing with upstream
  • Always-Up-To-Date is on the horizon (i.e. auto update and sync changed data)
  • iPod photos support - our patches are accepted upstream, so soon we will support those too
  • The facebook dataprovider - just photos so far, but more facebook features will be exposed soon

Other than those Massive New Features, there has been continued bug fixing and some improvements to the DBus interface to make it more Havoc Compliant. Check out the sample below for how to use Conduits DBus interface to synchronize things…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
bus = dbus.SessionBus()
 
#Create an Interface wrapper for the remote object
remote_object = bus.get_object(APPLICATION_DBUS_IFACE,"/")
app = dbus.Interface(remote_object, APPLICATION_DBUS_IFACE)
 
#get a dataprovider
path = app.GetDataProvider("TestSource")
source = dbus.Interface(
bus.get_object(DATAPROVIDER_DBUS_IFACE,path),
DATAPROVIDER_DBUS_IFACE
)
 
#get another
path = app.GetDataProvider("TestSink")
sink = dbus.Interface(
bus.get_object(DATAPROVIDER_DBUS_IFACE,path),
DATAPROVIDER_DBUS_IFACE
)
 
#get a conduit
path = app.BuildConduit(source, sink)
cond = dbus.Interface(
bus.get_object(CONDUIT_DBUS_IFACE,path),
CONDUIT_DBUS_IFACE
)
 
print "Synchronize the conduit"
cond.Sync()

I have written an example which shows how to use Conduit to upload photos to any of our supported photo sites with even fewer lines of code. The DBus API documentation lives at the top of this file. Dont forget that by using a desktop wide sync framework you get all the Conduit bling for free, including

  • Don’t upload duplicates
  • Newer photos replace older ones
  • Asynchronous and all authentication is handled by Conduit
07
Jun

Misc Updates

Conduit

For all those that are interested I just released Conduit 0.3.1, the second development release in the series. The release includes a heap of bug fixes and some interesting new features including;

Goals for the next release include

  • Supporting box.net
  • Google notes support
  • 100% test coverage of the core sync engine

The thing that keeps me interested in conduit is the speed at which we are progressing. Each new dataprovider added has a benefit proportional to the number of already included dataproviders; for instance adding evolution support opened up the ability to do tomboy notes <–> evolution memos, as well as evolution memos <–> ipod notes, etc.

Gnome Link Drop

Here are some interesting things on the horizon that made me excited about GNOME and gtk. Delegated to people with more free time and ability than me!

Anyway, Im still on holiday, and loving it!

10
Mar

Conduit Architecture and Updates

A lot has been happening on the Conduit front of late, and I probably should have blogged about it earlier. Unfortunately, it has seemed as though I have made 5 steps forward and 4 steps back with every hour of work on the project, so why, and whats up?

Background

I will be dropping a 0.3 release to coincide with the release of GNOME 2.18. This will be a developer release designed to get things working well before a stable 0.4 release some time after.

All of Conduits synchronization capability is determined at runtime. Conduit scans the users’ and the system wide dataproviders directories in the same way that Deskbar loads handlers when it starts. The core synchronization logic is decoupled from the dataproviders, and only those relevant dataproviders are shown to the user (i.e. only show iPod Notes if an iPod is connected, etc).

Remember that I want Conduit to be a GNOME wide synchronization service that other applications can hook into, so I need to not only decouple the core sync logic from the application and usage specific dataprovider back ends, but also allow conduit to be extended by third parties.

Extension by 3rd Party Applications

I mentioned that all synchronization capability is determined at runtime. The other half of this story is that a third party may wish to synchronize something that Conduit knows nothing about (I’ll use a Jokosher project as an example, although in my next post I will address these issues in the Tomboy case). Lets assume that a Jokosher project cannot be described in terms of the basic types of data that Conduit knows about (email, contact, file, etc). In order to allow Jokosher projects to be synchronized between different computers the Jokosher developers would need to do the following

  1. Define a Jokosher datatype that describes what it is to be synchronized.
  2. (optionally) Define some conversions between the Jokosher datatype and the basic Conduit datatypes (File, Text, etc)
  3. Define a dataprovider that encapsulates Jokosher invocation specific information such as the Jokosher user, and how does one go about extracting/modifying Jokosher specific data when Jokosher may be running.

The Conduit framework will do a lot of heavy lifting here, such as caching modification times, providing a way for the user to configure a Jokosher sync partnership, providing a way for a user to resolve conflicts, and even allowing the whole sync process to be controlled from outside of the application over DBus. Most interestingly however, depending on the fidelity and number of conversions specified in #2, Conduit will facilitate a number of other useful sync scenarios including,

  • Sync Jokosher projects via any gnomevfs compatible location (ftp, etc)
  • Sync via Amazon S3 (coming soon)
  • Sync via USB key
  • Sync directly over a local network using Avahi. (next release)

The point here is that this decoupling of the dataproviders, from the core and the datatypes (sans the conversion functions) lets the Jokosher dataprovider take advantage of any/all additional $FUTURE dataproviders (e.g. Amazon S3) and all improvements to the Conduit core (such as direct sync using pickle’d python over network via Avahi).

Testing

As I get closer to release I get more nervous about releasing a tool which will could eat peoples data. To mitigate this risk I spent a week or two implementing an extensive testing framework for Conduit, a task I should have tackled much earlier in the project.

Unfortunately the testing is made more complicated when the applications capabilities can change between invocations (dynamic loading of dataproviders and conversions explained earlier). Aside from the usual unit level tests (does this throw the correct exceptions, etc) I am also required to test the fidelity and accuracy of the conversions between datatypes (round trip comparisons), and the fidelity of synchronization from dataprovider $FOO to dataprovider $BAR via any of these datatypes.

The testing framework uses a mixture of python and shell script, and is even web 2.0 compliant ;-). It currently tests available conversions, saving and getting data from various dataprovider back ends (Flickr, gnomevfs, Tomboy, etc). It even does code coverage and pushes the results on line.

What’s Next

I apologize for this post being mostly academic in nature, lacking in screen shots. I will post again in a few days with some more relevant information (from a users perspective). I just wanted to highlight how and why I believe a desktop sync service is useful, and how I am trying to satisfy this in a sustainable way for the GNOME platform as a whole.

I anticipate finishing up the two way Tomboy support (via iPod notes, gnomevfs location, and backpackit.com) in the next few days. There are some bugs preventing running Conduit on Feisty (goocanvas 0.6.0 is ABI incompatible with 0.4.0). There are also some other lose ends (like some GUI blocking calls in conflict resolution, and some difficulties saving program configuration). Unfortunately, like a lot of FOSS, the best is always just around the corner….

06
Feb

A Metadata Enabled GNOME

When Tracker was proposed for GNOME 2.18 I was one of its staunchest supporters, arguing that a GNOME wide unified metadata storage system would enable a richer desktop experience, and take GNOME beyond its competition. Tracker did not make the cut for GNOME 2.18, and will no doubt be proposed again for GNOME 2.20.

To help people see the potential of a GNOME desktop using Tracker I have been working on two projects for the past little while. Both of these are components of my larger vision of a metadata rich GNOME desktop. These initial attempts just focus on making tagging [1] a more consistent experience for all GNOME apps. Consider the examples and screenshots (for a file called nice) below;

  • Freedesktop emblem spec
    Allows desktop file managers and indexers to present a list of predefined emblems and tags to the user, and allows these predefined emblems/tags to be installed by third party developers in a consistent manner.
  • Tracker Nautilus Integration
    Nautilus using tracker for storage of all tags and emblems.
  • libtracker-gtk
    A bunch of gtk widgets that application authors can use to add tracker functionalit to their application.

Nautilus Tracker Intergration A Tracker connected GtkListStore A GtkEntryCompletion widget

Industrious individuals could probably find the bzr repositories for the above work, but at the moment it is not quite ready for prime time consumption. Stay tuned for more news.

[1] Terminology:

  • Tag: A descriptive keyword the user has associated with a file
  • Emblem: A tag with an associated image
26
Jan

Bling to Get Excited About

Some interesting things have popped up in the FOSS world in the last few weeks. Some of you may have seen these, others may not;

Metacity with composite supportConduit status icon and detachable conflict window