def configure(self, _edPlugin=None): EDPluginExec.configure(self) xsDataInputMXWaitFile = self.dataInput if xsDataInputMXWaitFile.file is None: strError = "No expected file path in input!" self.ERROR(strError) self.setFailure(true) else: self.strFilePath = xsDataInputMXWaitFile.file.path.value if xsDataInputMXWaitFile.size is not None: self.expectedSize = xsDataInputMXWaitFile.size.value self.DEBUG("Expected size: %d (bytes)" % self.expectedSize) if xsDataInputMXWaitFile.timeOut is None: configTimeOut = self.config.get(EDPlugin.CONF_TIME_OUT) if configTimeOut is not None: self.timeOut = float(configTimeOut) self.DEBUG("Using configured timeout = %.1f s" % self.timeOut) else: self.DEBUG("Using default timeout = %.1f s" % self.timeOut) else: self.timeOut = xsDataInputMXWaitFile.timeOut.value self.DEBUG("Using timeout = %.1f s from input" % self.timeOut) # Set plugin timout to 60 s more in order to avoid EDPlugin timeout self.setTimeOut(self.timeOut + 60.0)
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = self.config.get("userName") if self.strUserName is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No user name found in configuration!") self.setFailure() self.strPassWord = self.config.get("passWord") if self.strPassWord is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No pass word found in configuration!") self.setFailure() self.strToolsForAutoprocessingWebServiceWsdl = self.config.get("toolsForAutoprocessingWebServiceWsdl") if self.strToolsForAutoprocessingWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No toolsForAutoprocessingWebServiceWsdl found in configuration!") self.setFailure() self.strToolsForCollectionWebServiceWsdl = self.config.get("toolsForCollectionWebServiceWsdl") if self.strToolsForCollectionWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No toolsForCollectionWebServiceWsdl found in configuration!") self.setFailure() strAutoProcProgramId = self.config.get("autoProcProgramId") if strAutoProcProgramId is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No autoProcProgramId found in configuration!") self.setFailure() else: self.iAutoProcProgramId = int(strAutoProcProgramId)
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = self.getStringConfigurationParameterValue("userName") if self.strUserName is None: self.ERROR("EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No user name found in configuration!") self.setFailure() self.strPassWord = self.getStringConfigurationParameterValue("passWord") if self.strPassWord is None: self.ERROR("EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No pass word found in configuration!") self.setFailure() self.strImageServiceWdsl = self.getStringConfigurationParameterValue("imageServiceWdsl") if self.strImageServiceWdsl is None: self.ERROR("EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No imageServiceWdsl found in configuration!") self.setFailure() self.strToolsForMXCubeWebServiceWsdl = self.getStringConfigurationParameterValue("toolsForMXCubeWebServiceWsdl") if self.strToolsForMXCubeWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No toolsForMXCubeWebServiceWsdl found in configuration!") self.setFailure() self.iAutoProcProgramId = self.getIntegerConfigurationParameterValue("autoProcProgramId") if self.iAutoProcProgramId is None: self.ERROR("EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No autoProcProgramId found in configuration!") self.setFailure()
def configure(self): """ Gets the configuration parameters (if any). """ EDPluginExec.configure(self) self.DEBUG("EDPluginExecSimpleHTMLPagev1_1.configure") self.fMinTransmission = self.config.get("minTransmissionWarning", self.fMinTransmission)
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = str(self.config.get("userName")) if self.strUserName is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No user name found in configuration!") self.setFailure() self.strPassWord = str(self.config.get("passWord")) if self.strPassWord is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No pass word found in configuration!") self.setFailure() self.strToolsForAutoprocessingWebServiceWsdl = self.config.get("toolsForAutoprocessingWebServiceWsdl") if self.strToolsForAutoprocessingWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No toolsForAutoprocessingWebServiceWsdl found in configuration!") self.setFailure() self.strToolsForCollectionWebServiceWsdl = self.config.get("toolsForCollectionWebServiceWsdl") if self.strToolsForCollectionWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No toolsForCollectionWebServiceWsdl found in configuration!") self.setFailure() strAutoProcProgramId = self.config.get("autoProcProgramId") if strAutoProcProgramId is None: self.ERROR("EDPluginISPyBStoreListOfImageQualityIndicatorsv1_4.configure: No autoProcProgramId found in configuration!") self.setFailure() else: self.iAutoProcProgramId = int(strAutoProcProgramId)
def configure(self, _bRequireToolsForCollectionWebServiceWsdl=False, _bRequireToolsForAutoprocessingWebServiceWsdl=False, _bRequireToolsForBLSampleWebServiceWsdl=False, _bRequireToolsForScreeningEDNAWebServiceWsdl=False): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = str(self.config.get("userName")) if self.strUserName is None: self.ERROR("{0}.configure: No user name found in configuration!".format(self.getName())) self.setFailure() self.strPassWord = str(self.config.get("passWord")) if self.strPassWord is None: self.ERROR("{0}.configure: No pass word found in configuration!") self.setFailure() self.strToolsForCollectionWebServiceWsdl = self.config.get("toolsForCollectionWebServiceWsdl") if _bRequireToolsForCollectionWebServiceWsdl and self.strToolsForCollectionWebServiceWsdl is None: self.ERROR("{0}.configure: No toolsForCollectionWebServiceWsdl found in configuration!") self.setFailure() self.strToolsForAutoprocessingWebServiceWsdl = self.config.get("toolsForAutoprocessingWebServiceWsdl") if _bRequireToolsForAutoprocessingWebServiceWsdl and self.strToolsForAutoprocessingWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreImageQualityIndicatorsv1_4.configure: No toolsForAutoprocessingWebServiceWsdl found in configuration!") self.setFailure() self.strToolsForBLSampleWebServiceWsdl = self.config.get("toolsForBLSampleWebServiceWsdl") if _bRequireToolsForBLSampleWebServiceWsdl and self.strToolsForBLSampleWebServiceWsdl is None: self.ERROR("EDPluginISPyBGetSampleInformationv1_4.configure: No toolsForBLSampleWebServiceWsdl found in configuration!") self.setFailure() self.strToolsForScreeningEDNAWebServiceWsdl = self.config.get("toolsForScreeningEDNAWebServiceWsdl") if _bRequireToolsForScreeningEDNAWebServiceWsdl and self.strToolsForScreeningEDNAWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreScreeningv1_4.configure: No toolsForScreeningEDNAWebServiceWsdl found in configuration!") self.setFailure()
def configure(self): """ Configures the plugin with executable from configuration file """ EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecProcess.configure") strExecutable = self.config.get(self.CONF_EXEC_PROCESS_EXECUTABLE, None) if strExecutable is None: EDVerbose.DEBUG("EDPluginExecProcess.configure: No configuration parameter found for: %s , using default value: %s"\ % (self.CONF_EXEC_PROCESS_EXECUTABLE, self.getExecutable())) else: self.setExecutable(strExecutable) # test if we're to use oar and check for additional config if strExecutable == "oarsub": oar_options = self.config.get("oarOptions", None) if oar_options is None: EDVerbose.DEBUG('EDPluginExecProcess.configure: no additional options were specified for oarsub') self._oar_options = oar_options oar_poll = self.config.get("oarPollInterval", None) if oar_poll is None: EDVerbose.DEBUG('EDPluginExecProcess.configure: oar polling interval not configured') EDVerbose.DEBUG('EDPluginExecProcess.configure: using default version of {0}'.format(DEFAULT_OAR_POLL_INTERVAL)) self._oar_poll_interval = DEFAULT_OAR_POLL_INTERVAL else: self._oar_poll_interval = oar_poll # The execProcessTimeOut is deprecated, see bug #563 timeOut = self.config.get(self.CONF_EXEC_PROCESS_TIME_OUT, None) if timeOut is not None: EDVerbose.WARNING("Use of %s in plugin configuration is deprecated" % self.CONF_EXEC_PROCESS_TIME_OUT) EDVerbose.WARNING("Please use %s instead." % EDPlugin.CONF_TIME_OUT) self.setTimeOut(timeOut)
def configure( self ): EDPluginExec.configure( self ) EDVerbose.DEBUG( "*** EDPluginExecICATIngesterv10.configure" ) xsPluginItem = self.getConfiguration() if ( xsPluginItem == None ): EDVerbose.warning( "EDPluginExecICATIngesterv10.configure: No DLS Archiver plugin item defined." ) xsPluginItem = XSPluginItem()
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = self.config.get("userName") if self.strUserName is None: self.ERROR("EDPluginISPyBStoreScreeningv1_4.configure: No user name found in configuration!") self.setFailure() self.strPassWord = self.config.get("passWord") if self.strPassWord is None: self.ERROR("EDPluginISPyBStoreScreeningv1_4.configure: No pass word found in configuration!") self.setFailure() self.strToolsForBLSampleWebServiceWsdl = self.config.get("toolsForBLSampleWebServiceWsdl") if self.strToolsForBLSampleWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreScreeningv1_4.configure: No toolsForBLSampleWebServiceWsdl found in configuration!") self.setFailure() self.strToolsForScreeningEDNAWebServiceWsdl = self.config.get("toolsForScreeningEDNAWebServiceWsdl") if self.strToolsForScreeningEDNAWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreScreeningv1_4.configure: No toolsForScreeningEDNAWebServiceWsdl found in configuration!") self.setFailure() self.strToolsForCollectionWebServiceWsdl = self.config.get("toolsForCollectionWebServiceWsdl") if self.strToolsForCollectionWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreScreeningv1_4.configure: No toolsForCollectionWebServiceWsdl found in configuration!") self.setFailure()
def configure(self): """ Gets the dbserver parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) pluginConfiguration = self.getConfiguration() if(pluginConfiguration == None): EDVerbose.DEBUG("*** EDPluginISPyBv1_2.configure: pluginConfiguration is None, using default settings") else: EDVerbose.DEBUG("*** EDPluginISPyBv1_2.configure: pluginConfiguration found, using settings from there") strDbserverHost = EDConfiguration.getStringParamValue(pluginConfiguration, "dbserverHost") if(strDbserverHost == None): strErrorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginISPyBv1_2.configure", self.getClassName(), \ "Configuration parameter missing: dbserverHost") EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage else: self.setDbserverHost(strDbserverHost) strDbserverPort = EDConfiguration.getStringParamValue(pluginConfiguration, "dbserverPort") if(strDbserverPort == None): strErrorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginISPyBv1_2.configure", self.getClassName(), \ "Configuration parameter missing: dbserverPort") EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) raise RuntimeError, strErrorMessage else: self.setDbserverPort(int (strDbserverPort))
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = self.getStringConfigurationParameterValue( "userName") if self.strUserName is None: self.ERROR( "EDPluginISPyBStoreScreeningv1_4.configure: No user name found in configuration!" ) self.setFailure() self.strPassWord = self.getStringConfigurationParameterValue( "passWord") if self.strPassWord is None: self.ERROR( "EDPluginISPyBStoreScreeningv1_4.configure: No pass word found in configuration!" ) self.setFailure() self.strToolsForBLSampleWebServiceWsdl = self.getStringConfigurationParameterValue( "toolsForBLSampleWebServiceWsdl") if self.strToolsForBLSampleWebServiceWsdl is None: self.ERROR( "EDPluginISPyBStoreScreeningv1_4.configure: No toolsForBLSampleWebServiceWsdl found in configuration!" ) self.setFailure() self.strToolsForScreeningEDNAWebServiceWsdl = self.getStringConfigurationParameterValue( "toolsForScreeningEDNAWebServiceWsdl") if self.strToolsForScreeningEDNAWebServiceWsdl is None: self.ERROR( "EDPluginISPyBStoreScreeningv1_4.configure: No toolsForScreeningEDNAWebServiceWsdl found in configuration!" ) self.setFailure()
def configure(self): EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecOutputHTMLv1_0.configure") self.strEDNA2html = self.config.get(self.CONF_EDNA2html) if self.strEDNA2html is None and os.environ.has_key("EDNA2html"): self.strEDNA2html = os.environ["EDNA2html"] else: self.strEDNA2html = EDFactoryPluginStatic.getModuleLocation("EDNA2html") pass
def configure(self): EDPluginExec.configure(self) EDVerbose.DEBUG("*** EDPluginExecICATIngesterv10.configure") xsPluginItem = self.getConfiguration() if (xsPluginItem == None): EDVerbose.warning( "EDPluginExecICATIngesterv10.configure: No DLS Archiver plugin item defined." ) xsPluginItem = XSPluginItem()
def configure(self): EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecOutputHTMLv1_0.configure") pluginConfiguration = self.getConfiguration() if pluginConfiguration != None: self.__strEDNA2html = EDConfiguration.getStringParamValue(pluginConfiguration, \ EDPluginExecOutputHTMLv1_0.CONF_EDNA2html) elif os.environ.has_key("EDNA2html"): self.__strEDNA2html = os.environ["EDNA2html"]
def configure(self): EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecOutputHTMLv1_0.configure") self.strEDNA2html = self.config.get(self.CONF_EDNA2html) if self.strEDNA2html is None and os.environ.has_key("EDNA2html"): self.strEDNA2html = os.environ["EDNA2html"] else: self.strEDNA2html = EDFactoryPluginStatic.getModuleLocation( "EDNA2html") pass
def configure( self ): """ Configure the plugin, mainly boiler plate code to get things going """ EDPluginExec.configure( self ) EDVerbose.DEBUG( "*** EDPluginExecSRBRegisterv10.configure" ) xsPluginItem = self.getConfiguration() if ( xsPluginItem == None ): EDVerbose.warning( "EDPluginExecSRBRegisterv10.configure: No DLS Archiver plugin item defined." ) xsPluginItem = XSPluginItem()
def configure(self): """ Configures the plugin (if not done yet """ EDPluginExec.configure(self) if self.use_sift_pyocl is None: with self.config_lock: if self.use_sift_pyocl is None: self.DEBUG("EDPluginExecMeasureOffsetv2_1.configure") self.__class__.use_sift_pyocl = self.config.get("sift_pyocl", False) print self.use_sift_pyocl, self.sift_keypoints, self.sift_match
def configure(self): """ Configures the plugin (if not done yet """ EDPluginExec.configure(self) if self.use_sift_pyocl is None: with self.config_lock: if self.use_sift_pyocl is None: self.DEBUG("EDPluginExecAlignFramev1_0.configure") self.__class__.use_sift_pyocl = self.config.get( "sift_pyocl", False) print self.use_sift_pyocl, self.sift_keypoints, self.sift_match
def configure(self): """ Configure the plugin, mainly boiler plate code to get things going """ EDPluginExec.configure(self) EDVerbose.DEBUG("*** EDPluginExecSRBRegisterv10.configure") xsPluginItem = self.getConfiguration() if (xsPluginItem == None): EDVerbose.warning( "EDPluginExecSRBRegisterv10.configure: No DLS Archiver plugin item defined." ) xsPluginItem = XSPluginItem()
def configure(self): """ setup two configurations: --> MAX_OFFSET_VALUE --> FILL_VALUE """ EDPluginExec.configure(self) if not self.__class__.CONFIGURED: with self.__class__._clsLock: if not self.__class__.CONFIGURED: self.DEBUG("EDPluginExecShiftImagev1_1.configure") xsPluginItem = self.getConfiguration() if (xsPluginItem == None): self.WARNING( "EDPluginExecShiftImagev1_1.configure: No plugin item defined." ) xsPluginItem = XSPluginItem() strFill = EDConfiguration.getStringParamValue( xsPluginItem, self.__class__.FILL_KEY) if (strFill == None): self.WARNING("EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\ % (self.FILL_KEY, self.FILL_VALUE, xsPluginItem.marshal())) else: strFill = strFill.strip().lower() if strFill in ["min", "max", "mean"]: self.__class__.FILL_VALUE = strFill else: try: self.__class__.FILL_VALUE = float(strFill) except ValueError, error: self.ERROR( "unable to convert %s to float: %s" % (strFill, error)) strMaxOffset = EDConfiguration.getStringParamValue( xsPluginItem, self.__class__.MAX_OFFSET_KEY) if (strMaxOffset == None): self.WARNING("EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\ % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal())) else: if strMaxOffset.isdigit(): try: self.__class__.MAX_OFFSET_VALUE = int( strMaxOffset) except ValueError, error: self.ERROR("unable to convert %s to int: %s" % (strMaxOffset, error)) else: self.WARNING("EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\ % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal()))
def configure(self): EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecOutputHTMLv1_0.configure") pluginConfiguration = self.getConfiguration() if pluginConfiguration != None: self.strEDNA2html = EDConfiguration.getStringParamValue(pluginConfiguration, \ EDPluginExecOutputHTMLv1_0.CONF_EDNA2html) elif os.environ.has_key("EDNA2html"): self.strEDNA2html = os.environ["EDNA2html"] else: self.strEDNA2html = EDFactoryPluginStatic.getModuleLocation( "EDNA2html") pass
def configure(self): """ setup two configurations: --> MAX_OFFSET_VALUE --> FILL_VALUE """ EDPluginExec.configure(self) if not self.__class__.CONFIGURED: with self.__class__._clsLock: if not self.__class__.CONFIGURED: self.DEBUG("EDPluginExecShiftImagev1_1.configure") xsPluginItem = self.getConfiguration() if xsPluginItem == None: self.WARNING("EDPluginExecShiftImagev1_1.configure: No plugin item defined.") xsPluginItem = XSPluginItem() strFill = EDConfiguration.getStringParamValue(xsPluginItem, self.__class__.FILL_KEY) if strFill == None: self.WARNING( "EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s" % (self.FILL_KEY, self.FILL_VALUE, xsPluginItem.marshal()) ) else: strFill = strFill.strip().lower() if strFill in ["min", "max", "mean"]: self.__class__.FILL_VALUE = strFill else: try: self.__class__.FILL_VALUE = float(strFill) except ValueError, error: self.ERROR("unable to convert %s to float: %s" % (strFill, error)) strMaxOffset = EDConfiguration.getStringParamValue(xsPluginItem, self.__class__.MAX_OFFSET_KEY) if strMaxOffset == None: self.WARNING( "EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s" % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal()) ) else: if strMaxOffset.isdigit(): try: self.__class__.MAX_OFFSET_VALUE = int(strMaxOffset) except ValueError, error: self.ERROR("unable to convert %s to int: %s" % (strMaxOffset, error)) else: self.WARNING( "EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s" % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal()) )
def configure(self): """ Configure the HDF5 compression scheme """ EDPluginExec.configure(self) self.DEBUG("EDPluginHDF5.configure") if not EDPluginHDF5.__bConfigured: xsPluginItem = self.getConfiguration() if xsPluginItem is not None: strCompression = EDConfiguration.getStringParamValue(xsPluginItem, EDPluginHDF5.CONF_COMPRESSION_KEY) if strCompression != None: if strCompression == "None": EDPluginHDF5.HDF5_Compression = None else: EDPluginHDF5.HDF5_Compression = strCompression EDPluginHDF5.__bConfigured = True
def configure(self, _bRequireToolsForCollectionWebServiceWsdl=False, _bRequireToolsForAutoprocessingWebServiceWsdl=False, _bRequireToolsForBLSampleWebServiceWsdl=False, _bRequireToolsForScreeningEDNAWebServiceWsdl=False): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = str(self.config.get("userName")) if self.strUserName is None: self.ERROR( "{0}.configure: No user name found in configuration!".format( self.getName())) self.setFailure() self.strPassWord = str(self.config.get("passWord")) if self.strPassWord is None: self.ERROR("{0}.configure: No pass word found in configuration!") self.setFailure() self.strToolsForCollectionWebServiceWsdl = self.config.get( "toolsForCollectionWebServiceWsdl") if _bRequireToolsForCollectionWebServiceWsdl and self.strToolsForCollectionWebServiceWsdl is None: self.ERROR( "{0}.configure: No toolsForCollectionWebServiceWsdl found in configuration!" ) self.setFailure() self.strToolsForAutoprocessingWebServiceWsdl = self.config.get( "toolsForAutoprocessingWebServiceWsdl") if _bRequireToolsForAutoprocessingWebServiceWsdl and self.strToolsForAutoprocessingWebServiceWsdl is None: self.ERROR( "EDPluginISPyBStoreImageQualityIndicatorsv1_4.configure: No toolsForAutoprocessingWebServiceWsdl found in configuration!" ) self.setFailure() self.strToolsForBLSampleWebServiceWsdl = self.config.get( "toolsForBLSampleWebServiceWsdl") if _bRequireToolsForBLSampleWebServiceWsdl and self.strToolsForBLSampleWebServiceWsdl is None: self.ERROR( "EDPluginISPyBGetSampleInformationv1_4.configure: No toolsForBLSampleWebServiceWsdl found in configuration!" ) self.setFailure() self.strToolsForScreeningEDNAWebServiceWsdl = self.config.get( "toolsForScreeningEDNAWebServiceWsdl") if _bRequireToolsForScreeningEDNAWebServiceWsdl and self.strToolsForScreeningEDNAWebServiceWsdl is None: self.ERROR( "EDPluginISPyBStoreScreeningv1_4.configure: No toolsForScreeningEDNAWebServiceWsdl found in configuration!" ) self.setFailure()
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = self.config.get("userName") if self.strUserName is None: self.ERROR("EDPluginISPyBUpdateWorkflowStatusv1_4.configure: No user name found in configuration!") self.setFailure() self.strPassWord = self.config.get("passWord") if self.strPassWord is None: self.ERROR("EDPluginISPyBUpdateWorkflowStatusv1_4.configure: No pass word found in configuration!") self.setFailure() self.strToolsForCollectionWebServiceWsdl = self.config.get("toolsForCollectionWebServiceWsdl") if self.strToolsForCollectionWebServiceWsdl is None: self.ERROR("EDPluginISPyBUpdateWorkflowStatusv1_4.configure: No toolsForCollectionWebServiceWsdl found in configuration!") self.setFailure()
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = self.getStringConfigurationParameterValue("userName") if self.strUserName is None: self.ERROR("EDPluginISPyBStoreAutoProcv1_4.configure: No user name found in configuration!") self.setFailure() self.strPassWord = self.getStringConfigurationParameterValue("passWord") if self.strPassWord is None: self.ERROR("EDPluginISPyBStoreAutoProcv1_4.configure: No pass word found in configuration!") self.setFailure() self.strToolsForAutoprocessingWebServiceWsdl = self.getStringConfigurationParameterValue("toolsForAutoprocessingWebServiceWsdl") if self.strToolsForAutoprocessingWebServiceWsdl is None: self.ERROR("EDPluginISPyBStoreAutoProcv1_4.configure: No toolsForAutoprocessingWebServiceWsdl found in configuration!") self.setFailure()
def configure(self): """ Configures the plugin with executable from configuration file """ EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecProcess.configure") strExecutable = self.config.get(self.CONF_EXEC_PROCESS_EXECUTABLE, None) if strExecutable is None: EDVerbose.DEBUG("EDPluginExecProcess.configure: No configuration parameter found for: %s , using default value: %s"\ % (self.CONF_EXEC_PROCESS_EXECUTABLE, self.getExecutable())) else: self.setExecutable(strExecutable) # test if we're to use oar and check for additional config if strExecutable == "oarsub": oar_options = self.config.get("oarOptions", None) if oar_options is None: EDVerbose.DEBUG( 'EDPluginExecProcess.configure: no additional options were specified for oarsub' ) self._oar_options = oar_options oar_poll = self.config.get("oarPollInterval", None) if oar_poll is None: EDVerbose.DEBUG( 'EDPluginExecProcess.configure: oar polling interval not configured' ) EDVerbose.DEBUG( 'EDPluginExecProcess.configure: using default version of {0}' .format(DEFAULT_OAR_POLL_INTERVAL)) self._oar_poll_interval = DEFAULT_OAR_POLL_INTERVAL else: self._oar_poll_interval = oar_poll # The execProcessTimeOut is deprecated, see bug #563 timeOut = self.config.get(self.CONF_EXEC_PROCESS_TIME_OUT, None) if timeOut is not None: EDVerbose.WARNING( "Use of %s in plugin configuration is deprecated" % self.CONF_EXEC_PROCESS_TIME_OUT) EDVerbose.WARNING("Please use %s instead." % EDPlugin.CONF_TIME_OUT) self.setTimeOut(timeOut)
def configure(self): """ Add the dtype to the configuration file, probably "float32" or "float64" """ EDPluginExec.configure(self) self.DEBUG("EDPluginExecNormalizeImagev1_1.configure") if self.__class__.dtype is None: with self.__class__.semaphore: xsPluginItem = self.getConfiguration() if (xsPluginItem == None): self.WARNING("EDPluginExecNormalizeImagev1_1.configure: No plugin item defined.") xsPluginItem = XSPluginItem() strDtype = EDConfiguration.getStringParamValue(xsPluginItem, self.CONF_DTYPE_KEY) if(strDtype == None): self.WARNING("EDPluginExecNormalizeImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\ % (self.CONF_DTYPE_KEY, self.CONF_DTYPE_DEFAULT, xsPluginItem.marshal())) self.__class__.dtype = self.CONF_DTYPE_DEFAULT else: self.__class__.dtype = str(strDtype.strip().lower())
def configure(self): """ Configures the plugin from the configuration file with the following parameters - The CONVOLUTION method """ EDPluginExec.configure(self) if self.CONF_CONVOLUTION is None: with self.__class__.__sem: self.DEBUG("EDPluginExecMeasureOffsetv1_0.configure") xsPluginItem = self.getConfiguration() if xsPluginItem is None: self.WARNING("EDPluginExecMeasureOffsetv1_0.configure: No plugin item defined.") xsPluginItem = XSPluginItem() strCONVOLUTION = EDConfiguration.getStringParamValue(xsPluginItem, self.CONF_CONVOLUTION_KEY) if strCONVOLUTION is None: self.WARNING("EDPluginExecMeasureOffsetv1_0.configure: No configuration parameter found for: %s using default value: %s\n%s"\ % (self.CONF_CONVOLUTION_KEY, self.CONF_CONVOLUTION_DEFAULT, xsPluginItem.marshal())) self.__class__CONF_CONVOLUTION = self.CONF_CONVOLUTION_DEFAULT else: self.__class__.CONF_CONVOLUTION = strCONVOLUTION.strip().lower()
def configure(self): """ Gets the web servise wdsl parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) self.strUserName = self.getStringConfigurationParameterValue( "userName") if self.strUserName is None: self.ERROR( "EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No user name found in configuration!" ) self.setFailure() self.strPassWord = self.getStringConfigurationParameterValue( "passWord") if self.strPassWord is None: self.ERROR( "EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No pass word found in configuration!" ) self.setFailure() self.strImageServiceWdsl = self.getStringConfigurationParameterValue( "imageServiceWdsl") if self.strImageServiceWdsl is None: self.ERROR( "EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No imageServiceWdsl found in configuration!" ) self.setFailure() self.strToolsForCollectionWebServiceWsdl = self.getStringConfigurationParameterValue( "toolsForCollectionWebServiceWsdl") if self.strToolsForCollectionWebServiceWsdl is None: self.ERROR( "EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No toolsForCollectionWebServiceWsdl found in configuration!" ) self.setFailure() self.iAutoProcProgramId = self.getIntegerConfigurationParameterValue( "autoProcProgramId") if self.iAutoProcProgramId is None: self.ERROR( "EDPluginISPyBStoreImageQualityIndicatorsv1_3.configure: No autoProcProgramId found in configuration!" ) self.setFailure()
def configure(self): """ Configures the plugin with executable from configuration file """ EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecProcess.configure") xsPluginItem = self.getConfiguration() if (xsPluginItem == None): EDVerbose.warning("EDPluginExecProcess.configure: No plugin item defined.") xsPluginItem = XSPluginItem() strExecutable = EDConfiguration.getStringParamValue(xsPluginItem, EDPluginExecProcess.CONF_EXEC_PROCESS_EXECUTABLE) if(strExecutable == None): EDVerbose.DEBUG("EDPluginExecProcess.configure: No configuration parameter found for: %s , using default value: %s"\ % (EDPluginExecProcess.CONF_EXEC_PROCESS_EXECUTABLE, self.getExecutable())) else: self.setExecutable(strExecutable) # The execProcessTimeOut is deprecated, see bug #563 strTimeOut = EDConfiguration.getStringParamValue(xsPluginItem, EDPluginExecProcess.CONF_EXEC_PROCESS_TIME_OUT) if strTimeOut is not None: EDVerbose.WARNING("Use of %s in plugin configuration is deprecated" % EDPluginExecProcess.CONF_EXEC_PROCESS_TIME_OUT) EDVerbose.WARNING("Please use %s instead." % EDPlugin.CONF_TIME_OUT) self.setTimeOut(strTimeOut)
def configure(self): """ Configures the plugin from the configuration file with the following parameters - The CONVOLUTION method """ EDPluginExec.configure(self) if self.CONF_CONVOLUTION is None: with self.__class__.__sem: self.DEBUG("EDPluginExecMeasureOffsetv1_0.configure") xsPluginItem = self.getConfiguration() if xsPluginItem is None: self.WARNING( "EDPluginExecMeasureOffsetv1_0.configure: No plugin item defined." ) xsPluginItem = XSPluginItem() strCONVOLUTION = EDConfiguration.getStringParamValue( xsPluginItem, self.CONF_CONVOLUTION_KEY) if strCONVOLUTION is None: self.WARNING("EDPluginExecMeasureOffsetv1_0.configure: No configuration parameter found for: %s using default value: %s\n%s"\ % (self.CONF_CONVOLUTION_KEY, self.CONF_CONVOLUTION_DEFAULT, xsPluginItem.marshal())) self.__class__CONF_CONVOLUTION = self.CONF_CONVOLUTION_DEFAULT else: self.__class__.CONF_CONVOLUTION = strCONVOLUTION.strip( ).lower()
def configure(self): """ Gets the dbserver parameters from the config file and stores them in class member attributes. """ EDPluginExec.configure(self) pluginConfiguration = self.getConfiguration() if (pluginConfiguration == None): self.DEBUG( "*** EDPluginISPyBv10.configure: pluginConfiguration is None, using default settings" ) else: self.DEBUG( "*** EDPluginISPyBv10.configure: pluginConfiguration found, using settings from there" ) pyStrDbserverHost = EDConfiguration.getStringParamValue( pluginConfiguration, "dbserverHost") if (pyStrDbserverHost == None): pyStrErrorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginISPyBv10.configure", self.getClassName(), \ "Configuration parameter missing: dbserverHost") self.error(pyStrErrorMessage) self.addErrorMessage(pyStrErrorMessage) raise RuntimeError, pyStrErrorMessage else: self.setDbserverHost(pyStrDbserverHost) pyStrDbserverPort = EDConfiguration.getStringParamValue( pluginConfiguration, "dbserverPort") if (pyStrDbserverPort == None): pyStrErrorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginISPyBv10.configure", self.getClassName(), \ "Configuration parameter missing: dbserverPort") self.error(pyStrErrorMessage) self.addErrorMessage(pyStrErrorMessage) raise RuntimeError, pyStrErrorMessage else: self.setDbserverPort(int(pyStrDbserverPort))
def configure(self): """ Configures the plugin from the configuration file with the following parameters - The shell that will execute the script - Script executor - Script executable to be invoked - Path to CCP4 setup file if required - The 3rd party executable installed version """ EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecProcessXIA2CORE.configure") xsPluginItem = self.getConfiguration() if (xsPluginItem == None): EDVerbose.warning( "EDPluginExecProcessXIA2CORE.configure: No plugin item defined." ) xsPluginItem = XSPluginItem() if (self.getExecutable() is None): strExecutable = EDConfiguration.getStringParamValue( xsPluginItem, EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_EXECUTABLE) if (strExecutable == None): strErrorMessage = "Configuration parameter missing: " + \ EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_EXECUTABLE EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() if (EDVerbose.isVerboseDebug()): raise RuntimeError, strErrorMessage else: # Check that the executable file exists if (os.path.exists(strExecutable) == False): strErrorMessage = "Cannot find configured " + EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_EXECUTABLE + " : " + strExecutable EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() if (EDVerbose.isVerboseDebug()): raise RuntimeError, strErrorMessage else: self.setExecutable(strExecutable) if (self.getConfigXIA2COREType() is None): strXIA2COREType = EDConfiguration.getStringParamValue( xsPluginItem, EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_XIA2CORE_TYPE) if (strXIA2COREType == None): strErrorMessage = "Configuration parameter not set: " + \ EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_XIA2CORE_TYPE EDVerbose.DEBUG(strErrorMessage) else: # FIXME test that this is a legal name self.__strConfigXIA2COREType = strXIA2COREType strVersion = EDConfiguration.getStringParamValue( xsPluginItem, EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_VERSION_STRING) if (strVersion == None): EDVerbose.DEBUG("EDPluginExecProcessXIA2CORE.configure: No configuration parameter found for: " + \ EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_VERSION_STRING + ", NO default value!") else: self.setStringVersion(strVersion) if (self.__strLogFileName == None): self.setLogFileName(self.getBaseName() + ".log") if (self.__strErrorLogFileName == None): self.setErrorLogFileName(self.getBaseName() + ".err") if self.__strExecutable is None: EDVerbose.ERROR("Executable not defined in configuration file") # shall we raise an exception? self.__strPathToHostNamePidFile = os.path.join( self.getWorkingDirectory(), os.path.basename(self.__strExecutable) + "_hostNamePid.txt") return
def configure(self): """ Configures the plugin from the configuration file with the following parameters - The shell that will execute the script - Script executor - Script executable to be invoked - Path to CCP4 setup file if required - The 3rd party executable installed version """ EDPluginExec.configure(self) EDVerbose.DEBUG("EDPluginExecProcessXIA2CORE.configure") xsPluginItem = self.getConfiguration() if (xsPluginItem == None): EDVerbose.warning( "EDPluginExecProcessXIA2CORE.configure: No plugin item defined.") xsPluginItem = XSPluginItem() if (self.getExecutable() is None): strExecutable = EDConfiguration.getStringParamValue( xsPluginItem, EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_EXECUTABLE) if(strExecutable == None): strErrorMessage = "Configuration parameter missing: " + \ EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_EXECUTABLE EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() if (EDVerbose.isVerboseDebug()): raise RuntimeError, strErrorMessage else: # Check that the executable file exists if (os.path.exists(strExecutable) == False): strErrorMessage = "Cannot find configured " + EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_EXECUTABLE + " : " + strExecutable EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() if (EDVerbose.isVerboseDebug()): raise RuntimeError, strErrorMessage else: self.setExecutable(strExecutable) if (self.getConfigXIA2COREType() is None): strXIA2COREType = EDConfiguration.getStringParamValue( xsPluginItem, EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_XIA2CORE_TYPE) if(strXIA2COREType == None): strErrorMessage = "Configuration parameter not set: " + \ EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_XIA2CORE_TYPE EDVerbose.DEBUG(strErrorMessage) else: # FIXME test that this is a legal name self.__strConfigXIA2COREType = strXIA2COREType strVersion = EDConfiguration.getStringParamValue(xsPluginItem, EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_VERSION_STRING) if(strVersion == None): EDVerbose.DEBUG("EDPluginExecProcessXIA2CORE.configure: No configuration parameter found for: " + \ EDPluginExecProcessXIA2CORE.CONF_EXEC_PROCESS_VERSION_STRING + ", NO default value!") else: self.setStringVersion(strVersion) if (self.__strLogFileName == None): self.setLogFileName(self.getBaseName() + ".log") if (self.__strErrorLogFileName == None): self.setErrorLogFileName(self.getBaseName() + ".err") if self.__strExecutable is None: EDVerbose.ERROR("Executable not defined in configuration file") # shall we raise an exception? self.__strPathToHostNamePidFile = os.path.join(self.getWorkingDirectory(), os.path.basename(self.__strExecutable) + "_hostNamePid.txt") return