Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/model
diff options
context:
space:
mode:
authorMarco 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)
commit7b37c4d38b0ae6fe6f5a346b3685414185237a09 (patch)
tree60c2b330d63a5a98d1ae46d000edaed6fe623b7e /shell/model
parentf2f25f874d639c31d4c8182c18ee8f11acb0b579 (diff)
Fix opening new activities
Diffstat (limited to 'shell/model')
-rw-r--r--shell/model/BuddyInfo.py24
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)