def __init__(self, name="Python Client"): ''' Initialize the client. Parameters: - name is what manager will refer to this client instance as Returns: Nothing Raises: CORBAProblemExImpl ''' #security token given to us by the manager self.token = None #name we will call ourself when contacting the manager self.name = str(name) #Logger used by container/components try: self.logger except: self.logger = getLogger(name) startPeriodicFlush(3) #List of components manager says are active self.managerComponents = [] #CORBA reference to ourself self.corbaRef = None try: #get our token from manager self.token = getManager().login(self.getMyCorbaRef()) except Exception, e: #cannot go on if the login fails print_exc() raise CORBAProblemExImpl()
def __init__(self, name="Python Client"): ''' Initialize the client. Parameters: - name is what manager will refer to this client instance as Returns: Nothing Raises: CORBAProblemExImpl ''' #security token given to us by the manager self.token = None #name we will call ourself when contacting the manager self.name = str(name) #Logger used by container/components try: self.logger except: self.logger = getLogger(name) startPeriodicFlush(3) #List of components manager says are active self.managerComponents = [] #CORBA reference to ourself self.corbaRef = None #True if the client is logged in self.loggedIn = False # Ensure that login and logout are executed in mutual exclusion self.loggingIn = Lock() #get our token from manager self.token = self.managerLogin() #sanity check if self.token == None: # a nil token implies manager doesn't "like" this client raise CORBAProblemExImpl()