[Zope] generating an acquisition wrapper from generated code

Bernd Dorn zope-mailinglist at mopa.at
Sun Jan 16 05:45:48 EST 2005


davelists2 at peoplemerge.com wrote:
> On Sat, Jan 15, 2005 at 10:40:30AM +0100, Bernd Dorn wrote:
> 
>>Aclass needs to be inherited from Acquisition.Explcitit or Implicit
>>and and in myTool:
>>def getAclass(self):
>>     inter = [base.Aclass().__of__(self),]
>>     return inter
> 
> 
> I can post more code if necessary, but:
> 
> Somehow, having already inherited from ZSI.TCcompound.Struct, I 
> cannot also inherit from Acquisition.Explicit:
> 
> Traceback (most recent call last):
>   File "<string>", line 1, in ?
>   File "/usr/lib/zope/lib/python/Zope/__init__.py", line 51, in app
>     startup()
>   File "/usr/lib/zope/lib/python/Zope/__init__.py", line 47, in startup
>     _startup()
>   File "/usr/lib/zope/lib/python/Zope/App/startup.py", line 45, in startup
>     OFS.Application.import_products()
>   File "/usr/lib/zope/lib/python/OFS/Application.py", line 637, in import_products
>     import_product(product_dir, product_name, raise_exc=debug_mode)
>   File "/usr/lib/zope/lib/python/OFS/Application.py", line 660, in import_product
>     product=__import__(pname, global_dict, global_dict, silly)
>   File "/var/lib/zope/Products/ProductTool/__init__.py", line 2, in ?
>     from Products.ProductTool import ProductGhost,AmazonProduct
>   File "/var/lib/zope/Products/ProductTool/AmazonProduct.py", line 7, in ?
>     from AmazonSearch_services import *
>   File "AmazonSearch_services.py", line 3020, in ?
>     class ActorSearchResponseWrapper(ActorSearchResponse):
>   File "AmazonSearch_services.py", line 3023, in ActorSearchResponseWrapper
>     typecode = ActorSearchResponse(name='ActorSearchRequestResponse', ns='http://soap.amazon.com')
>   File "AmazonSearch_services.py", line 3011, in __init__
>     self._return = ProductInfo_Def()
>   File "/var/lib/zope/Products/ProductTool/AmazonSearch_services_types.py", line 1857, in __init__
>     TClist = [ZSI.TC.String(pname="TotalResults",aname="_TotalResults", optional=1), ZSI.TC.String(pname="TotalPages",aname="_TotalPages", optional=1), ZSI.TC.String(pname="ListName",aname="_ListName", optional=1), DetailsArray_Def(name="Details", ns=ns, optional=1), ]
>   File "/var/lib/zope/Products/ProductTool/AmazonSearch_services_types.py", line 1308, in __init__
>     ZSI.TCcompound.Array.__init__(self, 'arrayTypeNS:Details[]', Details_Def(name=None,typed=0), pname=name, aname='_%s' % name, oname='%s xmlns:arrayTypeNS="http://soap.amazon.com"' % name, **kw)
>   File "/var/lib/zope/Products/ProductTool/AmazonSearch_services_types.py", line 1791, in __init__
>     aname=aname, oname=oname,


this is a extension class problem

try to get the __init__ of the superclass via __dict__

instead of:

ZSI.TCcompound.Array.__init__(self,...)

use:

ZSI.TCcompound.Array.__dict__['__init__'](self,...)


>   File "/usr/lib/python2.3/site-packages/ZSI/TCcompound.py", line 65, in __init__
>     raise TypeError('pyclass must be None or a class, not ' +
> TypeError: pyclass must be None or a class, not <extension class ExtensionClass at f6be67c0>
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )



More information about the Zope mailing list