[omniORB] Injecting Enum Name/Values into Enum's Namespace

Jeff Pitman symbiont at berlios.de
Wed Sep 21 12:13:35 BST 2005


Hi:

New at this python orb stuff.  I'm trying to get something similiar to 
this working:

module com {
	module example {
		module interfaces {
			enum BarType {
				FOO,
				SPAM,
				EGGS
			};
		};
	};
};

From the java perspective, individual names/values can be accessed in 
the namespace of the enum:

>>> BarType.FOO

However, I cannot get this to work in python:

>>> from com.example.interfaces import BarType
>>> print BarType.FOO
AttributeError: Enum instance has no attribute 'FOO'

Right now, FOO is injected into the interfaces namespace:

>>> from com.example.interfaces import FOO

Then to get the value, I have to do this:

>>> FOO.value()
2

I am using the following options for IDL compile:

omniidl -Cstubs -nc -nf -bpython -Wbinline *.idl

Inline is the only way i can access it in an OO way, it seems. Let me 
know where I am messed up.

thanks,
-- 
-jeff



More information about the omniORB-list mailing list