Thursday, May 29, 2008

Automation, GO!

Got some button-press automation going.  It's a pretty simple implementation, actually.  Currently, it only handles one action ('click') and one Widget type (gtk.Button), but expanding it should be straightforward.  I ran into a problem where the user-defined action would attempt to execute before the corresponding Widget was instantiated, so I added a mechanism that will delay for 10 seconds (in .01 second increments) before giving up on an action.

The code is also on SVN now.

self._commands = [sugarbotCmd(self,'1','click'),
sugarbotCmd(self,'+','click'),
sugarbotCmd(self,'1','click'),
sugarbotCmd(self,'enter','click')]

1 comment: