[Zope3-checkins] SVN: Zope3/branches/3.3/src/zope/viewlet/ Remove ztapi import for package outside 'zope.app'.

Florent Xicluna laxyf at yahoo.fr
Thu Sep 7 09:40:43 EDT 2006


Log message for revision 70028:
  Remove ztapi import for package outside 'zope.app'.
  'zope.viewlet' was the last package using ztapi, outside of zope.app.

Changed:
  U   Zope3/branches/3.3/src/zope/viewlet/README.txt
  U   Zope3/branches/3.3/src/zope/viewlet/tests.py

-=-
Modified: Zope3/branches/3.3/src/zope/viewlet/README.txt
===================================================================
--- Zope3/branches/3.3/src/zope/viewlet/README.txt	2006-09-07 13:22:47 UTC (rev 70027)
+++ Zope3/branches/3.3/src/zope/viewlet/README.txt	2006-09-07 13:40:42 UTC (rev 70028)
@@ -363,8 +363,10 @@
   ...     def __call__(self):
   ...         return '/@@/resource.js'
 
-  >>> from zope.app.testing import ztapi
-  >>> ztapi.browserResource('resource.js', JSResource)
+  >>> zope.component.provideAdapter(
+  ...     JSResource,
+  ...     (IDefaultBrowserLayer,),
+  ...     zope.interface.Interface, name='resource.js')
 
   >>> JSViewlet = viewlet.JavaScriptViewlet('resource.js')
   >>> print JSViewlet(content, request, view, manager).render().strip()
@@ -380,7 +382,10 @@
   ...     def __call__(self):
   ...         return '/@@/resource.css'
 
-  >>> ztapi.browserResource('resource.css', CSSResource)
+  >>> zope.component.provideAdapter(
+  ...     CSSResource,
+  ...     (IDefaultBrowserLayer,),
+  ...     zope.interface.Interface, name='resource.css')
 
   >>> CSSViewlet = viewlet.CSSViewlet('resource.css')
   >>> print CSSViewlet(content, request, view, manager).render().strip()

Modified: Zope3/branches/3.3/src/zope/viewlet/tests.py
===================================================================
--- Zope3/branches/3.3/src/zope/viewlet/tests.py	2006-09-07 13:22:47 UTC (rev 70027)
+++ Zope3/branches/3.3/src/zope/viewlet/tests.py	2006-09-07 13:40:42 UTC (rev 70028)
@@ -18,11 +18,12 @@
 __docformat__ = 'restructuredtext'
 
 import unittest
+import zope.component
 import zope.interface
 import zope.security
 from zope.testing import doctest
 from zope.testing.doctestunit import DocTestSuite, DocFileSuite
-from zope.app.testing import setup, ztapi
+from zope.app.testing import setup
 
 class TestParticipation(object):
     principal = 'foobar'
@@ -34,8 +35,10 @@
     # resource namespace setup
     from zope.traversing.interfaces import ITraversable
     from zope.traversing.namespace import resource
-    ztapi.provideAdapter(None, ITraversable, resource, name="resource")
-    ztapi.provideView(None, None, ITraversable, "resource", resource)
+    zope.component.provideAdapter(
+        resource, (None,), ITraversable, name = "resource")
+    zope.component.provideAdapter(
+        resource, (None, None), ITraversable, name = "resource")
 
     from zope.app.pagetemplate import metaconfigure
     from zope.contentprovider import tales



More information about the Zope3-Checkins mailing list