[Checkins] SVN: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/ code cleaning
Christian Klinger
cklinger at novareto.de
Thu Mar 18 05:33:14 EDT 2010
Log message for revision 110051:
code cleaning
Changed:
U megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/components.py
U megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/configure.zcml
U megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/ftesting.zcml
U megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.py
D megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.zcml
U megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_layout_wizard.py
U megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_wizard.py
-=-
Modified: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/components.py
===================================================================
--- megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/components.py 2010-03-18 08:43:36 UTC (rev 110050)
+++ megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/components.py 2010-03-18 09:33:14 UTC (rev 110051)
@@ -1,14 +1,13 @@
+# -*- coding: utf-8 -*-
+
import martian
import grokcore.view
-import megrok.layout
-from z3c.form import form
-from zope import component
from z3c.wizard import wizard, step
+from zope.publisher.publish import mapply
from megrok.z3cform.base import PageForm, Form
-from zope.publisher.publish import mapply
-from megrok.layout import Page
+
class WizardForm(Form, wizard.Wizard, grokcore.view.View):
"""Base Class for a z3c.wizdard.
"""
@@ -17,13 +16,16 @@
def update(self):
self.updateForm()
+
class BaseStep(step.EditStep):
- """ Base Step
+ """Needed for one Grokker
"""
+
class Step(BaseStep):
- """A Step for the Witzard
+ """A Step for the Wizard
"""
+
def __call__(self):
mapply(self.update, (), self.request)
if self.request.response.getStatus() in (302, 303):
@@ -33,10 +35,10 @@
return self.render()
-class PageStep(Page, BaseStep):
- """A Step for the Witzard
+class PageStep(PageForm, BaseStep):
+ """A Step for the Wizard renderd in an ILayout component
"""
-
+
def __init__(self, context, request, wizard):
self.context = context
self.request = request
Modified: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/configure.zcml
===================================================================
--- megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/configure.zcml 2010-03-18 08:43:36 UTC (rev 110050)
+++ megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/configure.zcml 2010-03-18 09:33:14 UTC (rev 110051)
@@ -1,14 +1,21 @@
<configure
xmlns="http://namespaces.zope.org/zope"
+ xmlns:grok="http://namespaces.zope.org/grok"
xmlns:z3c="http://namespaces.zope.org/z3c">
+ <include package="grokcore.component" file="meta.zcml" />
+ <include package="grokcore.view" file="meta.zcml" />
+
<include package="megrok.z3cform.base" file="meta.zcml" />
<include package="megrok.z3cform.base" />
- <include package="z3c.template" file="meta.zcml"/>
+
+ <include package="z3c.template" file="meta.zcml"/>
<include package="z3c.macro"/>
<include package="z3c.macro" file="meta.zcml"/>
<include package="z3c.wizard"/>
+ <grok:grok package=".meta" />
+
<z3c:macro
name="widget-rows"
macro="widget-rows"
Modified: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/ftesting.zcml
===================================================================
--- megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/ftesting.zcml 2010-03-18 08:43:36 UTC (rev 110050)
+++ megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/ftesting.zcml 2010-03-18 09:33:14 UTC (rev 110051)
@@ -2,13 +2,17 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:grok="http://namespaces.zope.org/grok">
- <include package="grok" />
- <include package="grok" file="meta.zcml"/>
- <include package="megrok.z3cform.wizard" file="meta.zcml" />
+ <include package="zope.app.zcmlfiles" file="meta.zcml" />
+ <include package="zope.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+
+ <include package="grokcore.view" file="meta.zcml"/>
+ <include package="megrok.z3cform.base" file="default_form_layer.zcml"/>
<include package="megrok.z3cform.wizard" />
- <include package="megrok.z3cform.base" file="default_form_layer.zcml"/>
<grok:grok package="megrok.z3cform.wizard.tests" />
+
<securityPolicy
component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
/>
Modified: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.py
===================================================================
--- megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.py 2010-03-18 08:43:36 UTC (rev 110050)
+++ megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.py 2010-03-18 09:33:14 UTC (rev 110051)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
import martian
import grokcore.component
@@ -16,4 +18,3 @@
wizardStepDirective(config, factory, name,
'zope.Public', wizard=context)
return True
-
Deleted: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.zcml
===================================================================
--- megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.zcml 2010-03-18 08:43:36 UTC (rev 110050)
+++ megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/meta.zcml 2010-03-18 09:33:14 UTC (rev 110051)
@@ -1,10 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:grok="http://namespaces.zope.org/grok">
-
- <include package="grokcore.component" file="meta.zcml"/>
-
- <grok:grok package=".meta" />
-
-</configure>
-
Modified: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_layout_wizard.py
===================================================================
--- megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_layout_wizard.py 2010-03-18 08:43:36 UTC (rev 110050)
+++ megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_layout_wizard.py 2010-03-18 09:33:14 UTC (rev 110051)
@@ -141,16 +141,16 @@
"""
-import grokcore.component as grok
import zope.schema
import zope.interface
+import grokcore.component as grok
-from megrok.z3cform import wizard as z3cwizard
+from z3c.form import field
+from megrok.layout import Layout
from z3c.wizard import wizard, step
from zope.location.interfaces import ILocation
+from megrok.z3cform import wizard as z3cwizard
from zope.schema.fieldproperty import FieldProperty
-from z3c.form import field
-from megrok.layout import Layout
class MyLayout(Layout):
@@ -159,6 +159,7 @@
def render(self):
return "<html> %s </html>" % self.view.contentn()
+
class IPerson(ILocation):
"""Person interface."""
Modified: megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_wizard.py
===================================================================
--- megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_wizard.py 2010-03-18 08:43:36 UTC (rev 110050)
+++ megrok.z3cform.wizard/trunk/src/megrok/z3cform/wizard/tests/test_wizard.py 2010-03-18 09:33:14 UTC (rev 110051)
@@ -141,16 +141,17 @@
"""
-import grokcore.component as grok
import zope.schema
import zope.interface
+import grokcore.component as grok
-from megrok.z3cform import wizard as z3cwizard
+from z3c.form import field
from z3c.wizard import wizard, step
from zope.location.interfaces import ILocation
+from megrok.z3cform import wizard as z3cwizard
from zope.schema.fieldproperty import FieldProperty
-from z3c.form import field
+
class IPerson(ILocation):
"""Person interface."""
@@ -171,9 +172,11 @@
street = FieldProperty(IPerson['street'])
city = FieldProperty(IPerson['city'])
+
class IPersonWizard(z3cwizard.IWizard):
"""Person wizard marker."""
+
class PersonWizard(z3cwizard.WizardForm):
""" Wizard form."""
grok.implements(IPersonWizard)
More information about the checkins
mailing list