[Checkins] SVN: megrok.layout/trunk/ Cleaning dependencies

Souheil CHELFOUH souheil at chelfouh.com
Mon Oct 18 05:59:23 EDT 2010


Log message for revision 117662:
  Cleaning dependencies

Changed:
  U   megrok.layout/trunk/buildout.cfg
  U   megrok.layout/trunk/setup.py
  U   megrok.layout/trunk/src/megrok/layout/README.txt
  D   megrok.layout/trunk/src/megrok/layout/ftesting.zcml
  U   megrok.layout/trunk/src/megrok/layout/ftests/__init__.py
  A   megrok.layout/trunk/src/megrok/layout/ftests/ftesting.zcml
  U   megrok.layout/trunk/src/megrok/layout/ftests/test_form.py
  U   megrok.layout/trunk/src/megrok/layout/ftests/test_general.py
  U   megrok.layout/trunk/src/megrok/layout/messages.py
  D   megrok.layout/trunk/src/megrok/layout/testing.py

-=-
Modified: megrok.layout/trunk/buildout.cfg
===================================================================
--- megrok.layout/trunk/buildout.cfg	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/buildout.cfg	2010-10-18 09:59:23 UTC (rev 117662)
@@ -1,7 +1,8 @@
 [buildout]
 develop = .
 parts = interpreter test
-extends = http://grok.zope.org/releaseinfo/grok-1.1a1.cfg
+extends = http://svn.zope.org/*checkout*/groktoolkit/trunk/grok.cfg
+
 versions = versions
 
 [versions]

Modified: megrok.layout/trunk/setup.py
===================================================================
--- megrok.layout/trunk/setup.py	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/setup.py	2010-10-18 09:59:23 UTC (rev 117662)
@@ -6,10 +6,21 @@
                    open(os.path.join('docs', 'HISTORY.txt')).read()
 
 test_requires = [
+    'zope.annotation',
+    'zope.app.appsetup',
+    'zope.app.publication',
+    'zope.app.testing',
+    'zope.browserpage',
+    'zope.configuration',
+    'zope.password',
+    'zope.principalregistry',
+    'zope.schema',
     'zope.security',
     'zope.securitypolicy',
     'zope.testbrowser',
-    'zope.app.zcmlfiles']
+    'zope.testing',
+    'zope.traversing',
+    ]
 
 setup(name='megrok.layout',
       version='1.0b1',
@@ -37,13 +48,15 @@
       install_requires=[
           'grokcore.component',
           'grokcore.formlib',
+          'grokcore.security',
           'grokcore.view >= 1.13.1',
+          'martian',
           'setuptools',
           'z3c.flashmessage',
           'zope.component',
           'zope.interface',
           'zope.publisher',
           'zope.session',
-          'zope.site'
+          'zope.site',
           ],
       )

Modified: megrok.layout/trunk/src/megrok/layout/README.txt
===================================================================
--- megrok.layout/trunk/src/megrok/layout/README.txt	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/src/megrok/layout/README.txt	2010-10-18 09:59:23 UTC (rev 117662)
@@ -12,12 +12,9 @@
 
 First we grok this package's grokkers::
 
-  >>> from megrok.layout import testing
   >>> import grokcore.component as grok
-  >>> testing.grok('megrok.layout')
 
 
-
 Layout
 ======
 

Deleted: megrok.layout/trunk/src/megrok/layout/ftesting.zcml
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftesting.zcml	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/src/megrok/layout/ftesting.zcml	2010-10-18 09:59:23 UTC (rev 117662)
@@ -1,39 +0,0 @@
-<configure
-    xmlns="http://namespaces.zope.org/zope"
-    xmlns:grok="http://namespaces.zope.org/grok">
-
-  <include package="zope.app.zcmlfiles" file="meta.zcml" />
-  <include package="zope.securitypolicy" file="meta.zcml" />
-
-  <include package="megrok.layout" />
-  <include package="zope.app.zcmlfiles" />
-  <include package="zope.app.authentication" />
-
-  <grok:grok package="megrok.layout.ftests" />
-
-  <securityPolicy
-      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
-      />
-
-  <unauthenticatedPrincipal
-      id="zope.anybody"
-      title="Unauthenticated User"
-      />
-
-  <grant
-      permission="zope.View"
-      principal="zope.anybody"
-      />
-
-  <principal
-      id="zope.mgr"
-      title="Manager"
-      login="mgr"
-      password="mgrpw"
-      />
-
-  <role id="zope.Manager" title="Site Manager" />
-  <grantAll role="zope.Manager" />
-  <grant role="zope.Manager" principal="zope.mgr" />
-
-</configure>

Modified: megrok.layout/trunk/src/megrok/layout/ftests/__init__.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftests/__init__.py	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/src/megrok/layout/ftests/__init__.py	2010-10-18 09:59:23 UTC (rev 117662)
@@ -1,9 +1,23 @@
-import os.path                                                                                                               
-import megrok.layout
+# -*- coding: utf-8 -*-
+
+import os.path
 from zope.app.testing.functional import ZCMLLayer
+from zope.configuration.config import ConfigurationMachine
+from grokcore.component import zcml
 
-ftesting_zcml = os.path.join(os.path.dirname(megrok.layout.__file__),
-                             'ftesting.zcml')
-FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer',
-                            allow_teardown=True)
 
+ftesting_zcml = os.path.join(
+    os.path.dirname(__file__), 'ftesting.zcml')
+
+FunctionalLayer = ZCMLLayer(
+    ftesting_zcml, __name__, 'FunctionalLayer', allow_teardown=True)
+
+
+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(module_name, config)
+    config.execute_actions()

Added: megrok.layout/trunk/src/megrok/layout/ftests/ftesting.zcml
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftests/ftesting.zcml	                        (rev 0)
+++ megrok.layout/trunk/src/megrok/layout/ftests/ftesting.zcml	2010-10-18 09:59:23 UTC (rev 117662)
@@ -0,0 +1,51 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:grok="http://namespaces.zope.org/grok">
+
+  <include package="zope.component" file="meta.zcml" />
+  <include package="zope.principalregistry" file="meta.zcml" />
+  <include package="zope.security" file="meta.zcml" />
+  <include package="zope.securitypolicy" file="meta.zcml" />
+  <include package="zope.browserpage" file="meta.zcml" />
+  <include package="zope.app.publication" file="meta.zcml" />
+
+  <include package="zope.annotation" />
+  <include package="zope.password" />
+  <include package="zope.security" />
+  <include package="zope.site" />
+  <include package="zope.traversing" />
+  <include package="zope.traversing.browser" />
+  <include package="zope.principalregistry" />
+  <include package="zope.app.appsetup" />
+  <include package="zope.app.publication" />
+
+  <include package="megrok.layout" />
+  <grok:grok package="megrok.layout.ftests" />
+
+
+  <securityPolicy
+      component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+      />
+
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User"
+      />
+
+  <grant
+      permission="zope.View"
+      principal="zope.anybody"
+      />
+
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw"
+      />
+
+  <role id="zope.Manager" title="Site Manager" />
+  <grantAll role="zope.Manager" />
+  <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>

Modified: megrok.layout/trunk/src/megrok/layout/ftests/test_form.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftests/test_form.py	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/src/megrok/layout/ftests/test_form.py	2010-10-18 09:59:23 UTC (rev 117662)
@@ -114,11 +114,12 @@
 
 """
 import grokcore.component as grok
+
 from grokcore.view import templatedir
-
+from megrok.layout import Layout, DisplayForm, EditForm
 from zope import interface, schema
-from megrok.layout import Layout, DisplayForm, EditForm
 
+
 templatedir('templates')
 
 

Modified: megrok.layout/trunk/src/megrok/layout/ftests/test_general.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/ftests/test_general.py	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/src/megrok/layout/ftests/test_general.py	2010-10-18 09:59:23 UTC (rev 117662)
@@ -1,36 +1,23 @@
+# -*- coding: utf-8 -*-
+
 import unittest
 import doctest
-from zope.testing import cleanup
-from zope.testing import module
+from zope.testing import cleanup, module
 import zope.component.eventtesting
-from zope import component
-from megrok import layout
-from grokcore.component.testing import grok_component as default_grok_component
+from megrok.layout.ftests import grok
+from grokcore.component.testing import grok_component
 
 
-def grok_component(name, component, **kwargs):
-    # Because of undocumented but ok change in grokcore.component,
-    # grok_component doesn't work anymore in doctests.
-    component.__grok_module__ = 'megrok.layout'
-    return default_grok_component(name, component, **kwargs)
-
-
 def moduleSetUp(test):
-    module.setUp(test, '__main__')
+    grok('megrok.layout')
 
 def moduleTearDown(test):
     module.tearDown(test)
     cleanup.cleanUp()
 
-def zopeSetUp(test):
-    zope.component.eventtesting.setUp(test)
-
-def zopeTearDown(test):
-    cleanup.cleanUp()
-
 def test_suite():
     optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
-    globs = {'grok_component': grok_component}
+    globs = {'grok_component': grok_component, '__name__': 'megrok.layout'}
     suite = unittest.TestSuite()
 
     suite.addTest(

Modified: megrok.layout/trunk/src/megrok/layout/messages.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/messages.py	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/src/megrok/layout/messages.py	2010-10-18 09:59:23 UTC (rev 117662)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-"""This module can be grokked you need a generic flash message setup.
+"""This module can be grokked if you need a generic flash message setup.
 """
 import grokcore.component
 import z3c.flashmessage.sources

Deleted: megrok.layout/trunk/src/megrok/layout/testing.py
===================================================================
--- megrok.layout/trunk/src/megrok/layout/testing.py	2010-10-18 09:59:17 UTC (rev 117661)
+++ megrok.layout/trunk/src/megrok/layout/testing.py	2010-10-18 09:59:23 UTC (rev 117662)
@@ -1,11 +0,0 @@
-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(module_name, config)
-    config.execute_actions()



More information about the checkins mailing list