[omniORB] Python packages/directories and generated code.

Harri Pasanen harri.pasanen at trema.com
Mon Jan 8 15:30:55 GMT 2007


You could probably do it using __path__

from Python Tutorial, 6.4.3 Packages in Multiple Directories:

http://docs.python.org/tut/node8.html#SECTION008430000000000000000

-Harri

On Monday 08 January 2007 14:39, Nigel Rantor wrote:
> Hi all,
>
> I originally sent this to python-list some time ago and didn't
> really get any satisfactory answer. I was wondering if anyone here
> who is using python had come up against the same problem and how
> they solved it.
>
> I'm a new to python so it may be that there is a good solution to
> this that I just don't know.
>
> Below is the message I sent to python list, that's why it's cuched
> in more general terms but of course I'm talking about generating
> IDL stubs/skels with omniORBpy/omniidl.
>
> So, if I have a tool that generates python code for me (in my case,
> CORBA stubs/skels) in a particular package is there a way of
> placing my own code under the same package hierarchy without all
> the code living in the same directory structure.
>
> Ideally I would like something like the following:
>
> package_dir/
>      top_level_package/
>          generated_code_package/
>          implementation_code_package/
>
> but have two distinct directories that hold them so that I can
> simply delete the generated code and regenerate it without worrying
> that anything got left behind.
>
> So, I want something like:
>
> generated_package_dir/
>      top_level_package/
>          generated_code_package/
>
> implementation_package_dir/
>      top_level_package/
>          implementation_code_package/
>
> Whilst I can create this structure, and add 'generated_package_dir'
> and 'implementation_package_dir' to PYTHONPATH the fact that both
> directories contain 'top_level_package' seems to be causing
> clashes, perhaps because there are multiple __init__.py files for
> 'top_level_package'?
>
> I know that this is possible in Java, Perl and C++ so I am finding
> it hard to believe I can't do the same in Python, I just think I'm
> too new to know how.
>
> I have spent most of this morning searching through all the docs I
> can find, searching on USENET and the web to no avail.
>
> Any help or pointers greatly appreciated.
>
> Regards,
>
>    n
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list


Privileged or confidential information may be contained in this message.  If you are not the addressee of this message please notify the sender by return and thereafter delete the message, and you may not use, copy, disclose or rely on the information contained in it. Internet e-mail may be susceptible to data corruption, interception and unauthorised amendment for which Wall Street Systems does not accept liability. Whilst we have taken reasonable precautions to ensure that this e-mail and any attachments have been swept for viruses, Wall Street Systems does not accept liability for any damage sustained as a result of viruses.  Statements in this message or attachments that do not relate to the business of  Wall Street Systems are neither given nor endorsed by the company or its Directors.



More information about the omniORB-list mailing list