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

Philipp von Weitershausen philikon at philikon.de
Tue Feb 28 12:17:13 EST 2006


Log message for revision 65599:
  1) 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.
  2) Expose the template object itself.
  

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

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.py	2006-02-28 17:17:12 UTC (rev 65598)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.py	2006-02-28 17:17:12 UTC (rev 65599)
@@ -59,6 +59,7 @@
         base = factory.__bases__[0]
         info['path'] = base.__module__ + '.' + base.__name__
         info['template'] = relativizePath(factory.index.filename)
+        info['template_obj'] = factory.index
 
     # Basic Type is a factory
     elif isinstance(factory, (str, unicode, float, int, list, tuple)):
@@ -157,12 +158,12 @@
 def getViewInfoDictionary(reg):
     """Build up an information dictionary for a view registration."""
     # get configuration info
-    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)
 
     # get layer
     layer = None
@@ -172,7 +173,7 @@
 
     info = {'name' : reg.name or '<i>no name</i>',
             'type' : getPythonPath(getPresentationType(reg.required[-1])),
-            'factory' : getViewFactoryData(reg.value),
+            'factory' : getViewFactoryData(reg.factory),
             'required': [getInterfaceInfoDictionary(iface)
                          for iface in reg.required],
             'provided' : getInterfaceInfoDictionary(reg.provided),
@@ -182,6 +183,6 @@
             }
 
     # Educated guess of the attribute name
-    info.update(getPermissionIds('publishTraverse', klass=reg.value))
+    info.update(getPermissionIds('publishTraverse', klass=reg.factory))
 
     return info

Modified: Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.txt
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.txt	2006-02-28 17:17:12 UTC (rev 65598)
+++ Zope3/branches/jim-adapter/src/zope/app/apidoc/presentation.txt	2006-02-28 17:17:12 UTC (rev 65599)
@@ -32,6 +32,7 @@
    'referencable': True,
    'resource': None,
    'template': 'zope/app/apidoc/browser/index.pt',
+   'template_obj': <BoundPageTemplateFile of None>,
    'url': 'zope/app/pagetemplate/simpleviewclass/simple'}
 
 So in the result above we see what the function returns. It is a dictionary



More information about the Zope3-Checkins mailing list