diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-15 13:30:46 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-15 13:30:46 (GMT) |
commit | 7b37c4d38b0ae6fe6f5a346b3685414185237a09 (patch) | |
tree | 60c2b330d63a5a98d1ae46d000edaed6fe623b7e /shell/model | |
parent | f2f25f874d639c31d4c8182c18ee8f11acb0b579 (diff) |
Fix opening new activities
Diffstat (limited to 'shell/model')
-rw-r--r-- | shell/model/BuddyInfo.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/shell/model/BuddyInfo.py b/shell/model/BuddyInfo.py new file mode 100644 index 0000000..68f0a44 --- /dev/null +++ b/shell/model/BuddyInfo.py @@ -0,0 +1,24 @@ +from sugar.presence import PresenceService +from sugar.canvas.IconColor import IconColor + +class BuddyInfo: + def __init__(self, buddy=None): + if buddy: + self.set_name(buddy.get_name()) + self.set_color(buddy.get_color()) + + def set_name(self, name): + self._name = name + + def set_color(self, color_string): + self._color = IconColor(color_string) + + def get_name(self): + return self._name + + def get_color(self): + return self._color + + def get_buddy(self): + pservice = PresenceService.get_instance() + return pservice.get_buddy_by_name(self._name) |