[omniORB] python extension classes

enrico.sirola@riskmap.it enrico.sirola@riskmap.it
Wed Feb 19 17:24:00 2003


>>>>> "Enri" == enrico sirola <enrico.sirola@riskmap.it> writes:

>>>>> "Duncan" == Duncan Grisby <duncan@grisby.org> writes:
    Duncan> On Monday 17 February, enrico.sirola@riskmap.it wrote:
    >>> I will never remember to attach attachments :-P

    Duncan> The problem is that the extension class is a new-style
    Duncan> class derived from object. omniORBpy only supports
    Duncan> old-style classes for servants at the moment.

    Enri> ok, thanks a lot, enrico

just if anyone had the same problem, it seems that proxying the
extension class seems to work: 

class Proxy:
    def __init__( self, subject ):
        self.__subject = subject
    def __getattr__( self, name ):
        return getattr( self.__subject, name )

"""ExtClass is the extension class, ServantBase is the class generated
   by onmiorbpy """

class Servant_impl( ServantBase,
        Proxy):
        def __init__(self, ExtClassArgument):
                Proxy.__init__(self, ExtClass(ExtClassArgument))

Bye,
enrico

-- 
Enrico Sirola <enrico.sirola@riskmap.it>
gpg public key available from www.keyserver.net, Key ID 0x377FE07F
Key fingerprint = B446 7332 ED55 BC68 5FE8  DE0F 98DF EC86 377F E07F