[pkg-fso-maint] openmoko-panel-plugin and notifications (was Re: openmoko-panel-plugin v0.5)
Luca Capello
luca at pca.it
Wed Nov 5 11:27:32 UTC 2008
Hi Christian!
Please quote only the relevant part of previous messages, TIA.
On Wed, 05 Nov 2008 09:52:52 +0100, Christian Adams wrote:
> Am 05.11.2008 um 04:56 schrieb Luca Capello:
>> I found another error the patch above [1] causes: notification-
>> daemon is no more listed as dependency [2]. notification-daemon must
>> be a Depends:, not a Recommends:. Howver, the dependency should be
>>
>> notification-daemon | notification-daemon-xfce
[...]
> our panel-plugin not longer really _needs_ notification-daemon.
I am sorry, but version 0.5-1.1 as it is *needs* a notification-daemon.
I tested again on a newly installed Debian: the error at [2] is there.
> notifications are only done when python-pynotify could be initialized
> (which i think should only work, when some notification-daemon is
> installed, right?)
According to [3], it should work like this, but openmoko-panel-plugin
still Depends: on python-pynotify, thus line 37 is always true [4].
Hence, python-notify must be moved to Recommends: as well.
However, this generates another error:
=====
debian-gta02:~# dpkg -P --force-all python-notify
dpkg: python-notify: dependency problems, but removing anyway as you request:
openmoko-panel-plugin depends on python-notify.
(Reading database ... 13437 files and directories currently installed.)
Removing python-notify ...
Processing triggers for python-support ...
debian-gta02:~# DISPLAY=:0.0 openmoko-panel-plugin
Traceback (most recent call last):
File "/usr/bin/openmoko-panel-plugin", line 1442, in <module>
icon = PanelPlugin( dbus_object )
File "/usr/bin/openmoko-panel-plugin", line 61, in __init__
self.configReader()
File "/usr/bin/openmoko-panel-plugin", line 76, in configReader
self.appendIcon(plugin)
File "/usr/bin/openmoko-panel-plugin", line 80, in appendIcon
self.icons.append(GSMIcon(self.dbus, self))
File "/usr/bin/openmoko-panel-plugin", line 522, in __init__
self.updateGSMNetworkStatus(status=self.gsmStatus)
File "/usr/bin/openmoko-panel-plugin", line 570, in updateGSMNetworkStatus
self.sendNotification()
File "/usr/bin/openmoko-panel-plugin", line 381, in sendNotification
n = pynotify.Notification("Hardware", self.getNotificationText(), "file://%s" % self.getIcon())
NameError: global name 'pynotify' is not defined
debian-gta02:~#
=====
I am not a Python expert, but the following patch should be OK,
successfully tested on two different Debian installations:
--8<---------------cut here---------------start------------->8---
diff --git a/openmoko-panel-plugin b/openmoko-panel-plugin
index 4493e31..c34f427 100755
--- a/openmoko-panel-plugin
+++ b/openmoko-panel-plugin
@@ -378,10 +378,11 @@ class StatusIcon( object ):
self.icon.set_tooltip(self.getTooltip())
def sendNotification(self):
- n = pynotify.Notification("Hardware", self.getNotificationText(), "file://%s" % self.getIcon())
- n.set_urgency(pynotify.URGENCY_CRITICAL)
- n.set_timeout(10000) # 10 seconds timeout
- n.show()
+ if (notificationAvailable):
+ n = pynotify.Notification("Hardware", self.getNotificationText(), "file://%s" % self.getIcon())
+ n.set_urgency(pynotify.URGENCY_CRITICAL)
+ n.set_timeout(10000) # 10 seconds timeout
+ n.show()
def getNotificationText(self):
return self.getTooltip()
--8<---------------cut here---------------end--------------->8---
> so we just recommend notification-daemon | notification-dameon-xfce
I am not sure an alternative Recommends: is possible, but I must admit
that I have never tried.
Thx, bye,
Gismo / Luca
>>> Footnotes:
>>> [1] http://git.debian.org/?p=pkg-fso/openmoko-panel-plugin.git;a=commitdiff;h=af14be122458ba549fa5f68b256d0097f0075856
> [2] http://lists.linuxtogo.org/pipermail/smartphones-userland/2008-September/000191.html
[3] http://git.debian.org/?p=pkg-fso/openmoko-panel-plugin.git;a=blob;f=openmoko-panel-plugin;h=4493e31a4624768dbf3fdf823e9b0d79775c161e;hb=HEAD#l32
[4] http://git.debian.org/?p=pkg-fso/openmoko-panel-plugin.git;a=blob;f=openmoko-panel-plugin;h=4493e31a4624768dbf3fdf823e9b0d79775c161e;hb=HEAD#l37
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 314 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-fso-maint/attachments/20081105/1b51e3e6/attachment.pgp
More information about the pkg-fso-maint
mailing list