Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/model/Owner.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/shell/model/Owner.py b/shell/model/Owner.py
index 760697a..3d5b333 100644
--- a/shell/model/Owner.py
+++ b/shell/model/Owner.py
@@ -50,24 +50,23 @@ class ShellOwner(gobject.GObject):
gobject.GObject.__init__(self)
self._nick = profile.get_nick_name()
- user_dir = env.get_profile_path()
self._icon = None
self._icon_hash = ""
- for fname in os.listdir(user_dir):
- if not fname.startswith("buddy-icon."):
- continue
- fd = open(os.path.join(user_dir, fname), "r")
- self._icon = fd.read()
- fd.close()
- if not self._icon:
- raise RuntimeError("No buddy icon exists")
-
- # Get the icon's hash
- import md5, binascii
- digest = md5.new(self._icon).digest()
- self._icon_hash = util.printable_hash(digest)
- break
+ icon = os.path.join(env.get_profile_path(), "buddy-icon.jpg")
+ if not os.path.exists(icon):
+ raise RuntimeError("missing buddy icon")
+
+ fd = open(icon, "r")
+ self._icon = fd.read()
+ fd.close()
+ if not self._icon:
+ raise RuntimeError("invalid buddy icon")
+
+ # Get the icon's hash
+ import md5
+ digest = md5.new(self._icon).digest()
+ self._icon_hash = util.printable_hash(digest)
self._pservice = PresenceService.get_instance()