Discussion:
[omniORB] Omniidl and python packages
Cetateanu Marius-B01107
2009-09-24 19:28:06 UTC
Permalink
Hi,

I have an IDL file named Example.idl. I'm generating the python stub
from this file with the following
command line: omniidl -bpython -Wbpackage=intf.stubsCORBA. According to
the documentation -Wbpackage should
put both python modules and stub files in package intf.stubsCORBA. As a
result of the command I have the
following: intf/stubsCORBA/Example and intf/stubsCORBA/Example__POA
directories with the __init__.py files in them;
both of files contain the following import "import
intf.stubsCORBA.Example_idl". So far so good. But
in the Example_idl.py file which is generated in intf/stubsCORBA/ I get
the __name__ variable (at the end of the file)
set in the following way:
"
#
# End of module "Example"
#
__name__ = "intf.stubsCORBA.intf.stubsCORBA.Example_idl"
"
The fact that the name of the package was doubled causes my program
which uses Example to fail. Is the doubled name correct? If it's correct
then why the import in the __init__.py was generated without the doubled
name?

Thanks

Marius Cetateanu
DevTech - Software Engineer
Freescale Semiconductor Romania SRL
45, Tudor Vladimirescu Street
Tati Business Center
Bucharest 050881, Romania
www.freescale.com
Phone: +040 213052078
Mobile: +040 742191809
Fax: +040 213052000
email: ***@freescale.com
Cetateanu Marius-B01107
2009-09-24 19:38:36 UTC
Permalink
-----Original Message-----
From: Cetateanu Marius-B01107
Sent: Thursday, September 24, 2009 4:28 PM
Subject: Omniidl and python packages
Hi,
I have an IDL file named Example.idl. I'm generating the
omniidl -bpython -Wbpackage=intf.stubsCORBA. According to the
documentation -Wbpackage should put both python modules and
stub files in package intf.stubsCORBA. As a result of the
command I have the
following: intf/stubsCORBA/Example and
intf/stubsCORBA/Example__POA directories with the __init__.py
files in them; both of files contain the following import
"import intf.stubsCORBA.Example_idl". So far so good. But in
the Example_idl.py file which is generated in
intf/stubsCORBA/ I get the __name__ variable (at the end of
"
#
# End of module "Example"
#
__name__ = "intf.stubsCORBA.intf.stubsCORBA.Example_idl"
"
The fact that the name of the package was doubled causes my
program which uses Example to fail. Is the doubled name
correct? If it's correct then why the import in the
__init__.py was generated without the doubled name?
Thanks
Marius Cetateanu
DevTech - Software Engineer
Freescale Semiconductor Romania SRL
45, Tudor Vladimirescu Street
Tati Business Center
Bucharest 050881, Romania
www.freescale.com
Phone: +040 213052078
Mobile: +040 742191809
Fax: +040 213052000
Sorry!
I forgot to mention that I use omniORB 4.3.1 with omniORBpy 3.3. This
behavior was not present with the previous version I used: omniORB 4.0.7
with omniORBpy 2.7.
Duncan Grisby
2009-10-07 22:30:30 UTC
Permalink
On Thursday 24 September, "Cetateanu Marius-B01107" wrote:

[...]
Post by Cetateanu Marius-B01107
So far so good. But
in the Example_idl.py file which is generated in intf/stubsCORBA/ I get
the __name__ variable (at the end of the file)
"
#
# End of module "Example"
#
__name__ = "intf.stubsCORBA.intf.stubsCORBA.Example_idl"
"
It's a bug. I've fixed it in svn.
Post by Cetateanu Marius-B01107
The fact that the name of the package was doubled causes my program
which uses Example to fail. Is the doubled name correct? If it's correct
then why the import in the __init__.py was generated without the doubled
name?
What is your program doing? Normally the name of the module isn't
required for anything. It's only set for information, really.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Cetateanu Marius-B01107
2009-10-13 17:52:21 UTC
Permalink
-----Original Message-----
Sent: Wednesday, October 07, 2009 7:30 PM
To: Cetateanu Marius-B01107
Subject: Re: [omniORB] Omniidl and python packages
[...]
Post by Cetateanu Marius-B01107
So far so good. But
in the Example_idl.py file which is generated in intf/stubsCORBA/ I
get the __name__ variable (at the end of the file) set in the
"
#
# End of module "Example"
#
__name__ = "intf.stubsCORBA.intf.stubsCORBA.Example_idl"
"
It's a bug. I've fixed it in svn.
Thanks.
Post by Cetateanu Marius-B01107
The fact that the name of the package was doubled causes my program
which uses Example to fail. Is the doubled name correct? If it's
correct then why the import in the __init__.py was
generated without
Post by Cetateanu Marius-B01107
the doubled name?
What is your program doing? Normally the name of the module
isn't required for anything. It's only set for information, really.
My program has a custom way of loading the python modules (based on the
import module from Python)
so it was getting confused by those doubled names.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
Marius Cetateanu
DevTech - Software Engineer
Freescale Semiconductor Romania SRL
45, Tudor Vladimirescu Street
Tati Business Center
Bucharest 050881, Romania
www.freescale.com
Phone: +040 213052078
Mobile: +040 742191809
Fax: +040 213052000
email: ***@freescale.com

Loading...