[Zope3-checkins]
SVN: Zope3/branches/benji-testbrowser-with-real-browsers-take-2/src/zope/testbrowser/forms.py
make the control's __repr__ produce consistent results
Benji York
benji at zope.com
Sat Aug 19 19:06:23 EDT 2006
Log message for revision 69699:
make the control's __repr__ produce consistent results
Changed:
U Zope3/branches/benji-testbrowser-with-real-browsers-take-2/src/zope/testbrowser/forms.py
-=-
Modified: Zope3/branches/benji-testbrowser-with-real-browsers-take-2/src/zope/testbrowser/forms.py
===================================================================
--- Zope3/branches/benji-testbrowser-with-real-browsers-take-2/src/zope/testbrowser/forms.py 2006-08-19 22:24:52 UTC (rev 69698)
+++ Zope3/branches/benji-testbrowser-with-real-browsers-take-2/src/zope/testbrowser/forms.py 2006-08-19 23:06:22 UTC (rev 69699)
@@ -149,8 +149,7 @@
self.mech_control.clear()
def __repr__(self):
- return "<%s name=%r type=%r>" % (
- self.__class__.__name__, self.name, self.type)
+ return "<Control name=%r type=%r>" % (self.name, self.type)
class ListControl(Control):
@@ -228,7 +227,10 @@
res.__dict__['control'] = self
return res
+ def __repr__(self):
+ return "<ListControl name=%r type=%r>" % (self.name, self.type)
+
class SubmitControl(Control):
interface.implements(interfaces.ISubmitControl)
@@ -238,7 +240,10 @@
self.browser._clickSubmit(self.mech_form, self.mech_control, (1,1))
self.browser._changed()
+ def __repr__(self):
+ return "<SubmitControl name=%r type=%r>" % (self.name, self.type)
+
class ImageControl(Control):
interface.implements(interfaces.IImageSubmitControl)
@@ -248,7 +253,10 @@
self.browser._clickSubmit(self.mech_form, self.mech_control, coord)
self.browser._changed()
+ def __repr__(self):
+ return "<ImageControl name=%r type=%r>" % (self.name, self.type)
+
class ItemControl(SetattrErrorsMixin):
interface.implements(interfaces.IItemControl)
@@ -296,9 +304,9 @@
self.mech_item.selected = not self.mech_item.selected
def __repr__(self):
- return "<%s name=%r type=%r optionValue=%r>" % (
- self.__class__.__name__, self.mech_item._control.name,
- self.mech_item._control.type, self.optionValue)
+ return "<ItemControl name=%r type=%r optionValue=%r>" % (
+ self.mech_item._control.name, self.mech_item._control.type,
+ self.optionValue)
class Form(SetattrErrorsMixin):
More information about the Zope3-Checkins
mailing list