Hello,
I'm new to ORBit and orbit-python and having a bit of trouble. I've taken
a piece of python test code that contained no classes and attempted to
make it into a class.
Here's a snip of the code
import sys
try:
import CORBA
except ImportError,ex:
print "Failed to load CORBA module."
print "Please see http://projects.sault.org/orbit-python/ for the
required python CORBA bindings"
sys.exit(0);
class DSdataLink:
def __init__(self, name, table):
self.databaseName = name
self.tableName = table
def connect(self):
# find the object server base object
CORBA.load_idl( "../../objectserver/idl/gedi.idl" )
orb = CORBA.ORB_init( () , CORBA.ORB_ID )
ior = open("/tmp/databasefactory.ior").readline()
self.factory = orb.string_to_object(ior)
try:
self.database = self.factory.newDatabase( self.databaseName );
except UnknownDatabase,ex:
print "Failed to connect to database. Exiting."
print ex.detail
sys.exit(0)
self.database.connect()
A bunch snipped.
Now when this code runs I get
File "./DSgedi.py", line 38, in connect
except GEDI.UnknownDatabase,ex:
NameError: GEDI
This same code runs fine when not inside a class. Any idea what am I
missing?
Thanks,
James
|