I am trying to create a simple CORBA service in Python. I'd like to use Bonobo where appropriate to simplify activation. The service has a standalone PyGTK GUI, but is not intended for embedding via bonobo.ui.Component.

<http://www.pycage.de/howto_bonobo.html> has gotten me off to a good start, but unfortunately, the only code examples I can find use widget embedding via bonobo.ui.Component.

I've got my OAF .server file, with an "exec" entry for the factory and a "factory" entry for the service itself. I've got my .idl file, and the typelib built from it. My server imports the typelib and creates the factory. But when a client requests a server object, I get a Bonobo.GeneralError exception. :-(

From "sampler.server":

  ...
  <oaf_server iid="OAFIID:SamplerUploader_Factory:www.cs.berkeley.edu"
    type="exe"
    location="server">

    <oaf_attribute name="repo_ids" type="stringv">
      <item value="IDL:Bonobo/GenericFactory:1.0"/>
      <item value="IDL:Bonobo/Unknown:1.0"/>
    </oaf_attribute>

</oaf_server>

  <oaf_server iid="OAFIID:SamplerUploader:www.cs.berkeley.edu"
    type="factory"
    location="OAFIID:SamplerUploader_Factory:www.cs.berkeley.edu">

    <oaf_attribute name="repo_ids" type="stringv">
      <item value="IDL:Sampler/Uploader:1.0"/>
      <item value="IDL:Bonobo/Unknown:1.0"/>
    </oaf_attribute>

</oaf_server>


From "sampler.idl":


        module Sampler {
            interface Uploader : Bonobo::Unknown { ... };
        };

From my server script:

ORBit.load_typelib('sampler')

        import CORBA
        import Sampler__POA

...

        class Uploader(Sampler__POA.Uploader):
            ....

        def uploader_factory(factory, iid)
            print 'called uploader_factory'
            return Uploader()

component = bonobo.GenericFactory('OAFIID:SamplerUploader_Factory:www.cs.berkeley.edu', uploader_factory)
bonobo.running_context_auto_exit_unref(component)
bonobo.main()


From my client script:

server = bonobo.get_object('OAFIID:SamplerUploader:www.cs.berkeley.edu', 'Sampler/Uploader')

What am I doing wrong? In my server script, is "Sampler__POA.Uploader" the right superclass to use for my service implementation class? In the "uploader_factory" function, is a new instance of my service implementation class the right thing to return, or is it supposed to be wrapped up inside some other Bonobo construct?

I'm sure the problem must be something simple, if obscure. Any hints?

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to