Example #1
0
 def runLayerConfigAction(self):
     '''Arg-less action to open a new layer config dialog'''        
     dest,lgval,uconf,_,_,_,_,_ = self.controls.readParameters()
     
     if not LU.assessNone(dest):
         self.controls.setStatus(self.controls.STATUS.IDLE,'Cannot open Layer-Config without defined Destination')
         return
         
     if self.confconn is None:
         #build a new confconn
         self.confconn = ConfigConnector(uconf,lgval,dest)
     else:
         #if any parameters have changed, re-initialise
         self.confconn.initConnections(uconf,lgval,dest)
         
     self.runLayerConfigDialog()
Example #2
0
 def initConfigConnector(self,gvs=None,initlc=None):
     '''Try to initialise the configconnector object'''
     self.gvs = gvs if gvs else self.updateFromGPR()
     try:
         uc = self.gvs[2]
         dst = self.gvs[0]
         self.confconn = ConfigConnector(self,uc,self.gvs[1],dst,initlc)
     except RuntimeError as rer:
         msg = 'Runtime error creating {} using "{}.conf" config file. {}'.format(self.gvs[0],uc,rer)
         self.errorEvent(msg)
     except UnicodeEncodeError as uee:
         msg = 'Unicode Encode Error, encode/sanitise input and try again. {}'.format(uee)
         self.errorEvent(msg)
         raise
     except UnicodeDecodeError as ude:
         msg = 'Unicode Decode Error, stored unicode value not being presented correctly. {}'.format(ude)
         #self.errorEvent(msg)
         raise
     except DatasourceCreateException as dce:
         msg = 'Cannot DS CREATE {} connection using "{}.conf" config file. Switching selected config and retrying. Please edit config or set new datasource; {}'.format(dst,uc,dce)
         self.switchDSSelection(dst)
         self.errorEvent(msg)
     except DatasourceOpenException as doe:
         msg = 'Cannot DS OPEN {} connection using "{}.conf" config file. Switching selected config and retrying. Please edit config or set new datasource; {}'.format(dst,uc,doe)
         self.switchDSSelection(dst)
         self.errorEvent(msg)
     except EndpointConnectionException as ece:
         msg = 'Cannot open {} connection using "{}.conf" config file. Internal error; {}'.format(dst,uc,ece)
         self.alertEvent(msg)    
         self.runWizardDialog(uc if uc else self.DUMMY_CONF,dst)
         os.remove(os.path.abspath(os.path.join(os.path.dirname(__file__),'../conf/',self.DUMMY_CONF+'.conf')))
     except ConnectionConfigurationException as cce:
         msg = 'Cannot open {} connection; {}'.format(dst,cce)
         self.alertEvent(msg)   
         self.runWizardDialog(uc if uc else self.DUMMY_CONF,dst)
         os.remove(os.path.abspath(os.path.join(os.path.dirname(__file__),'../conf/',self.DUMMY_CONF+'.conf')))
Example #3
0
 def setUp(self):
     testlog.debug('ConfigConnector_Test.setUp')
     self.configconnector = ConfigConnector(None,self.UCONF,self.LGVAL,self.DESTNAME)    
     self.sep,self.dep = self._fetchEPs()
     self.configconnector.reg.setupLayerConfig(self.configconnector.tp,self.sep,self.dep)