X2Go Bug report logs - #989
pyhoca-gui fails to fall back to Gtk-2.0 notifications (pynotify)

version graph

Package: pyhoca-gui; Maintainer for pyhoca-gui is X2Go Developers <x2go-dev@lists.x2go.org>; Source for pyhoca-gui is src:pyhoca-gui.

Reported by: Ondřej Grover <ondrej.grover@gmail.com>

Date: Sun, 31 Jan 2016 08:05:02 UTC

Severity: normal

Found in version

Full log

🔗 View this message in rfc822 format

X-Loop: owner@bugs.x2go.org
Subject: Bug#989: [X2Go-Dev] pyhoca-gui fails to fall back to Gtk-2.0 notifications (pynotify)
Reply-To: Mihai Moldovan <ionic@ionic.de>, 989@bugs.x2go.org
Resent-From: Mihai Moldovan <ionic@ionic.de>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Thu, 04 Feb 2016 23:25:01 +0000
Resent-Message-ID: <handler.989.B989.145462804122757@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: followup 989
X-X2Go-PR-Package: pyhoca-gui
Received: via spool by 989-submit@bugs.x2go.org id=B989.145462804122757
          (code B ref 989); Thu, 04 Feb 2016 23:25:01 +0000
Received: (at 989) by bugs.x2go.org; 4 Feb 2016 23:20:41 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=-2.0 required=3.0 tests=BAYES_00,DKIM_SIGNED,
Received: from localhost (localhost [])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 527B55DA90
	for <989@bugs.x2go.org>; Fri,  5 Feb 2016 00:20:37 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at ymir.das-netzwerkteam.de
Received: from ymir.das-netzwerkteam.de ([])
	by localhost (ymir.das-netzwerkteam.de []) (amavisd-new, port 10024)
	with ESMTP id zatuhVaQBTIg for <989@bugs.x2go.org>;
	Fri,  5 Feb 2016 00:20:37 +0100 (CET)
Received: from Root24.de (powered.by.root24.eu [])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTP id F2ACF5DA86
	for <989@bugs.x2go.org>; Fri,  5 Feb 2016 00:20:36 +0100 (CET)
Received: from nopileos.local (home.ionic.de [])
	by mail.ionic.de (Postfix) with ESMTPSA id EEC2C4F00DDC;
	Fri,  5 Feb 2016 00:20:35 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ionic.de; s=default;
	t=1454628036; bh=/nINmoAORC1yXYDXyOSldG0GsuQbGxcxIjY76D3UneU=;
To: Ondřej Grover <ondrej.grover@gmail.com>,
References: <CAOyjJOKY4VpqcqKJ2St58tepAgKipgdc=TeGJtgsFpZf5qccdA@mail.gmail.com>
From: Mihai Moldovan <ionic@ionic.de>
X-Enigmail-Draft-Status: N1110
Cc: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Message-ID: <56B3DCC2.5090704@ionic.de>
Date: Fri, 5 Feb 2016 00:20:34 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0)
 Gecko/20100101 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <CAOyjJOKCw0QkwfB45NmUaSNkoYeeOygfsS3xY=BFpZdtgeYjEA@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha512;
[Message part 1 (text/plain, inline)]
On 04.02.2016 06:07 PM, Ondřej Grover wrote:
> Thank you for looking into this.
> On Thu, Feb 4, 2016 at 5:49 PM, Mihai Moldovan <ionic@ionic.de
> <mailto:ionic@ionic.de>> wrote:
>     I've been looking around for a way to actually rollback a failing module import
>     and came up with zit.
> AFAIK that's not really possible in Python as of writing this, especially with
> complicated binary modules.
> I think a solution might be to abandon the common Python EAFP idiom, because it
> assumes graceful failure without such ugly side-effects. However, I'm not sure
> what the LBYL alternative is in this case. But I think there should be one,
> possibly loading just some high-level gi module to list available APIs?

Probably not.

In a new python2 interpreter, try this:

import sys
print sys.modules
import gi.repository
print sys.modules

I guess gi.repository is the only module that could be used to query additional
modules (like Notify.)

The modules list explodes. With GI, we end up in GI hell. And there's no exit.
Ever. Again.

I'd rather suggest the following: another try block, looking for pynotify2.

On Debian, I'd switch the dependencies to use gir1.2-notify-0.7 and python-gi,
or python-notify2 (dropping python-notify completely), while *SUSE, EPEL and
Fedora will continue depending upon the GI modules for newer versions and
pynotify for older versions (at least Fedora doesn't seem to have pynotify2.)

It should probably work as a drop-in replacement for pynotify in our case (i.e.,
we don't use any callbacks or anything fancy.)

Going forward, the deprecated gobject modules for GTK2 will likely be removed at
some point anyway and we should focus on GTK3.

Any objections?


[signature.asc (application/pgp-signature, attachment)]

Send a report that this bug log contains spam.

X2Go Developers <owner@bugs.x2go.org>. Last modified: Sat Jun 22 12:18:19 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.