sugarbot's aim is to provide testing and automation facilities for the OLPC Project's Sugar GUI. The project must first identify and evaluate possible implementation options, and then implement the best choice. Although it has a Sugar focus, sugarbot should be easily extensible to other Python-based GUI's.
Tuesday, December 16, 2008
Un-kludging Code
Monday, September 1, 2008
Screencast, 0.1 Release
Monday, August 18, 2008
Finalizing...
Wednesday, August 13, 2008
Combo boxes working, wrapping up
Monday, August 11, 2008
ComboBox'es
Tuesday, August 5, 2008
Cleaning up logging functionality
Cleaning up a bit of the logging functionality on the RPC-server side of stuff. Most of it has to do with better correlation of individual clients with given status messages. A small side-effect of this is that pinpointing errors should be easier.
Old Output:
sbRpcServer : INFO Listening on port 54321
sbRpcServer : INFO Kill: True Restart: True
sbRpcServer : INFO Added script sbpython_script.py [Activity Calculate]
sbRpcServer : INFO Serving script sbpython_script.py to client Zach
sbRpcServer : ERROR sugarbot client disconnected prematurely.
sbRpcServer : ERROR Reason: Execution failed: Traceback (most recent call last):
File "/home/zach/Activities/sugarbot.activity/sbexecutionengine.py", line 92, in executePy
sugarbot_main(self.widgets)
File "[string]", line 7, in sugarbot_main
AssertionError
New Output:
sbRpcServer : INFO Listening on port 54321
sbRpcServer : INFO Kill: True Restart: True
sbRpcServer : INFO Added script sbpython_script.py [Activity Calculate]
Zach : INFO Starting sbpython_script.py
Zach : INFO Success (sbpython_script.py)
Zach : INFO Disconnected [1\1\1]
Zach : INFO Starting script sbpython_script.py
Zach : ERROR Execution failed:
Traceback (most recent call last):
File "/home/zach/Activities/sugarbot.activity/sbexecutionengine.py", line 92, in executePy
sugarbot_main(self.widgets)
File "Sugarbot Script: 'sbpython_script.py'", line 7, in sugarbot_main
AssertionError
Zach : INFO Disconnected [0\1\1]
Hurricane
Monday, August 4, 2008
Sunday, August 3, 2008
DBUS problem time-related?
DBUS Flaking Out
ERROR:dbus.proxies:Introspect error on org.laptop.ActivityRegistry:/org/laptop/ActivityRegistry:
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include:
the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout
expired, or the network connection was broken.
DEBUG:dbus.proxies:Executing introspect queue due to error
Traceback (most recent call last):
File "/usr/share/sugar/shell/view/Shell.py", line 98, in _start_journal_idle
if registry.get_activity('org.laptop.JournalActivity'):
File "/usr/lib/python2.5/site-packages/sugar/activity/registry.py", line 114, in get_activity
info_dict = self._registry.GetActivity(service_name)
File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__
**keywords)
File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include:
the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout
expired, or the network connection was broken.
ERROR:dbus.proxies:Introspect error on org.laptop.Clipboard:/org/laptop/Clipboard: dbus.exceptions.DBusException:
org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not
send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network
connection was broken.
DEBUG:dbus.proxies:Executing introspect queue due to error
ERROR:root:Error getting activities async: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible
causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the
reply timeout expired, or the network connection was broken.
Saturday, August 2, 2008
Latest Changes
/bin/sh: /usr/share/sugar/shell/sugarbot-launcher.py: Host is down
Thursday, July 31, 2008
Crunchtime
Monday, July 28, 2008
Trying to keep it pretty...
Sunday, July 27, 2008
It's Alive!!!
Sugarbot/buildbot integration is complete. I only have one port opened on the box that it's running on, but you can access it here: http://129.7.243.13:22. To access that with Firefox, you need to change a setting. I'm working on getting a different port opened.
Wednesday, July 23, 2008
Mutliple Clients, Return Status
Tuesday, July 22, 2008
Multiple Clients
Sunday, July 20, 2008
Big Changes
Inheritance
Saturday, July 19, 2008
Friday, July 18, 2008
So Close!
Missing Something
Wednesday, July 16, 2008
Sugarbot Diagram
Tuesday, July 15, 2008
Stateful XML-RPC Server
Saturday, July 12, 2008
Full automation
Automated Launching: Go!
Launching Activities Automatically
sugar.activity.activityfactory.create(...)
Friday, July 11, 2008
Mid-Summer Screencast
- Masquerading as any Activity while retaining all functionality
- Hooks into PyGTK library to intercept GDK Events to catalog widgets
- Intelligent identification of widgets based on widget class to give each widget a unique identifier
- Manipulation of many types of widgets using generic commands like 'click' and 'type'
- Multithreaded execution routine prevents hang-ups (prior versions would stall once the calls to the GTK handler stopped due to inactivity)
- Custom scripting language with support for advanced string manipulation [will soon be replaced by native Python code]
- XML-RPC client/server interface allows the scripts to be stored on a central machine, while sugarbot may be run on any number of slaves.
- Per-command status reporting and graceful error handling
- Does not rely on any libraries or modules outside those already provided by Sugar and Python
- Automated testing provided via buildbot and python-nose.
Thursday, July 10, 2008
WTFBBQ
ScreenFlick
Tuesday, July 8, 2008
Wierd logging issue...
Woot?
Well that was pretty friggin simple. Only a few *hours* of Googling for that one. The buildbot is not yet publicly accessible, but it now runs all 70 tests just fine. My Google-fu has truly failed me :-(. In my defense, I did find the solution earlier, but the prior finds didn't mention that the "xhost +" command had to be run as root.
Monday, July 7, 2008
Buildbot is [almost] working
Sunday, July 6, 2008
Buildbot Up and Running
from sugar.graphics import Palette
I don't have a machine that I can put the buildbot on that can be accessed remotely (yet), but I should have a shiny new Dell any day now (it was ordered ~3 weeks ago) for my work with Univ. of Houston that I can throw a buildbot on.
Thursday, July 3, 2008
Ideas??? Buildbot complains...
2008/07/03 20:26 CDT [-] Log opened.
2008/07/03 20:26 CDT [-] twistd 2.2.0 (/usr/bin/python 2.5.2) starting up
2008/07/03 20:26 CDT [-] reactor class: twisted.internet.selectreactor.SelectReactor
2008/07/03 20:26 CDT [-] Loading buildbot.tac...
2008/07/03 20:26 CDT [-] Loaded.
2008/07/03 20:26 CDT [-] loading configuration from /home/buildmaster/APP/master.cfg
2008/07/03 20:26 CDT [-] error while parsing config file
2008/07/03 20:26 CDT [-] error during loadConfig
2008/07/03 20:26 CDT [-] Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/twisted/scripts/twistd.py", line 182, in startApplication
app.startApplication(application, not config['no_save'])
File "/usr/lib/python2.5/site-packages/twisted/application/app.py", line 298, in startApplication
service.IService(application).startService()
File "/usr/lib/python2.5/site-packages/twisted/application/service.py", line 196, in startService
service.startService()
File "/usr/lib/python2.5/site-packages/buildbot/master.py", line 407, in startService
self.loadTheConfigFile()
---
File "/usr/lib/python2.5/site-packages/buildbot/master.py", line 462, in loadTheConfigFile
self.loadConfig(f)
File "/usr/lib/python2.5/site-packages/buildbot/master.py", line 480, in loadConfig
exec f in localDict
File "/home/buildmaster/APP/master.cfg", line 4, in
from buildbot.process import step, factory
2008/07/03 20:26 CDT [-] The new config file is unusable, so I'll ignore it.
2008/07/03 20:26 CDT [-] I will keep using the previous config file instead.
Next Step
Feels good
----------------------------------------------------------------------
Ran 70 tests in 0.581s
OK
Wednesday, July 2, 2008
More difficult than it needed to be...
Unless something in xmlrpclib or SimpleXMLRPCServer breaks (which isn't something I can do much about), you end up with the same results. I can't believe I wasted this much time on the problem!!!
Sunday, June 29, 2008
Issues Testing XML Server
Committed several new files to SVN, lots of tests for most of the other functionality.
Friday, June 27, 2008
So wait...
...
AND I can find bugs in the process?
zomg
(I tried to find a fitting lolcat picture, but couldn't.)
sugar-emulator
Thursday, June 26, 2008
Not cooperating...
First, I tried to use the old sugar-jhbuild from before the drive corruption, because I had the actual files stored on the Mac filesystem (accessed in Ubuntu via the Shared Folders featured in VMWare). For whatever reason, that didn't work. Okay, I can accept that.
Next, I tried to simply './sugar-jhbuild update' and './sugar-jhbuild build' on the existing installation. I let that run overnight. No dice.
So I started out with a fresh copy, via git. After 'update' passed, 'build' decided that it would freeze the VM, resulting in me having to hard-reboot (because the VMWare process would not quit via Force Quit or sudo kill).
Now I am rebuilding sugar-jhbuild *again*, and it's deciding that it's going to take its dandy time. Literally. I've given the VM 512MB of RAM and access to both processors, and it's sitting at about 20% utilization. In addition to that, the VM is completely unresponsive -- which is intereseting, because it is supposedly (according to Activity Monitor in OSX) -- not really doing anything.
This whole incident is becoming very frustrating. I can't test any of the 'nose' code that I've written, because none of the Sugar libraries are available/working under Leopard, which means that anything that's Sugar-dependent (read: everything) refuses to run on Python under OSX.
In order to see if I could expedite things, I went the 'apt' route with precreated Sugar packages and emulator. I figured I'd just run the sugar-jhbuild process in the background, and work around it until it was done building. As I mentioend before, the VM is completely unresponsive... to the point that I'm considering just creating a new VM (yet again...). Of course, I know that won't really solve anything, because Ubuntu runs just fine until it gets a few minutes into the sugar-jhbuild process.
I should very shortly have access to a shiny new Dell workstation (as part of my UH project) that will have Ubuntu on it. Hopefully that will yield better results.
Monday, June 23, 2008
Documentation Effort
Tomorrow night will kick off the nose'ing of sugarbot.
Ubuntu is running
Sunday, June 22, 2008
Drive Genius
After my Time Machine backup finishes restoring (looks like about 45 minutes left on that), I have to re-install my Ubuntu VM, as my VM's are the only thing I didn't have Time Machine back up (because they would chew up disk space). I'm hoping to be back up and running before the night is over.
Saturday, June 21, 2008
New Wiki Pages
Sugarbot Script Syntax
Running Sugarbot
Refactoring
Not going well today...
I think/hope I have FINALLY gotten things sorted out. Maybe.
Friday, June 20, 2008
Now Launching
Thursday, June 19, 2008
Parsing Server-side
I can make a work-around for this (for example, by making the class name a member, and then passing that to another function that re-instantiates the object) but it seems like a giant kludge.
Bug Hunting
The fact that the error was being reported via the xmlrpc library only made it that much harder to realize my mistake.
Wasted time, bah.
Wednesday, June 18, 2008
Moving
Played around with the logger functionality tonight. Very nifty.
Tuesday, June 17, 2008
That's it, really?
After an hour of struggling with it, only to finally notice that I have to restart the server script (in addition to the Sugar Activity) if I actually want my changes to propagate, I have to say... that was pretty freaking easy.
Sunday, June 15, 2008
Timout problem
Good news is that the problem was solved with -- drumroll -- changing an 'if' into a 'while' and adding a little bit more hackery.
XML-RPC
A separate XML-RPC server can feed it the commands. Bingo!
Saturday, June 14, 2008
Temporary Diversion
Brick Wall
Turns out that I might need to create a separate thread in order to launch the commands, as the method that I am currently using is only good until things are done initializing. After that, no new gdk.Event's are issued, which means that the place that I use as a callback to launch sbCommand objects never gets called.
For an example of what I mean, check out r41 (just committed it) and run the sugarbot activity. No modification should be necessary, and it should launch the Terminal activity (which you need to have installed for this to work properly, obviously). After/during the "sleep '2'" statement, everything finishes initializing, which means there are no more Events flying around. That means that all of the 'type' commands will not execute until some event is created. To see this, launch the activity, and do not touch your mouse or keyboard for a few seconds. Then move the mouse, and the 'type' commands should execute shortly thereafter.
- Multithreading. Just have a thread that sits and does what the hooked code would otherwise do. This would allow me to separate the sbgui functionality from the execution of commands, which is a Good ThingTM.
- Find a way to generate some kind of empty gdk.Event after executing a sbCommand, if there are no other gdk.Event's waiting for processing.
Friday, June 13, 2008
Reorganizing, issues with a few Widgets
- A script file that actually contains multiple scripts. With each subsequent execution, the next 'script' is run. sugarbot keeps track of where it needs to read from next with some other file, and resets that data once it reaches the end.
- Use the network to connect to some separate 'server' application that tells sugarbot what to do. This other application would have unlimited flexibility, since it is not bounded by the Sugar environment.
Wednesday, June 11, 2008
In Maryland
Sunday, June 8, 2008
Multiple-Initialization
A commenter (Michael Stone) asked for a bit more information on the multiple-initialization issues that I ran into. The issue first appeared when I first started the project, and I resolved the issue with a runtime inheritance hack. The general idea is:
The sugarbot object makes itself inherit from the other class, then calls __init__(self, self.handle) so that the Activity gets initialized the way that it normally would. This was not how it was originally set up (because it did not work the way it was originally set up). At first, I just assumed that I could do the following:self.parentClass = someOtherActivityClass…and have everything work. Unfortunately, certain calls (calling activity.Activity.__init__ explicitly, to initialize the activity being one of those) only like to be called by the Activity instance that it expects the call to come from. Otherwise, the excrement comes into contact with the rotary cooling device.
sugarbot.bases = (self.parentClass,)
self.parentClass.init(self,self.handle)
launchedActivity = someOtherActivity(self,handle)An issue that I’m facing is that, with the current way of instantiating Activities, it is not possible (to my knowledge) to terminate the spawned activity without causing the whole process to terminate. I think the way to resolve this is going to (ultimately) be to automate the Sugar GUI itself, so that I can re-launch the sugarbot Activity after it terminates. It will somehow know (or perhaps have this information provided to it) to run the next automation script or the like.
Example Activity:
from sugar.activity import activity
import sys, os
import gtk
class exampleActivity(activity.Activity):
def init(self, handle):
# With or without the following call, everything freaks out.
activity.Activity.init(self,handle)
# Add the path to the activity
sys.path.append(pathToCalculateActivity)
# Import and instantiate the activity
from calculate import Calculate
launchedActivity = Calculate(self,handle)
Saturday, June 7, 2008
Re-factoring mood?
Widget Identifier Refactor
Thursday, June 5, 2008
Getting pretty sugar-specific
Wednesday, June 4, 2008
Bandwidth
Tuesday, June 3, 2008
Damnit, Python
Monday, June 2, 2008
Evaluating Entries, basic parsing
Houston
Thursday, May 29, 2008
Automation, GO!
Simple Button Click
Wednesday, May 28, 2008
Health Testing
Monday, May 26, 2008
Being too cautious
Scheduling Bloodwork
Wednesday, May 21, 2008
Enumerating Widgets
Tuesday, May 20, 2008
WOOOOOO
- Figured out how to get another Activity's code running under my activity, via runtime inheritance.
- Successfully identified button-presses in Calculator.activity. Example output:
Monday, May 19, 2008
Which came first, the snake or the egg?
Migrating to an Activity
Sunday, May 18, 2008
What is our scope?
Saturday, May 17, 2008
Roadblocks
Workin' It Out
Friday, May 16, 2008
It's hard to overstate my satisfaction
More kiwi.ui.test
Thursday, May 15, 2008
kiwi.ui.test
Dissecting guitest
So, dogtail is huge. Really, really huge. So huge, in fact, that I'm a little bit opposed to trying to wrap my mind around it, especially since it has a bit of a documentation problem. As such, I'm going to stick with playing around with guitest until I get a response from the GUITAR guys.
Back to guitest, it would appear that a vast amount of functionality stems from this little nugget. It looks like the way guitest works is by hooking pretty much any GTK call you could ever want to make.
By the way, if anyone knows of a way for me to copy code out of TextMate that retains the syntax coloring, please let me know (extra kudos if I get it in HTML format).
GUITAR will have to wait
Thanks for your interest in GUITAR. Currently, the University of Maryland's IP policy is changing, and we're still waiting to find out under what conditions we can provide the source code. I don't know when we'll find out, but I'll try to remember to notify you when we do. I encourage you to keep checking the project page periodically for updates. Sorry for the inconvenience.
Jaymie
Underwhelmed
After spending a little bit with guitest, I have to say that I am a little bit... underwhelmed at how it's implemented. Being that I haven't really used software that does GUI automation, I wasn't sure what to expect... but given the test examples that were included (along with the complete lack of documentation), I have higher hopes for dogtail and GUITAR.
I will have to take a close look at dogtail's procedural API. It looks like it resembles what I (and I think Titus, as well) have in mind for controlling sugarbot.
> Update: Looks like I spoke too soon. While their procedural API looks like something I'd like to look at a bit more closely, their documentation is sorely lacking.
> Update 2: eMailed the creator of guitest. I didn't realize that it was 3 years out since it was actively maintained... but hopefully I'll get a response. It appears that he keeps an updated blog (gintasm.blogspot.com), so I'm fairly confident I will.
> Really Not Related: Mail.app's Mailbox>Rebuild command is amazing, if not entirely apparent. I had some duplicated emails that refused to be deleted.
Blog Archive
-
▼
2008
(91)
-
►
July
(27)
- Crunchtime
- Trying to keep it pretty...
- It's Alive!!!
- Mutliple Clients, Return Status
- Multiple Clients
- Big Changes
- Inheritance
- Somebody please tell me why the following code doe...
- So Close!
- Missing Something
- Sugarbot Diagram
- Stateful XML-RPC Server
- Full automation
- Automated Launching: Go!
- Launching Activities Automatically
- Mid-Summer Screencast
- WTFBBQ
- ScreenFlick
- O ya
- Wierd logging issue...
- Woot?
- Buildbot is [almost] working
- Buildbot Up and Running
- Ideas??? Buildbot complains...
- Next Step
- Feels good
- More difficult than it needed to be...
-
►
June
(30)
- Issues Testing XML Server
- So wait...
- zomg
- sugar-emulator
- Not cooperating...
- Documentation Effort
- Ubuntu is running
- Drive Genius
- New Wiki Pages
- Refactoring
- Not going well today...
- Now Launching
- Parsing Server-side
- Bug Hunting
- Moving
- That's it, really?
- Timout problem
- XML-RPC
- Temporary Diversion
- Brick Wall
- Reorganizing, issues with a few Widgets
- In Maryland
- Multiple-Initialization
- Re-factoring mood?
- Widget Identifier Refactor
- Getting pretty sugar-specific
- Bandwidth
- Damnit, Python
- Evaluating Entries, basic parsing
- Houston
-
►
May
(23)
- Automation, GO!
- Simple Button Click
- Health Testing
- Being too cautious
- Scheduling Bloodwork
- Enumerating Widgets
- WOOOOOO
- Which came first, the snake or the egg?
- Migrating to an Activity
- What is our scope?
- Roadblocks
- Workin' It Out
- It's hard to overstate my satisfaction
- More kiwi.ui.test
- kiwi.ui.test
- Dissecting guitest
- GUITAR will have to wait
- Underwhelmed
-
►
July
(27)