diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-10 11:10:46 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-10 11:10:46 (GMT) |
commit | f438f851eaadd1335fe894b8045eb01552eb405d (patch) | |
tree | 49eb3224212c14fbccf9be48bc98494417ba632c /tests | |
parent | 6e2ab8dee145be4861a15fb8b5bcca8a04bd0fe0 (diff) |
Check we have a color before registering the icon
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/simulator/kiu.py | 22 |
1 files changed, 16 insertions, 6 deletions
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() |