Alexander Haarer
2006-10-10 14:44:54 UTC
Hi ,
i want to use omniorbpy2 Python2.4 to generate code from an idl
containing Python reserved keywords.
There seems to be no mechanism that maps python reserved words with a
prefix (like for c++)
Is this a bug, or did i miss something in the documentation ? Is there a
workaround ?
(No, i cannot change the IDL)
This IDL
module TestMe
{
enum TestEnum
{
Yes,
No,
None
};
};
results in generated code like this:
# enum TestEnum
_0_TestMe.Yes = omniORB.EnumItem("Yes", 0)
_0_TestMe.No = omniORB.EnumItem("No", 1)
_0_TestMe.None = omniORB.EnumItem("None", 2)
_0_TestMe.TestEnum = omniORB.Enum("IDL:TestMe/TestEnum:1.0",
(_0_TestMe.Yes, _0_TestMe.No, _0_TestMe.None,))
File "<stdin>", line 1, in ?
File "TestMe/__init__.py", line 6, in ?
import TestMe_idl
File "TestMe_idl.py", line 26
_0_TestMe.None = omniORB.EnumItem("None", 2)
SyntaxError: assignment to None
tia
i want to use omniorbpy2 Python2.4 to generate code from an idl
containing Python reserved keywords.
There seems to be no mechanism that maps python reserved words with a
prefix (like for c++)
Is this a bug, or did i miss something in the documentation ? Is there a
workaround ?
(No, i cannot change the IDL)
This IDL
module TestMe
{
enum TestEnum
{
Yes,
No,
None
};
};
results in generated code like this:
# enum TestEnum
_0_TestMe.Yes = omniORB.EnumItem("Yes", 0)
_0_TestMe.No = omniORB.EnumItem("No", 1)
_0_TestMe.None = omniORB.EnumItem("None", 2)
_0_TestMe.TestEnum = omniORB.Enum("IDL:TestMe/TestEnum:1.0",
(_0_TestMe.Yes, _0_TestMe.No, _0_TestMe.None,))
import TestMe
Traceback (most recent call last):File "<stdin>", line 1, in ?
File "TestMe/__init__.py", line 6, in ?
import TestMe_idl
File "TestMe_idl.py", line 26
_0_TestMe.None = omniORB.EnumItem("None", 2)
SyntaxError: assignment to None
tia