[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ Merged changes from the trunk revision 26777

Dmitry Vasiliev dima at hlabs.spb.ru
Tue Jul 27 04:17:15 EDT 2004


Log message for revision 26778:
  Merged changes from the trunk revision 26777
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/__init__.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/browser/apidoc.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/__init__.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/__init__.py	2004-07-27 08:12:32 UTC (rev 26777)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/__init__.py	2004-07-27 08:17:15 UTC (rev 26778)
@@ -35,7 +35,7 @@
 
       >>> doc = APIDocumentation(None, '++apidoc++')
       >>> doc.get('ZCML').title
-      'ZCML Reference'
+      u'ZCML Reference'
 
       >>> doc.get('Documentation') is None
       True
@@ -53,7 +53,7 @@
     
     def get(self, key, default=None):
         """See zope.app.container.interfaces.IReadContainer"""
-        utility = zapi.queryUtility(IDocumentationModule, key, default, self)
+        utility = zapi.queryUtility(IDocumentationModule, key, default)
         if utility != default:
             locate(utility, self, key)
         return utility

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/browser/apidoc.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/browser/apidoc.py	2004-07-27 08:12:32 UTC (rev 26777)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/browser/apidoc.py	2004-07-27 08:17:15 UTC (rev 26778)
@@ -32,7 +32,7 @@
           >>> info = view.getModuleList()
           >>> info = [(i['name'], i['title']) for i in info]
           >>> print info
-          [('Interface', 'Interfaces'), ('ZCML', 'ZCML Reference')]
+          [(u'Interface', u'Interfaces'), (u'ZCML', u'ZCML Reference')]
         """
         items = list(self.context.items())
         items.sort()

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py	2004-07-27 08:12:32 UTC (rev 26777)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/tests.py	2004-07-27 08:17:15 UTC (rev 26778)
@@ -17,24 +17,34 @@
 """
 from pprint import PrettyPrinter
 import unittest
-from zope.app import zapi
+
+from zope.component.interfaces import IFactory
 from zope.app.traversing.interfaces import IContainmentRoot
 from zope.app.location import LocationProxy
-from zope.app.tests import placelesssetup
+from zope.app.tests import placelesssetup, ztapi
 from zope.interface import implements
 from zope.app.apidoc.interfaces import IDocumentationModule
 from zope.app.apidoc.ifacemodule import InterfaceModule
 from zope.app.apidoc.zcmlmodule import ZCMLModule
 from zope.testing.doctestunit import DocTestSuite
 
+from zope.app.renderer.rest import ReStructuredTextSourceFactory
+from zope.app.renderer.rest import IReStructuredTextSource
+from zope.app.renderer.rest import ReStructuredTextToHTMLRenderer
 
+
 def setUp():
     placelesssetup.setUp()
-    service = zapi.getGlobalService('Utilities')
-    service.provideUtility(IDocumentationModule, InterfaceModule(),
+    ztapi.provideUtility(IDocumentationModule, InterfaceModule(),
                            'Interface')
-    service.provideUtility(IDocumentationModule, ZCMLModule(), 'ZCML')
+    ztapi.provideUtility(IDocumentationModule, ZCMLModule(), 'ZCML')
 
+    # Register Renderer Components
+    ztapi.provideUtility(IFactory, ReStructuredTextSourceFactory,
+                         'zope.source.rest')    
+    ztapi.browserView(IReStructuredTextSource, '', 
+                      ReStructuredTextToHTMLRenderer)
+
 def tearDown():
     placelesssetup.tearDown()
 
@@ -97,10 +107,10 @@
     
 def test_suite():
     return unittest.TestSuite((
-        #DocTestSuite('zope.app.apidoc',
-        #             setUp=setUp, tearDown=tearDown),
-        #DocTestSuite('zope.app.apidoc.browser.apidoc',
-        #             setUp=setUp, tearDown=tearDown),
+        DocTestSuite('zope.app.apidoc',
+                     setUp=setUp, tearDown=tearDown),
+        DocTestSuite('zope.app.apidoc.browser.apidoc',
+                     setUp=setUp, tearDown=tearDown),
         DocTestSuite('zope.app.apidoc.utilities'),
         DocTestSuite('zope.app.apidoc.tests'),
         ))



More information about the Zope3-Checkins mailing list