[debian-edu-commits] r78715 - trunk/src/hw-support-handler
pere at alioth.debian.org
pere at alioth.debian.org
Sat Jan 12 07:59:34 UTC 2013
Author: pere
Date: 2013-01-12 07:59:34 +0000 (Sat, 12 Jan 2013)
New Revision: 78715
Modified:
trunk/src/hw-support-handler/hw-support-handlerd
trunk/src/hw-support-handler/modaliases
Log:
Get callback working.
Modified: trunk/src/hw-support-handler/hw-support-handlerd
===================================================================
--- trunk/src/hw-support-handler/hw-support-handlerd 2013-01-11 23:23:53 UTC (rev 78714)
+++ trunk/src/hw-support-handler/hw-support-handlerd 2013-01-12 07:59:34 UTC (rev 78715)
@@ -12,13 +12,20 @@
import fnmatch
import sys
import apt
+import os
hw_seen = {}
pkg_suggested = {}
+# Keep refs needed for callback to work
+n = None
+npkgs = None
+
def notify_pleaseinstall(notification=None, action=None, data=None):
pkgs = data
- print "info: buttonclicked: %s" % string.join(pkgs, " ")
+ pkgsstr = string.join(pkgs, " ")
+# print pkgs
+ print "info: button clicked, should call \"apt-get install %s\"" % pkgsstr
def notify(bus, vendor, device, pkgs):
pkgstr = string.join(pkgs, " ")
@@ -33,12 +40,14 @@
# Initializite pynotify
if not pynotify.init("test"):
return False
-
+ global n
+ global npkgs
+ npkgs = pkgs
n = pynotify.Notification(title, text)
n.set_timeout(10000)
n.add_action("clicked",
"Please install program(s)",
- notify_pleaseinstall, pkgs)
+ notify_pleaseinstall, npkgs)
n.show()
return True
Modified: trunk/src/hw-support-handler/modaliases
===================================================================
--- trunk/src/hw-support-handler/modaliases 2013-01-11 23:23:53 UTC (rev 78714)
+++ trunk/src/hw-support-handler/modaliases 2013-01-12 07:59:34 UTC (rev 78715)
@@ -82,3 +82,6 @@
Package: yubikey-personalization
Modaliases: yubikey-personalization(usb:v1050p0010d*)
+Package: test
+Modaliases: test(usb:v1050p0010d*, pci:v00008086d000024CDsv*)
+
More information about the debian-edu-commits
mailing list