[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - widget.py:1.22
Marius Gedminas
mgedmin@codeworks.lt
Thu, 20 Mar 2003 10:05:45 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv25859/src/zope/app/browser/form
Modified Files:
widget.py
Log Message:
Small refactoring in CheckBoxWidget: elimitate duplication in parameter lists.
=== Zope3/src/zope/app/browser/form/widget.py 1.21 => 1.22 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.21 Thu Mar 6 11:20:11 2003
+++ Zope3/src/zope/app/browser/form/widget.py Thu Mar 20 10:05:44 2003
@@ -145,23 +145,17 @@
def __call__(self):
data = self._showData()
-
if data:
- return renderElement(self.getValue('tag'),
- type = self.getValue('type'),
- name = self.name,
- id = self.name,
- checked = None,
- cssClass = self.getValue('cssClass'),
- extra = self.getValue('extra'))
+ kw = {'checked': None}
else:
- return renderElement(self.getValue('tag'),
- type = self.getValue('type'),
- name = self.name,
- id = self.name,
- cssClass = self.getValue('cssClass'),
- size = self.getValue('displayWidth'),
- extra = self.getValue('extra'))
+ kw = {}
+ return renderElement(self.getValue('tag'),
+ type = self.getValue('type'),
+ name = self.name,
+ id = self.name,
+ cssClass = self.getValue('cssClass'),
+ extra = self.getValue('extra'),
+ **kw)
def _convert(self, value):
return value == 'on'