[Checkins] SVN: grokcore.json/trunk/s Now using grokcore.view new publication registration.
Souheil CHELFOUH
souheil at chelfouh.com
Wed Nov 3 07:49:52 EDT 2010
Log message for revision 118146:
Now using grokcore.view new publication registration.
The tests are fixed and running.
Changed:
U grokcore.json/trunk/setup.py
U grokcore.json/trunk/src/grokcore/json/ftesting.zcml
U grokcore.json/trunk/src/grokcore/json/meta.zcml
A grokcore.json/trunk/src/grokcore/json/testing.py
U grokcore.json/trunk/src/grokcore/json/tests/json/json_layers.py
U grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission.py
U grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission2.py
U grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission3.py
U grokcore.json/trunk/src/grokcore/json/tests/json/multiple_require.py
U grokcore.json/trunk/src/grokcore/json/tests/json/nocontext.py
U grokcore.json/trunk/src/grokcore/json/tests/json/nomethods.py
U grokcore.json/trunk/src/grokcore/json/tests/json/view_lookup.py
-=-
Modified: grokcore.json/trunk/setup.py
===================================================================
--- grokcore.json/trunk/setup.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/setup.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -11,8 +11,11 @@
)
tests_require = [
+ 'grokcore.view [test]',
+ 'grokcore.view [security_publication]',
'zope.testing',
'zope.app.wsgi',
+ 'zope.app.appsetup',
]
setup(
Modified: grokcore.json/trunk/src/grokcore/json/ftesting.zcml
===================================================================
--- grokcore.json/trunk/src/grokcore/json/ftesting.zcml 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/ftesting.zcml 2010-11-03 11:49:51 UTC (rev 118146)
@@ -5,7 +5,9 @@
i18n_domain="grokcore.json"
package="grokcore.json">
+ <include package="grokcore.view" file="ftesting.zcml" />
<include package="grokcore.json" />
+ <include package="grokcore.view" file="publication_security.zcml" />
<grok:grok package=".ftests" />
</configure>
Modified: grokcore.json/trunk/src/grokcore/json/meta.zcml
===================================================================
--- grokcore.json/trunk/src/grokcore/json/meta.zcml 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/meta.zcml 2010-11-03 11:49:51 UTC (rev 118146)
@@ -6,6 +6,7 @@
<!-- Load the grokkers -->
<include package="grokcore.component" file="meta.zcml" />
<include package="grokcore.view" file="meta.zcml" />
+ <include package="grokcore.security" file="meta.zcml" />
<grok:grok package=".meta" />
</configure>
Added: grokcore.json/trunk/src/grokcore/json/testing.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/testing.py (rev 0)
+++ grokcore.json/trunk/src/grokcore/json/testing.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+
+from zope.configuration.config import ConfigurationMachine
+from grokcore.component import zcml
+
+
+def grok(module_name):
+ config = ConfigurationMachine()
+ zcml.do_grok('grokcore.component.meta', config)
+ zcml.do_grok('grokcore.security.meta', config)
+ zcml.do_grok('grokcore.view.meta', config)
+ zcml.do_grok('grokcore.view.templatereg', config)
+ zcml.do_grok('grokcore.json', config)
+ zcml.do_grok(module_name, config)
+ config.execute_actions()
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/json_layers.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/json_layers.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/json_layers.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -31,7 +31,7 @@
>>> view = getMultiAdapter((mammoth, jsonlayer_request), name='public')
Traceback (most recent call last):
...
- ComponentLookupError: ((<grok.tests.json.json_layers.Mammoth object at ...>,
+ ComponentLookupError: ((<grokcore.json.tests.json.json_layers.Mammoth object at ...>,
<zope.publisher.browser.TestRequest instance URL=http://127.0.0.1>),
<InterfaceClass zope.interface.Interface>, 'public')
@@ -41,7 +41,7 @@
>>> view = getMultiAdapter((mammoth, request), name='another')
Traceback (most recent call last):
...
- ComponentLookupError: ((<grok.tests.json.json_layers.Mammoth object at ...>,
+ ComponentLookupError: ((<grokcore.json.tests.json.json_layers.Mammoth object at ...>,
<zope.publisher.browser.TestRequest instance URL=http://127.0.0.1>),
<InterfaceClass zope.interface.Interface>, 'another')
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -2,9 +2,10 @@
A permission has to be defined first (using grok.Permission for example)
before it can be used in grok.require() in an JSON class.
- >>> grok.testing.grok(__name__)
+ >>> from grokcore.json import testing
+ >>> testing.grok(__name__)
Traceback (most recent call last):
- ConfigurationExecutionError: martian.error.GrokError: Undefined permission 'doesnt.exist' in <class 'grok.tests.json.missing_permission.MissingPermission'>. Use grok.Permission first.
+ ConfigurationExecutionError: martian.error.GrokError: Undefined permission 'doesnt.exist' in <class 'grokcore.json.tests.json.missing_permission.MissingPermission'>. Use grok.Permission first.
...
"""
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission2.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission2.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission2.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -1,3 +1,4 @@
+
"""
A permission has to be defined first (using grok.Permission for example)
before it can be used in @grok.require().
@@ -2,5 +3,6 @@
- >>> grok.testing.grok(__name__)
+ >>> from grokcore.json import testing
+ >>> testing.grok(__name__)
Traceback (most recent call last):
- ConfigurationExecutionError: martian.error.GrokError: Undefined permission 'doesnt.exist' in <class 'grok.tests.json.missing_permission2.MissingPermission'>. Use grok.Permission first.
+ ConfigurationExecutionError: martian.error.GrokError: Undefined permission 'doesnt.exist' in <class 'grokcore.json.tests.json.missing_permission2.MissingPermission'>. Use grok.Permission first.
...
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission3.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission3.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/missing_permission3.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -2,7 +2,8 @@
An undefined permission that's never used (because it's being shadowed
by a method-level directive) doesn't raise an error:
- >>> grok.testing.grok(__name__)
+ >>> from grokcore.json import testing
+ >>> testing.grok(__name__)
"""
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/multiple_require.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/multiple_require.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/multiple_require.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -1,10 +1,11 @@
"""
Multiple calls of grok.require in one class are not allowed.
- >>> grok.testing.grok(__name__)
+ >>> from grokcore.json import testing
+ >>> testing.grok(__name__)
Traceback (most recent call last):
...
- GrokError: grok.require was called multiple times in <class 'grok.tests.json.multiple_require.MultipleJSON'>. It may only be set once for a class.
+ GrokError: grok.require was called multiple times in <class 'grokcore.json.tests.json.multiple_require.MultipleJSON'>. It may only be set once for a class.
"""
import grokcore.json as grok
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/nocontext.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/nocontext.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/nocontext.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -3,11 +3,12 @@
Context-determination follows the same rules as for adapters. We just check
whether it's hooked up at all:
- >>> grok.testing.grok(__name__)
+ >>> from grokcore.json import testing
+ >>> testing.grok(__name__)
Traceback (most recent call last):
...
GrokError: No module-level context for
- <class 'grok.tests.json.nocontext.TestJSON'>, please use the
+ <class 'grokcore.json.tests.json.nocontext.TestJSON'>, please use the
'context' directive.
"""
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/nomethods.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/nomethods.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/nomethods.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -1,8 +1,9 @@
"""
- >>> grok.testing.grok(__name__)
+ >>> from grokcore.json import testing
+ >>> testing.grok(__name__)
Traceback (most recent call last):
...
- GrokError: <class 'grok.tests.json.nomethods.RemoteCaveman'> does not
+ GrokError: <class 'grokcore.json.tests.json.nomethods.RemoteCaveman'> does not
define any public methods. Please add methods to this class to enable
its registration.
Modified: grokcore.json/trunk/src/grokcore/json/tests/json/view_lookup.py
===================================================================
--- grokcore.json/trunk/src/grokcore/json/tests/json/view_lookup.py 2010-11-03 11:48:19 UTC (rev 118145)
+++ grokcore.json/trunk/src/grokcore/json/tests/json/view_lookup.py 2010-11-03 11:49:51 UTC (rev 118146)
@@ -27,7 +27,7 @@
>>> view = getMultiAdapter((mammoth, request), name='_private')
Traceback (most recent call last):
...
- ComponentLookupError: ((<grok.tests.json.view_lookup.Mammoth object at ...>,
+ ComponentLookupError: ((<grokcore.json.tests.json.view_lookup.Mammoth object at ...>,
<zope.publisher.browser.TestRequest instance URL=http://127.0.0.1>),
<InterfaceClass zope.interface.Interface>, '_private')
@@ -38,7 +38,7 @@
>>> view = getMultiAdapter((mammoth, request), name='__call__')
Traceback (most recent call last):
...
- ComponentLookupError: ((<grok.tests.json.view_lookup.Mammoth object at ...>,
+ ComponentLookupError: ((<grokcore.json.tests.json.view_lookup.Mammoth object at ...>,
<zope.publisher.browser.TestRequest instance URL=http://127.0.0.1>),
<InterfaceClass zope.interface.Interface>, '__call__')
@@ -48,14 +48,14 @@
>>> view = getMultiAdapter((mammoth, request), name='browserDefault')
Traceback (most recent call last):
...
- ComponentLookupError: ((<grok.tests.json.view_lookup.Mammoth object at ...>,
+ ComponentLookupError: ((<grokcore.json.tests.json.view_lookup.Mammoth object at ...>,
<zope.publisher.browser.TestRequest instance URL=http://127.0.0.1>),
<InterfaceClass zope.interface.Interface>, 'browserDefault')
>>> view = getMultiAdapter((mammoth, request), name='publishTraverse')
Traceback (most recent call last):
...
- ComponentLookupError: ((<grok.tests.json.view_lookup.Mammoth object at ...>,
+ ComponentLookupError: ((<grokcore.json.tests.json.view_lookup.Mammoth object at ...>,
<zope.publisher.browser.TestRequest instance URL=http://127.0.0.1>),
<InterfaceClass zope.interface.Interface>, 'publishTraverse')
More information about the checkins
mailing list