Code review comment for lp:~pitti/ubuntuone-control-panel/gi-fixes

Revision history for this message
Martin Pitt (pitti) wrote :

@Rodney: The 'gobject' in sys.modules works very well, and it's indeed intended to check what is already loaded into the Python process; that's exactly what we need to know -- "has anything before us already imported gobject, or any other static binding depending on it?" (such as glib or gtk). This check has been applied to some 10 other library packages, and is also the one that upstream uses:

  http://git.gnome.org/browse/pygobject/commit/?id=65ac35cca8d24f4c1

> And it's not clear to me why the GLib.format_size_for_display() was removed.

Because we can't use GLib (it's the GI binding) when the program importing dbus_service already has loaded static bindings (gobject, glib). Unfortunately the static glib does not export this function, so we can't fallback to the static variant in this case.

I'll change the code to use humanize() instead, I wasn't aware of this.

« Back to merge proposal