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.

Monday, June 2, 2008

Evaluating Entries, basic parsing

Basic strings such as:

click '1'
click '+'
click '1'
click 'enter'

and complex strings such as

entryEval 'Entry'.split()[0] == '1'

Are both parse-able AND should work the way that they're expected.  Pretty cool.  Source is on SVN.  [edit] I have also quickly implemented a feature that will allow the serialization of sbCommand objects -- so that not only can lines like the above be parsed, they can be un-parsed.

Note: In order for Entry hooking to work properly, the gtk.Entry has to [editbe named properly.  For testing purposes, I named Calculate.activity's main entry "Entry".  I will include a patch to automate this process at a later point in time. [edit] Manual patch below, will upload a Diff to the sugarbot downloads area.

Underneath the line in Calculate.activity/layout.py:
  self.text_entry = gtk.Entry()
Enter the following (my personal tests use:
  self.text_entry.set_name('calcMainEntry')

No comments: