modules and generated code
Nigel Rantor
wiggly at wiggly.org
Wed Nov 15 12:33:26 EST 2006
J. Clifford Dyer wrote:
>
> Maybe I'm missing something obvious, but it sounds like you are
> over-complicating the idea of inheritance. Do you just want to create a
> subclass of the other class?
Nope, that isn't my problem.
I have an IDL file that is used to generate a set of stub and skeleton
code that is not human-modifiable.
Eventually I would like to have my IDL in source control and have a
setup script able to generate my stubs and skels and install them for me.
At the same time I want to produce code that uses this code but in the
same package.
In Java or Perl I can easily create a couple package/module like this:
package org.mine.package;
[...class definitions...]
and then somewhere else
package org.mine.otherpackage;
[...class definitions...]
These can be compiled into separate Jar files and just work.
Since the python is the final target though I don't want to put it all
in one directory because then I need to be clever when I regenerate the
generated code, I don't want old python modules lying around that are no
longer in the IDL. Blowing the entire generated directory away is the
best way of doing this, so I don't want my implementation code in there.
Basically, I want the same top-level package to have bits of code in
different directories, but because Python requires the __init__.py file
it only picks up the first one in PYTHONPATH.
I'm not sure if that makes sense, my brain is already toast from
meetings today.
n
More information about the Python-list
mailing list