[omniORB] omniidl generated module

Duncan Grisby dgrisby@uk.research.att.com
Fri, 16 Jun 2000 11:49:30 +0100


On Thursday 15 June, Stefan Seefeld wrote:

[ Stefan is talking about the Python ORB ]

> I use omniidl -Wbglobal to instruct omniidl to put the generated
> code into a particular module. Is there a way to add other (i.e.
> not generated code) into that module as well ?
> I'd like to provide a single module containing the full runtime
> environment, including the ORB related code as well as convenience
> stuff and servant implementations.

It is possible, although I don't recommend it. First note that
-Wbglobal only determines the module name for global declarations,
overriding the default of _GlobalIDL. Any modules in the IDL will
still result in Python modules with the same names.

Anyway, if you really must put things in an omniidl generated module,
you can add code to the module's __init__.py file (despite the big
warning that you shouldn't edit the file), after the line which says
"# ** 3. End". Anything there will be preserved if you regenerate the
stubs.

I think a better approach is to put the stubs and your code into a
Python package -- i.e. a hierarchy of modules. Use the -Wbpackage
option to set which package omniidl puts things in. That way, your
code will be next to the generated code in the name space, rather than
mixed in with it.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --