From f438f851eaadd1335fe894b8045eb01552eb405d Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 10 Sep 2006 11:10:46 +0000 Subject: Check we have a color before registering the icon --- (limited to 'tests') diff --git a/tests/simulator/kiu.py b/tests/simulator/kiu.py index 9529506..fb11419 100755 --- a/tests/simulator/kiu.py +++ b/tests/simulator/kiu.py @@ -2,6 +2,7 @@ import os import gtk +import gobject from sugar.session.TestSession import TestSession from sugar.presence import PresenceService @@ -38,6 +39,20 @@ class ShellOwner(object): def _handle_invite(self, issuer, bundle_id, activity_id): return '' +def start(): + pservice = PresenceService.get_instance() + + if not pservice.get_owner().get_color(): + print 'Color not found' + return True + + activity = SimulatedActivity() + properties = { 'title' : 'OLPC' } + activity_type = '_GroupChatActivity_Sugar_redhat_com._udp' + service = pservice.share_activity(activity, activity_type, properties) + + return False + os.environ['SUGAR_NICK_NAME'] = 'kiu' session = TestSession() @@ -48,11 +63,6 @@ PresenceService.start() owner = ShellOwner() owner.announce() -pservice = PresenceService.get_instance() - -activity = SimulatedActivity() -properties = { 'title' : 'OLPC' } -activity_type = '_GroupChatActivity_Sugar_redhat_com._udp' -service = pservice.share_activity(activity, activity_type, properties) +gobject.timeout_add(1000, start) gtk.main() -- cgit v0.9.1