[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - editview.py:1.22
Fred L. Drake, Jr.
fred@zope.com
Wed, 16 Apr 2003 17:51:27 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/form
In directory cvs.zope.org:/tmp/cvs-serv20207
Modified Files:
editview.py
Log Message:
- rename _normalize() to normalize()
- lots of style cleanup
=== Zope3/src/zope/app/browser/form/editview.py 1.21 => 1.22 ===
--- Zope3/src/zope/app/browser/form/editview.py:1.21 Wed Apr 16 12:23:12 2003
+++ Zope3/src/zope/app/browser/form/editview.py Wed Apr 16 17:51:27 2003
@@ -157,10 +157,7 @@
fulledit_path=None, fulledit_label=None, menu=u'',
usage=u''):
# XXX What about the __implements__ of the bases?
- class_ = SimpleViewClass(
- template,
- used_for = schema, bases = bases
- )
+ class_ = SimpleViewClass(template, used_for=schema, bases=bases)
class_.schema = schema
class_.label = label
class_.fieldNames = fields
@@ -174,21 +171,17 @@
class_.generated_form = ViewPageTemplateFile(default_template)
class_.usage = usage or (
- menu and globalBrowserMenuService.getMenuUsage(menu)
- )
+ menu and globalBrowserMenuService.getMenuUsage(menu))
defineChecker(class_,
- NamesChecker(
- ("__call__", "__getitem__", "browserDefault"),
- permission,
- )
- )
+ NamesChecker(("__call__", "__getitem__", "browserDefault"),
+ permission))
provideView(for_, name, IBrowserPresentation, class_, layer)
-def _normalize(_context, schema_, for_, class_, template, default_template,
- fields, omit, view=EditView):
+def normalize(_context, schema_, for_, class_, template, default_template,
+ fields, omit, view=EditView):
schema = resolveInterface(_context, schema_)
if for_ is None:
@@ -243,39 +236,34 @@
else:
actions = []
-
- (schema, for_, bases, template, fields,
- ) = _normalize(
+ schema, for_, bases, template, fields = normalize(
_context, schema, for_, class_, template, 'edit.pt', fields, omit)
actions.append(
Action(
- discriminator = ('view', for_, name, IBrowserPresentation, layer),
- callable = EditViewFactory,
- args = (name, schema, label, permission, layer, template, 'edit.pt',
- bases,
- for_, fields, menu, usage),
+ discriminator=('view', for_, name, IBrowserPresentation, layer),
+ callable=EditViewFactory,
+ args=(name, schema, label, permission, layer, template, 'edit.pt',
+ bases, for_, fields, menu, usage),
)
)
return actions
def subedit(_context, name, schema, label,
- permission = 'zope.Public', layer = "default",
- class_ = None, for_ = None,
- template = None, omit=None, fields=None,
- fulledit=None, fulledit_label=None):
+ permission='zope.Public', layer="default",
+ class_=None, for_=None,
+ template=None, omit=None, fields=None,
+ fulledit=None, fulledit_label=None):
- (schema, for_, bases, template, fields,
- ) = _normalize(
+ schema, for_, bases, template, fields = normalize(
_context, schema, for_, class_, template, 'subedit.pt', fields, omit)
return [
Action(
- discriminator = ('view', for_, name, IBrowserPresentation, layer),
- callable = EditViewFactory,
- args = (name, schema, label, permission, layer, template, 'subedit.pt',
- bases,
- for_, fields, fulledit, fulledit_label),
+ discriminator=('view', for_, name, IBrowserPresentation, layer),
+ callable=EditViewFactory,
+ args=(name, schema, label, permission, layer, template, 'subedit.pt',
+ bases, for_, fields, fulledit, fulledit_label),
)
]