本文整理汇总了Python中mantid.kernel.ConfigService.setFacility方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigService.setFacility方法的具体用法?Python ConfigService.setFacility怎么用?Python ConfigService.setFacility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid.kernel.ConfigService
的用法示例。
在下文中一共展示了ConfigService.setFacility方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_and_set_facility
# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import setFacility [as 别名]
def test_update_and_set_facility(self):
self.assertFalse("TEST" in config.getFacilityNames())
ConfigService.updateFacilities(
os.path.join(ConfigService.getInstrumentDirectory(), "IDFs_for_UNIT_TESTING/UnitTestFacilities.xml")
)
ConfigService.setFacility("TEST")
self.assertEquals(config.getFacility().name(), "TEST")
self.assertRaises(RuntimeError, config.getFacility, "SNS")
示例2: action_facility_changed
# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import setFacility [as 别名]
def action_facility_changed(self, new_facility):
"""
When the facility is changed, refreshes all available instruments that can be selected in the dropdown.
:param new_facility: The name of the new facility that was selected
"""
ConfigService.setFacility(new_facility)
# refresh the instrument selection to contain instruments about the selected facility only
self.view.instrument.clear()
self.view.instrument.addItems(
[instr.name() for instr in ConfigService.getFacility(new_facility).instruments()])