def store(self, out, header=""):
""" Write the properties list to the stream 'out' along
with the optional 'header' """
if out.mode[0] != 'w':
raise ValueError('Steam should be opened in write mode!')
try:
#out.write(''.join(('#',header,'\n')))
# Write timestamp
#tstamp = time.strftime('%a %b %d %H:%M:%S %Z %Y', time.localtime())
#out.write(''.join(('#',tstamp,'\n')))
# Write properties from the pristine dictionary
for key, value in sorted(self._origprops.items()):
line = ''.join((key,'=',self.escape(value)))
if not line.endswith('\n'):
line += '\n'
out.write(line)
out.close()
except IOError as e:
raise
pyjavaproperties.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录