本文整理汇总了Python中java.util.Properties.entrySet方法的典型用法代码示例。如果您正苦于以下问题:Python Properties.entrySet方法的具体用法?Python Properties.entrySet怎么用?Python Properties.entrySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Properties
的用法示例。
在下文中一共展示了Properties.entrySet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadProperties
# 需要导入模块: from java.util import Properties [as 别名]
# 或者: from java.util.Properties import entrySet [as 别名]
def loadProperties(fileName):
properties = Properties()
input = FileInputStream(fileName)
properties.load(input)
input.close()
result= {}
for entry in properties.entrySet(): result[entry.key] = entry.value
return result
示例2: str
# 需要导入模块: from java.util import Properties [as 别名]
# 或者: from java.util.Properties import entrySet [as 别名]
project = 'Armeria'
project_short = 'Armeria'
copyright = properties.get('inceptionYear') + '-' + str(date.today().year) + ', LINE Corporation'
# Set the project version and release.
# Use the last known stable release if the current version ends with '-SNAPSHOT'.
if re.match(r'^.*-SNAPSHOT$', properties.get('version')):
release = '0.32.0'
else:
release = properties.get('version')
version = re.match(r'^[0-9]+\.[0-9]+', release).group(0)
# Export the loaded properties and some useful values into epilogs
rst_epilog = '\n'
rst_epilog += '.. |baseurl| replace:: http://line.github.io/armeria/\n'
propIter = properties.entrySet().iterator()
while propIter.hasNext():
propEntry = propIter.next()
if propEntry.getKey() in [ 'release', 'version' ]:
continue
rst_epilog += '.. |' + propEntry.getKey() + '| replace:: ' + propEntry.getValue() + '\n'
rst_epilog += '\n'
needs_sphinx = '1.0'
extensions = ['sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
source_encoding = 'utf-8-sig'
master_doc = 'index'
exclude_trees = ['.build']
add_function_parentheses = True