[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/presentation.py Fixed a bug in adapter-function introspection.

Jim Fulton jim at zope.com
Sat Apr 16 12:06:12 EDT 2005


Stephan Richter wrote:
> On Saturday 16 April 2005 09:52, Jim Fulton wrote:
> 
>>Modified: Zope3/trunk/src/zope/app/apidoc/presentation.py
>>===================================================================
>>--- Zope3/trunk/src/zope/app/apidoc/presentation.py     2005-04-15 19:54:17
>>UTC (rev 30012) +++
>>Zope3/trunk/src/zope/app/apidoc/presentation.py     2005-04-16 13:52:26 UTC
>>(rev 30013) @@ -67,7 +67,7 @@
>>         info['path'] = getPythonPath(factory)
>> 
>>     elif isinstance(factory, FunctionType):
>>-        info['path'] = getPythonPath(factory.factory)
>>+        info['path'] = getPythonPath(factory)
> 
> 
> This is incorrect. Oftentimes we create functions out of factories. I have 
> changed these functions to have a factory attribute. So maybe we want to 
> check for the factory attribute in addition to the function test.

Or just getPythonPath(getattr(factory, 'factory', factory))

I increasingly provide functions as adapter factories. I was
unable to use apidoc to browse my interfaces without this change.

In any case, this, of course, needs a test.

Jim

P.S. apidoc rocks.

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-Checkins mailing list