[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/app/apidoc/ Fix up some code in APIDoc dealing with new attrs of registration objects.

Philipp von Weitershausen philikon at philikon.de
Tue Feb 28 18:53:36 EST 2006


Log message for revision 65628:
  Fix up some code in APIDoc dealing with new attrs of registration objects.
  Not sure if this will break its handling of old persistent registration objects.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt
  U   Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py	2006-02-28 23:47:31 UTC (rev 65627)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/component.py	2006-02-28 23:53:35 UTC (rev 65628)
@@ -174,19 +174,19 @@
 
 def getAdapterInfoDictionary(reg):
     """Return a PT-friendly info dictionary for an adapter registration."""
-    factory = getRealFactory(reg.value)
+    factory = getRealFactory(reg.factory)
     path = getPythonPath(factory)
 
     url = None
     if isReferencable(path):
         url = path.replace('.', '/')
 
-    if isinstance(reg.doc, (str, unicode)):
-        doc = reg.doc
+    if isinstance(reg.info, (str, unicode)):
+        doc = reg.info
         zcml = None
     else:
         doc = None
-        zcml = getParserInfoInfoDictionary(reg.doc)
+        zcml = getParserInfoInfoDictionary(reg.info)
 
     return {
         'provided': getInterfaceInfoDictionary(reg.provided),

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt	2006-02-28 23:47:31 UTC (rev 65627)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/browser.txt	2006-02-28 23:53:35 UTC (rev 65628)
@@ -40,7 +40,7 @@
   >>> foobar_reg = type(
   ...     'RegistrationStub', (),
   ...     {'name': 'FooBar', 'provided': None,
-  ...      'component': None, 'doc': ''})()
+  ...      'component': None, 'info': ''})()
 
 which is then wrapped in a `Utility` documentation class and then in a node:
 
@@ -61,7 +61,7 @@
   >>> noname_reg = type(
   ...     'RegistrationStub', (),
   ...     {'name': NONAME, 'provided': None,
-  ...      'component': None, 'doc': ''})()
+  ...      'component': None, 'info': ''})()
 
   >>> util = Utility(uiface, noname_reg)
   >>> node = Node(util)
@@ -109,7 +109,7 @@
   >>> blah_reg = type(
   ...     'RegistrationStub', (),
   ...     {'name': 'Blah', 'provided': IBlah,
-  ...      'component': None, 'doc': ''})()
+  ...      'component': None, 'info': ''})()
 
 Then we wrap the registration in the utility documentation class and create
 the details view:
@@ -140,7 +140,7 @@
 
   >>> foo_reg = type(
   ...     'RegistrationStub', (),
-  ...     {'name': '', 'provided': Interface, 'component': Foo(), 'doc': ''})()
+  ...     {'name': '', 'provided': Interface, 'component': Foo(), 'info': ''})()
 
 Then we create a utility documentation class and its details view:
 

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py	2006-02-28 23:47:31 UTC (rev 65627)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/utilitymodule/utilitymodule.py	2006-02-28 23:53:35 UTC (rev 65628)
@@ -54,7 +54,7 @@
         self.registration = reg
         self.interface = reg.provided
         self.component = reg.component
-        self.doc = reg.doc
+        self.doc = reg.info
 
 
 class UtilityInterface(ReadContainerBase):



More information about the Zope3-Checkins mailing list