Merge lp:~pitti/ubuntuone-client/gi-fixes into lp:ubuntuone-client
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Natalia Bidart on 2011-08-24 | ||||
Approved revision: | 1113 | ||||
Merged at revision: | 1112 | ||||
Proposed branch: | lp:~pitti/ubuntuone-client/gi-fixes | ||||
Merge into: | lp:ubuntuone-client | ||||
Diff against target: |
131 lines (+58/-25) 2 files modified
ubuntuone/platform/linux/notification.py (+28/-14) ubuntuone/platform/linux/os_helper.py (+30/-11) |
||||
To merge this branch: | bzr merge lp:~pitti/ubuntuone-client/gi-fixes | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Natalia Bidart | 2011-08-22 | Approve on 2011-08-24 | |
Martin Pitt (community) | Resubmit on 2011-08-24 | ||
Facundo Batista (community) | Approve on 2011-08-23 | ||
Review via email:
|
Commit message
Conditionally use GI or static gobject depending on whether gobject is already loaded. That way this module works with both static and GI programs. (LP: #829186)
Description of the change
pygobject >= 2.90 is now absolutely zero tolerant against importing both the
static and the GI version of a particular library. This was mostly the case
with 2.28 as well, but did work in some cases (like "import gobject; from
gi.repository import Gtk", in particular for "glib" and "gobject"). These now
cause errors as well.
With this fix we can use the library from both programs with static bindings
(gobject, gtk), as well as from programs which use the gobject-
bindings.
See bug 829186 for more details.
Martin Pitt (pitti) wrote : | # |
Unfortunately not. The conditional static/GI import needs to stay until all users of python-ubuntone are converted to use GI. With pygobject >= 2.90 you cannot mix static and GI imports, and the ubuntuone-
For the record, I also already had the test suite of this ported to GI. However, that does not work, as the test suite uses twisted, which uses static gtk/gobject modules. So I'm afraid for the time being the test suite can only check the static part here, not the GI part.
- 1112. By Martin Pitt on 2011-08-23
-
ubuntuone/
platform/ linux/notificat ion.py: Use GI Notify module when using GI
Martin Pitt (pitti) wrote : | # |
I also fixed the notification module to use gi.repository.
Martin Pitt (pitti) wrote : | # |
Natalia Bidart (nataliabidart) wrote : | # |
Code looks good, but there is a link issue here:
./ubuntuone/
34: redefinition of unused 'Notify' from line 28
To run the suite, please do the following:
./autogen.sh
make check
Thanks!
- 1113. By Martin Pitt on 2011-08-24
-
work around pyflakes complaint
Can't we leave the latest way only?
I mean, only do...
from gi.repository import Gio, GLib
...and use that.
Thanks!