[Zope3-checkins] SVN: Zope3/trunk/src/zope/formlib/form.py
simplifying loops
Thomas Lotze
tl at gocept.com
Wed Nov 16 05:02:15 EST 2005
Log message for revision 40153:
simplifying loops
Changed:
U Zope3/trunk/src/zope/formlib/form.py
-=-
Modified: Zope3/trunk/src/zope/formlib/form.py
===================================================================
--- Zope3/trunk/src/zope/formlib/form.py 2005-11-16 09:57:56 UTC (rev 40152)
+++ Zope3/trunk/src/zope/formlib/form.py 2005-11-16 10:02:14 UTC (rev 40153)
@@ -661,10 +661,8 @@
result = []
for action in actions:
condition = action.condition
- if condition is not None:
- if not condition(form, action):
- continue
- result.append(action)
+ if (condition is None) or condition(form, action):
+ result.append(action)
return result
@@ -755,11 +753,11 @@
yield view.snippet()
def haveInputWidgets(form, action):
- return bool([input
- for (input, widget)
- in form.widgets.__iter_input_and_widget__()
- if input
- ])
+ for input, widget in form.widgets.__iter_input_and_widget__():
+ if input:
+ return True
+ else:
+ return False
class EditFormBase(FormBase):
More information about the Zope3-Checkins
mailing list