diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-10 14:35:52 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-10 14:35:52 (GMT) |
commit | 3f68640c1396964169f2c12084ff53814b92086e (patch) | |
tree | 85449f63cfb02d583a7b90f41d1d6ec6dbd548cf /tests | |
parent | f1f0e9d26ccb5564b5ccd08fb1697338b1f52a07 (diff) |
Get rid of the old simulator
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/simulator/demo/kiu.py | 68 | ||||
-rwxr-xr-x | tests/simulator/simulator | 2 |
2 files changed, 1 insertions, 69 deletions
diff --git a/tests/simulator/demo/kiu.py b/tests/simulator/demo/kiu.py deleted file mode 100755 index 2e8c448..0000000 --- a/tests/simulator/demo/kiu.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/python - -from sugar.oldsimulator import Bot -from sugar.oldsimulator import ShareActivityAction -from sugar.graphics.iconcolor import IconColor -import os, random, gobject - -class KiuBot(Bot): - def __init__(self): - Bot.__init__(self, 'kiu', IconColor('#5E4505,#0F8A0F')) - self._olpc_chat_service = None - self._web_activity_service = None - self._activity_switch_timeout = None - self._curact = None - - action = ShareActivityAction('OLPC channel', - '_GroupChatActivity_Sugar_redhat_com._udp', - self.__share_olpc_chat_cb) - self.add_action(action, 10) - - action = ShareActivityAction('All About Giraffes', - '_BrowserActivity_Sugar_redhat_com._udp', - self.__share_web_activity_cb) - self.add_action(action, 20) - - curdir = os.path.abspath(os.path.dirname(__file__)) - self._icon_file = os.path.join(curdir, '../data/kiu.jpg') - - def __activity_switch_cb(self): - self._activity_switch_timeout = None - which = random.randint(1, 2) - if which == 1: - actid = self._olpc_chat_activity.get_id() - elif which == 2: - actid = self._web_activity.get_id() - else: - raise RuntimeError("WTF? unexpected value") - if actid != self._curact: - print "KIU: now setting current activity to %s" % actid - self._owner.set_current_activity(actid) - self._curact = actid - self._schedule_activity_switch_timeout() - return False - - def _schedule_activity_switch_timeout(self): - if self._activity_switch_timeout: - return - interval = random.randint(10000, 20000) - self._activity_switch_timeout = gobject.timeout_add(interval, - self.__activity_switch_cb) - - def __share_olpc_chat_cb(self, sim_activity, service): - self._olpc_chat_service = service - self._olpc_chat_activity = sim_activity - self._schedule_activity_switch_timeout() - - def __share_web_activity_cb(self, sim_activity, service): - self._web_activity_service = service - self._web_activity = sim_activity - self._schedule_activity_switch_timeout() - -def main(): - bot = KiuBot() - bot.start() - - -if __name__ == "__main__": - main() diff --git a/tests/simulator/simulator b/tests/simulator/simulator index 552512c..9faae83 100755 --- a/tests/simulator/simulator +++ b/tests/simulator/simulator @@ -15,7 +15,7 @@ base_path = os.path.abspath(os.path.dirname(__file__)) stage_path = os.path.join(base_path, 'demo') for bot_file in os.listdir(stage_path): - if bot_file.endswith('.py') and bot_file != 'kiu.py': + if bot_file.endswith('.py'): execfile(os.path.join(stage_path, bot_file)) mainloop = gobject.MainLoop() |