예제 #1
0
 def set_url(self, url): #pylint: disable = R0201
     """Inherits from CdbBase"""
     if CDB_STATUS != None:
         raise CDB_STATUS #pylint: disable = E0702
     try:
         urlparse(url)
     except:
         sys.excepthook(*sys.exc_info())
         raise CdbPermanentError("malformed url")
예제 #2
0
 def __init__(self):
     """
     Initialise the evaluator with math functions and units
     """
     self._current_cali = {}
     self.reset()
     cfg = Configuration()
     cfgdoc = cfg.getConfigJSON()
     cfgdoc_json = json.loads(cfgdoc)
     cdb_url = cfgdoc_json['cdb_download_url'] + 'calibration?wsdl'
     self.cdb_server = cdb.Calibration()
     self.cdb_server.set_url(cdb_url)
     #print 'Server: ', self.cdb_server.get_name(), \
     #                  self.cdb_server.get_version()
     try:
         cdb.Calibration().get_status()
     except CdbPermanentError:
         raise CdbPermanentError("CDB error")
예제 #3
0
 def __init__(self):
     """
     Initialise the evaluator with math functions and units
     """
     self._current_cabling = {}
     self._run_cabling = {}
     self.reset()
     cfg = Configuration()
     cfgdoc = cfg.getConfigJSON()
     cfgdoc_json = json.loads(cfgdoc)
     cdb_url = cfgdoc_json['cdb_download_url'] + 'cabling?wsdl'
     self.cdb_server = cdb.Cabling()
     self.tof_devs = {'TOF0', 'TOF1', 'TOF2'}
     try:
         cdb.Cabling().get_status()
     except CdbPermanentError:
         raise CdbPermanentError("CDB error")  #pylint: disable = E0702
     except CdbTemporaryError:
         raise CdbTemporaryError("CDB error")  #pylint: disable = E0702
     self.cdb_server.set_url(cdb_url)
예제 #4
0
 def __init__(self, wsdl_dir="/cdb/geometry?wsdl"): #pylint: disable = W0613
     """Raise a permanent error if CDB_STATUS is not None"""
     if CDB_STATUS != None:
         raise CdbPermanentError("error") #pylint: disable = E0702