本文整理汇总了Python中mantid.kernel.ConfigService.keys方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigService.keys方法的具体用法?Python ConfigService.keys怎么用?Python ConfigService.keys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid.kernel.ConfigService
的用法示例。
在下文中一共展示了ConfigService.keys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_properties_documented
# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import keys [as 别名]
def test_properties_documented(self):
# location of the rst file relative to this file this will break if either moves
doc_filename = os.path.split(inspect.getfile(self.__class__))[0]
doc_filename = os.path.join(doc_filename, '../../../../../../docs/source/concepts/PropertiesFile.rst')
doc_filename = os.path.abspath(doc_filename)
# read in the user documentation
print ('Parsing', doc_filename)
documented_keys = []
with open(doc_filename) as handle:
text = handle.read()
# these will be ignored - the list should get shorter over time
hidden_prefixes = ['CheckMantidVersion.DownloadURL', # shouldn't be changed by users
'CheckMantidVersion.GitHubReleaseURL', # shouldn't be changed by users
'UpdateInstrumentDefinitions.URL', # shouldn't be changed by users
'docs.html.root', # shouldn't be changed by users
'errorreports.rooturl', # shouldn't be changed by users
'usagereports.rooturl', # shouldn't be changed by users
'workspace.sendto.SansView.arguments', 'workspace.sendto.SansView.saveusing', # related to SASview in menu
'workspace.sendto.SansView.target', 'workspace.sendto.SansView.visible', # related to SASview in menu
'workspace.sendto.name.SansView', # related to SASview in menu
'catalog.oncat.token.accessToken', 'catalog.oncat.token.expiresIn', 'catalog.oncat.token.refreshToken', 'catalog.oncat.token.scope', 'catalog.oncat.token.tokenType', # Shouldn't be changed by users.
########## TODO should be documented!
'filefinder.casesensitive',
'graph1d.autodistribution',
'groupingFiles.directory',
'icatDownload.directory', 'icatDownload.mountPoint',
'instrument.view.geometry',
'interfaces.categories.hidden',
'loading.multifile', 'loading.multifilelimit',
'maskFiles.directory',
'pythonalgorithms.refresh.allowed',
'sliceviewer.nonorthogonal',
'usersearch.directories',
########## TODO should these be documented?
'curvefitting.defaultPeak', 'curvefitting.findPeaksFWHM', 'curvefitting.findPeaksTolerance', 'curvefitting.guiExclude',
'logging.channels.consoleChannel.class', 'logging.channels.consoleChannel.formatter', 'logging.formatters.f1.class', 'logging.formatters.f1.pattern', 'logging.formatters.f1.times', 'logging.loggers.root.channel.channel1', 'logging.loggers.root.channel.class',
'MantidOptions.ReusePlotInstances',
'mantidqt.python_interfaces', 'mantidqt.python_interfaces_directory',
'paraview.ignore', 'paraview.path', 'paraview.pythonpaths', 'pvplugins.directory',
'python.plugins.directories',
]
# create the list of things
undocumented = []
properties_defined = ConfigService.keys()
for property in properties_defined:
property_tag = '``{}``'.format(property)
if property_tag not in text:
for hidden in hidden_prefixes:
if property.startswith(hidden):
break
else:
undocumented.append(property)
# everything should be documented
if len(undocumented) > 0:
raise AssertionError('{} undocumented properties: {}'.format(len(undocumented), undocumented))