[omniORB] ILU to omniORB (lengthy)

Geoff Gerrietts geoff at gerrietts.net
Fri Sep 26 16:07:47 BST 2003


Quoting Thomas Lockhart (lockhart at fourpalms.org):
> The omniidl backend by default builds files appropriate for installation 
> as a "library". So generate the files, then install them where you want. 
> You can look at the omniORBpy IDL make system for hints on how to 
> pre-compile the python code etc for a good installation. When I first 
> started building python apps, I mucked around with options for omniidl 
> to vary the output behavior. But ended up deciding that it wasn't really 
> fixing my "problem"...

I can actually make the backend do what I need it to do, as long as I
generate from a directory that lives on my PYTHONPATH and specify that
I want the files placed in the appropriate module. It's a little
awkward but Makefiles were made to manage awkward.

> At the top of your app, before importing your application-specific 
> files, put something like
> 
> import sys, string
> sys.path = string.split(string.strip("@YOURPATHS@"), ":") + sys.path
> import yourModule
> ...

I considered this approach, but @YOURPATHS@ has something like 70
entries, and the namespaces would likely clash quite a bit, because
for the last 4-5 years they have been separate namespaces.

> If you really have no idea where a client app was installed, perhaps
> python offers a way to determine the path to the currently-running
> app, and you can base the rest of your path information off of that.
> I haven't researched that one.

You can discover it by looking at argv[0], or if your app imports
packages, package.__path__[0] is the package directory.


-- 
Geoff Gerrietts           "By doing just a little every day, I can gradually 
                           let the task completely overwhelm me." 
<geoff at gerrietts net>        --Ashleigh Brilliant



More information about the omniORB-list mailing list