class sbTypeCmd(sbCommand):
"""
Types text into an Entry widget or similar widget with a set_text method.
"""
def __init__(self, sbgui, widgetName, params=None):
sbCommand.__init__(self, sbgui, widgetName, params)
def run(self):
print "sbTypeCmd"
widget = self.getWidget()
methodName = "set_text"
if hasattr(widget, methodName):
print "Hasattr"
text = (" ".join(self._params)).split("'")
print "Text: " + text
if len(text) <>
return False
textToType = "'".join(text[1:-2])
getattr(widget, methodName)(textToType)
return True
return False
Flipping indentation.
No comments:
Post a Comment