Add a list of names to pick from. Refactor a bit to allow different simulator stages.

Create a bunch of random bots.
This commit is contained in:
Marco Pesenti Gritti
2006-10-09 18:03:35 +02:00
parent 386dbe7123
commit c9b5381c16
7 changed files with 29 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
from sugar.simulator import Bot
for i in range(0, 10):
bot = Bot()
bot.start()
+3 -3
View File
@@ -13,10 +13,10 @@ PresenceService.start()
base_path = os.path.abspath(os.path.dirname(__file__))
bots_path = os.path.join(base_path, 'bots')
for bot_file in os.listdir(bots_path):
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':
execfile(os.path.join(bots_path, bot_file))
execfile(os.path.join(stage_path, bot_file))
mainloop = gobject.MainLoop()
mainloop.run()