[Zope3-checkins]
SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/
Backport of r26153.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Jul 7 12:53:13 EDT 2004
Log message for revision 26165:
Backport of r26153.
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py 2004-07-07 16:51:50 UTC (rev 26164)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py 2004-07-07 16:53:13 UTC (rev 26165)
@@ -18,8 +18,9 @@
import os
import inspect
+from zope.configuration.config import ConfigurationContext
+from zope.exceptions import NotFoundError
from zope.interface import implementedBy
-from zope.configuration.config import ConfigurationContext
from zope.proxy import removeAllProxies
from zope.app import zapi
@@ -104,8 +105,10 @@
{'path': p,
'url': zapi.getView(klass, 'absolute_url', self.request)()
})
+ results.sort(lambda x, y: cmp(x['path'], y['path']))
return results
+
class FunctionDetails(object):
"""Represents the details of the function."""
@@ -172,11 +175,14 @@
classModule = zapi.getUtility(IDocumentationModule, "Class")
for base in self.context.getBases():
path = getPythonPath(base)
- klass = zapi.traverse(classModule, path.replace('.', '/'))
- info.append(
- {'path': path,
- 'url': zapi.getView(klass, 'absolute_url',
- self.request)()})
+ try:
+ klass = zapi.traverse(classModule, path.replace('.', '/'))
+ url = zapi.getView(klass, 'absolute_url', self.request)()
+ except NotFoundError:
+ # If one of the base classes is implemented in C, we will not
+ # be able to find it.
+ url = None
+ info.append({'path': path, 'url': url})
return info
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/class_index.pt
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/class_index.pt 2004-07-07 16:51:50 UTC (rev 26164)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/class_index.pt 2004-07-07 16:53:13 UTC (rev 26165)
@@ -21,8 +21,12 @@
<ul class="attr-list" tal:condition="bases">
<li tal:repeat="base bases">
<a href=""
- tal:attributes="href string:${base/url}/index.html"
- tal:content="base/path" />
+ tal:attributes="href string:${base/url}/index.html"
+ tal:content="base/path"
+ tal:condition="base/url" />
+ <div tal:condition="not: base/url">
+ <span tal:replace="base/path" /> (C-based class)
+ </div>
</li>
</ul>
More information about the Zope3-Checkins
mailing list