Comment 3 for bug 877318

Revision history for this message
fabrice gonton (fabrice-gonton) wrote : Re: Nanny not working in Oneiric

Hello,

I run into the same problem 2 weeks ago. I tried to figure out where the problem was located, although
my knowledge of Python is extremely limited (and I even do not talk about Gtk). I have tracked the
problem in this file:

/usr/share/pyshared/nanny/client/gnome/admin/AdminConsole.py

The call to gtk.IconThem.load_icon() fails for a reason. If you catch this and set the pixbuf to None, then
the application starts. I have no clue if Nanny works well without that (it was my first attempt to use it)

foxy123: as it seems you have some experience with Nanny, can you tell me if it runs properly with the
following temporary and ugly patch so I do not have to wait for the full fix to start using it?

Save the lines below (excluded the "cut here" lines) in /tmp/AdminConsole.patch
Go to /usr/share/pyshared/nanny/client/gnome/admin/
Type: sudo patch < /tmp/AdminConsole.patch
Test Nanny (if you want to remove the patch: sudo patch -R < /tmp/AdminConsole.patch)

--8<---------------cut here---------------start------------->8---
--- AdminConsole.py 2011-11-09 23:36:57.174159670 +0100
+++ AdminConsole.py.patched 2011-11-10 11:38:25.254055587 +0100
@@ -30,6 +30,7 @@
     import win32api
     import win32con

+import glib
 import gtk
 import pango
 import gobject
@@ -204,7 +205,10 @@
             else:
                 if os.name == "posix" :
                     icon_theme = gtk.IconTheme ()
- pixbuf = icon_theme.load_icon ('nobody', 50, gtk.ICON_LOOKUP_USE_BUILTIN)
+ try:
+ pixbuf = icon_theme.load_icon ('nobody', 50, gtk.ICON_LOOKUP_USE_BUILTIN)
+ except glib.GError:
+ pixbuf = None
                 elif os.name == "nt" :
                     pixbuf = None
--8<---------------cut here---------------end--------------->8---