So, this madness needs to stop at some point, so let's just fix the
reverse dependencies and get back in sync. This should be much easier
now that PyGObject makes tailing "allow-none" arguments optional and
accepts not specifying them explicitly at all. However, we must pay
attention as trailing arguments are now considered as user_data list,
and passed to callbacks.
[1] Skipping user_data and free_func:
python3 -c 'from gi.repository import GLib, Notify; Notify.init("test"); n =
Notify.Notification.new("summary", "msg"); n.add_action("my-id", "my_label",
(lambda n, id, userdata: print(id, userdata)), None, None); n.show();
GLib.MainLoop().run()'
Wrongly gives "None" as user-data in the callback on Ubuntu, but no
user_data callback argument at all with the upstream API.
[2] Specifying user_data, skipping free_func:
python3 -c 'from gi.repository import GLib, Notify; Notify.init("test"); n =
Notify.Notification.new("summary", "msg"); n.add_action("my-id", "my_label",
(lambda *u: print(u)), "foo"); n.show(); GLib.MainLoop().run()'
Gives "foo" as user_data in the callback for both upstream and Ubuntu.
[3] Specifying both user_data and free_func:
python3 -c 'from gi.repository import GLib, Notify; Notify.init("test"); n =
Notify.Notification.new("summary", "msg"); n.add_action("my-id", "my_label",
(lambda *u: print(u)), "foo", None); n.show(); GLib.MainLoop().run()'
Gives "foo", None as two user_data callback args upstream, but just
"foo" on Ubuntu, as the extra None is interpreted as free_func.
I checked all rdepends of gir1.2-notify-0.7. "n/a" means the package
doesn't use add_action() at all.
autokey: n/a
blueman: OK; explicit None user_data, callback ignores *args
firewall-applet: n/a
friends-dispatcher: n/a
gnome-music: OK (case [2]), explicit None user_data, callback expects one
user_data arg
gnome-tweak-tool: BROKEN on ubuntu (case [3]), supplies and expects two
user_data args
landscape-client-ui: n/a
lubuntu-software-center: n/a
mailnag: OK (case [1]), passes and expects 1 user_data
nautilus-pastebin: n/a
pitivi: n/a
solaar: n/a
system-config-printer-gnome: BROKEN on ubuntu (case [1]), supplies and expects
no user_data
transmageddon: n/a
unity-mail: n/a
unity8-autopilot: BROKEN with upstream, case [3], supplies two user_data,
expects one in callback
So in summary, we need to fix
tests/autopilot/unity8/shell/emulators/create_interactive_notification.py
in unity8-autopilot, then sync libnotify, then system-config-printer and
gnome-tweak-tool will get fixed and we finally are back to one and the
same API everywhere.
** Also affects: unity8 (Ubuntu)
Importance: Undecided
Status: New
** Changed in: unity8 (Ubuntu)
Assignee: (unassigned) => Martin Pitt (pitti)
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1223401
Title:
[0.7.6] the add_action api changed creating issues for clients
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/1223401/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs