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.

Saturday, July 19, 2008

Somebody please tell me why the following code does not work as one would expect (that is, printing out text when setting/getting someASDF.text):

class asdf:
def click(self):
print "click"
def getText(self):
print "getText"
def setText(self, val):
print "setText"
text = property(lambda self: self.getText(), lambda self, v: self.setText(v))

1 comment:

Grig Gheorghiu said...

Zach -- if you just say

text = property(getText, setText)

it seems to work for me.