[Checkins] SVN: grokcore.registries/trunk/s Removed zope.app dependencies

Souheil Chelfouh cvs-admin at zope.org
Thu Aug 9 13:51:28 UTC 2012


Log message for revision 127460:
  Removed zope.app dependencies

Changed:
  U   grokcore.registries/trunk/setup.py
  U   grokcore.registries/trunk/src/grokcore/registries/README.txt
  U   grokcore.registries/trunk/src/grokcore/registries/ftesting.zcml
  U   grokcore.registries/trunk/src/grokcore/registries/ftests/registries/grok_integration.py
  U   grokcore.registries/trunk/src/grokcore/registries/ftests/test_grok_functional.py
  U   grokcore.registries/trunk/src/grokcore/registries/tests/test_doc.py

-=-
Modified: grokcore.registries/trunk/setup.py
===================================================================
--- grokcore.registries/trunk/setup.py	2012-08-09 13:06:57 UTC (rev 127459)
+++ grokcore.registries/trunk/setup.py	2012-08-09 13:51:24 UTC (rev 127460)
@@ -14,9 +14,6 @@
     )
 
 tests_require = [
-    'zope.app.appsetup',
-    'zope.app.wsgi',
-    'zope.app.testing',
     'grokcore.component',
     'grokcore.site',
     'zope.testing',
@@ -28,7 +25,7 @@
     author='Grok Team',
     author_email='grok-dev at zope.org',
     url='http://grok.zope.org',
-    download_url='http://cheeseshop.python.org/pypi/grokcore.json/',
+    download_url='http://cheeseshop.python.org/pypi/grokcore.registries/',
     description='Advanced Registry Behavior for Grok.',
     long_description=long_description,
     license='ZPL',

Modified: grokcore.registries/trunk/src/grokcore/registries/README.txt
===================================================================
--- grokcore.registries/trunk/src/grokcore/registries/README.txt	2012-08-09 13:06:57 UTC (rev 127459)
+++ grokcore.registries/trunk/src/grokcore/registries/README.txt	2012-08-09 13:51:24 UTC (rev 127460)
@@ -3,9 +3,9 @@
 ===================
 
 With the help of this package you are now able to create
-your on BaseComponents Registries. With the help of
-a zcml directive ´registerIn´ you can choose in which
-Registry your grok Components will be registerd.
+your on BaseComponents Registries. thanks to a zcml
+directive, ´registerIn´, you can choose in which
+Registry your grok Components will be registered.
 
 Setup
 -----
@@ -60,18 +60,19 @@
 Now the registerIn function comes into the game. We register all stuff
 from ´registries.global´ to the GlobalSiteManager, and the contents of
 ´registries.local´ to our custom Registry.
-  >>> from zope.configuration import xmlconfig
 
 
- >>> context = xmlconfig.string('''
- ... <configure i18n_domain="zope">
- ...   <include package="zope.component" file="meta.zcml" />
- ...   <include package="grokcore.registries" file="meta.zcml" />
- ...   <include package="grokcore.site" />
- ... </configure>
- ... ''')
+  >>> from zope.configuration import xmlconfig
 
   >>> context = xmlconfig.string('''
+  ... <configure i18n_domain="zope">
+  ...   <include package="zope.component" file="meta.zcml" />
+  ...   <include package="grokcore.registries" file="meta.zcml" />
+  ...   <include package="grokcore.site" />
+  ... </configure>
+  ... ''')
+
+  >>> context = xmlconfig.string('''
   ... <configure xmlns="http://namespaces.zope.org/zope"
   ...            xmlns:grok="http://namespaces.zope.org/grok"
   ...            i18n_domain="zope">

Modified: grokcore.registries/trunk/src/grokcore/registries/ftesting.zcml
===================================================================
--- grokcore.registries/trunk/src/grokcore/registries/ftesting.zcml	2012-08-09 13:06:57 UTC (rev 127459)
+++ grokcore.registries/trunk/src/grokcore/registries/ftesting.zcml	2012-08-09 13:51:24 UTC (rev 127460)
@@ -1,22 +1,18 @@
 <configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:grok="http://namespaces.zope.org/grok"
-   xmlns:browser="http://namespaces.zope.org/browser"
    i18n_domain="grokcore.registries"
    package="grokcore.registries">
 
-  <include package="zope.app.appsetup" file="ftesting.zcml" />
-
   <include package="grokcore.registries" file="meta.zcml" />
   <include package="grokcore.registries" />
 
   <grok:grok package="grokcore.registries.ftests" />
-
   <grok:grok package="grokcore.registries.tests.registries.global" />
-  <registerIn registry="grokcore.registries.ftests.registries.basic.specialRegistry">
-      <grok:grok package="grokcore.registries.tests.registries.local" />
+
+  <registerIn
+      registry="grokcore.registries.ftests.registries.basic.specialRegistry">
+    <grok:grok package="grokcore.registries.tests.registries.local" />
   </registerIn>
 
-
 </configure>
-

Modified: grokcore.registries/trunk/src/grokcore/registries/ftests/registries/grok_integration.py
===================================================================
--- grokcore.registries/trunk/src/grokcore/registries/ftests/registries/grok_integration.py	2012-08-09 13:06:57 UTC (rev 127459)
+++ grokcore.registries/trunk/src/grokcore/registries/ftests/registries/grok_integration.py	2012-08-09 13:51:24 UTC (rev 127460)
@@ -1,7 +1,6 @@
 """
- >>> root = getRootFolder()
- >>> create_application(MyApplication, root, 'app')
- <grokcore.registries.ftests.registries.grok_integration.MyApplication ...>
+ >>> root = {}
+ >>> root['app'] = MyApplication()
 
  >>> from zope.component import getUtility
  >>> from grokcore.registries.tests.registries.interfaces import IExample
@@ -17,8 +16,8 @@
  >>> specialRegistry.getUtility(IExample, name=u'local')
  <grokcore.registries.tests.registries.local.MyExample object at ...>
 
+ >>> from zope.component.hooks import setSite
  >>> app = root['app']
- >>> from zope.component.hooks import setSite
  >>> setSite(root['app'])
 
  >>> getUtility(IExample, name=u'local')
@@ -28,14 +27,16 @@
 
 """
 
-from grokcore.site import Application
-from grokcore.site.util import create_application
+from zope.component.persistentregistry import PersistentComponents
 from grokcore.registries.ftests.registries.basic import specialRegistry
 
 
-class MyApplication(Application):
+class MyApplication(object):
 
+    def __init__(self):
+        self._sm = PersistentComponents()
+
     def getSiteManager(self):
-        current = super(MyApplication, self).getSiteManager()
+        current = self._sm
         current.__bases__ += (specialRegistry,)
-        return current
\ No newline at end of file
+        return current

Modified: grokcore.registries/trunk/src/grokcore/registries/ftests/test_grok_functional.py
===================================================================
--- grokcore.registries/trunk/src/grokcore/registries/ftests/test_grok_functional.py	2012-08-09 13:06:57 UTC (rev 127459)
+++ grokcore.registries/trunk/src/grokcore/registries/ftests/test_grok_functional.py	2012-08-09 13:51:24 UTC (rev 127460)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
 import unittest
 import grokcore.registries
 
@@ -3,7 +5,7 @@
 from pkg_resources import resource_listdir
 from zope.testing import doctest
-from zope.app.appsetup.testlayer import ZODBLayer
+from zope.component.testlayer import ZCMLFileLayer
 
-FunctionalLayer = ZODBLayer(grokcore.registries)
+FunctionalLayer = ZCMLFileLayer(grokcore.registries)
 
 
@@ -20,7 +22,6 @@
         dottedname = 'grokcore.registries.ftests.%s.%s' % (name, filename[:-3])
         test = doctest.DocTestSuite(
             dottedname,
-            extraglobs=dict(getRootFolder=FunctionalLayer.getRootFolder),
             optionflags=(doctest.ELLIPSIS+
                          doctest.NORMALIZE_WHITESPACE+
                          doctest.REPORT_NDIFF)

Modified: grokcore.registries/trunk/src/grokcore/registries/tests/test_doc.py
===================================================================
--- grokcore.registries/trunk/src/grokcore/registries/tests/test_doc.py	2012-08-09 13:06:57 UTC (rev 127459)
+++ grokcore.registries/trunk/src/grokcore/registries/tests/test_doc.py	2012-08-09 13:51:24 UTC (rev 127460)
@@ -1,13 +1,35 @@
+# -*- coding: utf-8 -*-
+
+import sys
 import doctest
 import unittest
-from zope.app.testing import placelesssetup, setup
+from zope.component import testing as base_testing
 
+
+class FakeModule:
+    """A fake module."""
+    
+    def __init__(self, dict):
+        self.__dict = dict
+
+    def __getattr__(self, name):
+        try:
+            return self.__dict[name]
+        except KeyError:
+            raise AttributeError(name)
+
+
 def setUp(test):
-    placelesssetup.setUp(test)
-    setup.setUpTestAsModule(test, name='README')
+    test.globs['__name__'] = 'README'
+    sys.modules['README'] = FakeModule(test.globs)
+    base_testing.setUp(test)
 
+
 def tearDown(test):
-    placelesssetup.tearDown(test)
+    del sys.modules[test.globs['__name__']]
+    test.globs.clear()
+    base_testing.tearDown(test)
+    
 
 def test_suite():
     return unittest.TestSuite((



More information about the checkins mailing list