diff options
Diffstat (limited to 'sugar/p2p')
-rw-r--r-- | sugar/p2p/Buddy.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sugar/p2p/Buddy.py b/sugar/p2p/Buddy.py index dd42081..45aeac3 100644 --- a/sugar/p2p/Buddy.py +++ b/sugar/p2p/Buddy.py @@ -1,6 +1,10 @@ import pwd import os +import pygtk +pygtk.require('2.0') +import gtk + from Service import Service from sugar import env @@ -25,6 +29,15 @@ class Buddy(object): self._address = service.get_address() self._icon = None + def get_icon_pixbuf(self): + if self._icon: + pbl = gtk.gdk.PixbufLoader() + pbl.write(self._icon) + pbl.close() + return pbl.get_pixbuf() + else: + return None + def get_icon(self): """Return the buddies icon, if any.""" return self._icon |